--- deliantra/server/lib/cf.pm 2006/09/03 22:45:56 1.61 +++ deliantra/server/lib/cf.pm 2006/09/08 17:41:41 1.63 @@ -13,12 +13,10 @@ use strict; -_reload_1; +_init_vars; our %COMMAND = (); our @EVENT; -our %PROP_TYPE; -our %PROP_IDX; our $LIBDIR = maps_directory "perl"; our $TICK = MAX_TIME * 1e-6; @@ -36,40 +34,6 @@ }; } -my %ignore_set = (MAP_PROP_PATH => 1); # I hate the plug-in api. Deeply! - -# generate property mutators -sub prop_gen { - my ($prefix, $class) = @_; - - no strict 'refs'; - - for my $prop (keys %PROP_TYPE) { - $prop =~ /^\Q$prefix\E_(.*$)/ or next; - my $sub = lc $1; - - my $type = $PROP_TYPE{$prop}; - my $idx = $PROP_IDX {$prop}; - - *{"$class\::get_$sub"} = *{"$class\::$sub"} = sub { - $_[0]->get_property ($type, $idx) - }; - - *{"$class\::set_$sub"} = sub { - $_[0]->set_property ($type, $idx, $_[1]); - } unless $ignore_set{$prop}; - } -} - -# auto-generate most of the API - -prop_gen OBJECT_PROP => "cf::object"; -# CFAPI_OBJECT_ANIMATION? -prop_gen PLAYER_PROP => "cf::object::player"; - -prop_gen MAP_PROP => "cf::map"; -prop_gen ARCH_PROP => "cf::arch"; - @safe::cf::object::player::ISA = @cf::object::player::ISA = 'cf::object'; # we bless all objects into (empty) derived classes to force a method lookup @@ -733,6 +697,9 @@ $msg->("load extensions"); cf::load_extensions; + + $msg->("reattach"); + _global_reattach; }; $msg->($@) if $@; @@ -961,7 +928,5 @@ }, ); -_reload_2; - 1