ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf.pm
(Generate patch)

Comparing deliantra/server/lib/cf.pm (file contents):
Revision 1.87 by root, Thu Dec 14 22:45:40 2006 UTC vs.
Revision 1.90 by root, Sat Dec 16 04:22:13 2006 UTC

25our %EXTCMD = (); 25our %EXTCMD = ();
26 26
27_init_vars; 27_init_vars;
28 28
29our @EVENT; 29our @EVENT;
30our $LIBDIR = maps_directory "perl"; 30our $LIBDIR = datadir . "/ext";
31 31
32our $TICK = MAX_TIME * 1e-6; 32our $TICK = MAX_TIME * 1e-6;
33our $TICK_WATCHER; 33our $TICK_WATCHER;
34our $NEXT_TICK; 34our $NEXT_TICK;
35 35
80 80
81# we bless all objects into (empty) derived classes to force a method lookup 81# we bless all objects into (empty) derived classes to force a method lookup
82# within the Safe compartment. 82# within the Safe compartment.
83for my $pkg (qw( 83for my $pkg (qw(
84 cf::object cf::object::player 84 cf::object cf::object::player
85 cf::client_socket cf::player 85 cf::client cf::player
86 cf::arch cf::living 86 cf::arch cf::living
87 cf::map cf::party cf::region 87 cf::map cf::party cf::region
88)) { 88)) {
89 no strict 'refs'; 89 no strict 'refs';
90 @{"safe::$pkg\::wrap::ISA"} = @{"$pkg\::wrap::ISA"} = $pkg; 90 @{"safe::$pkg\::wrap::ISA"} = @{"$pkg\::wrap::ISA"} = $pkg;
720 720
721 Symbol::delete_package $pkg; 721 Symbol::delete_package $pkg;
722} 722}
723 723
724sub load_extensions { 724sub load_extensions {
725 my $LIBDIR = maps_directory "perl";
726
727 for my $ext (<$LIBDIR/*.ext>) { 725 for my $ext (<$LIBDIR/*.ext>) {
728 next unless -r $ext; 726 next unless -r $ext;
729 eval { 727 eval {
730 load_extension $ext; 728 load_extension $ext;
731 1 729 1
1173}; 1171};
1174 1172
1175unshift @INC, $LIBDIR; 1173unshift @INC, $LIBDIR;
1176 1174
1177$TICK_WATCHER = Event->timer ( 1175$TICK_WATCHER = Event->timer (
1178 prio => 1, 1176 prio => 0,
1179 async => 1,
1180 at => $NEXT_TICK || 1, 1177 at => $NEXT_TICK || 1,
1181 data => WF_AUTOCANCEL, 1178 data => WF_AUTOCANCEL,
1182 cb => sub { 1179 cb => sub {
1183 cf::server_tick; # one server iteration 1180 cf::server_tick; # one server iteration
1184 1181

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines