--- deliantra/server/lib/cf.pm 2006/08/25 15:21:57 1.40 +++ deliantra/server/lib/cf.pm 2006/08/25 15:25:12 1.41 @@ -73,14 +73,14 @@ # guessed hierarchies -@ext::cf::object::player::ISA = @cf::object::player::ISA = 'cf::object'; -@ext::cf::object::map::ISA = @cf::object::map::ISA = 'cf::object'; +@safe::cf::object::player::ISA = @cf::object::player::ISA = 'cf::object'; +@safe::cf::object::map::ISA = @cf::object::map::ISA = 'cf::object'; -# we bless all objects into derived classes to force a method lookup +# we bless all objects into (empty) derived classes to force a method lookup # within the Safe compartment. for my $pkg (qw(cf::object cf::object::map cf::object::player cf::player cf::map cf::party cf::region cf::arch)) { no strict 'refs'; - @{"ext::$pkg\::wrap::ISA"} = @{"$pkg\::wrap::ISA"} = $pkg; + @{"safe::$pkg\::wrap::ISA"} = @{"$pkg\::wrap::ISA"} = $pkg; } $Event::DIED = sub { @@ -301,7 +301,7 @@ my $base = $1; my $pkg = $1; $pkg =~ s/[^[:word:]]/_/g; - $pkg = "cf::ext::$pkg"; + $pkg = "ext::$pkg"; warn "loading '$path' into '$pkg'\n"; @@ -408,8 +408,8 @@ Symbol::delete_package $k; } - # 4. get rid of ext::, as good as possible - Symbol::delete_package "ext::$_" + # 4. get rid of safe::, as good as possible + Symbol::delete_package "safe::$_" for qw(cf::object cf::object::map cf::object::player cf::player cf::map cf::party cf::region); # 5. remove register_script_function callbacks @@ -418,7 +418,8 @@ # 6. unload cf.pm "a bit" delete $INC{"cf.pm"}; - # don't, removes xs symbols, too + # don't, removes xs symbols, too, + # and global variables created in xs #Symbol::delete_package __PACKAGE__; # 7. reload cf.pm @@ -641,7 +642,7 @@ ) { no strict 'refs'; my ($pkg, @funs) = @$_; - *{"ext::$pkg\::$_"} = $safe_hole->wrap (\&{"$pkg\::$_"}) + *{"safe::$pkg\::$_"} = $safe_hole->wrap (\&{"$pkg\::$_"}) for @funs; } @@ -653,7 +654,7 @@ $qcode =~ s/\n/\\n/g; local $_; - local @ext::cf::_safe_eval_args = values %vars; + local @safe::cf::_safe_eval_args = values %vars; $code = "do {\n" @@ -674,7 +675,7 @@ my ($fun, $cb) = @_; no strict 'refs'; - *{"ext::$fun"} = $safe_hole->wrap ($cb); + *{"safe::$fun"} = $safe_hole->wrap ($cb); } #############################################################################