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.79 by root, Tue Nov 7 14:58:35 2006 UTC vs.
Revision 1.83 by root, Mon Dec 11 01:30:41 2006 UTC

28our $TICK_WATCHER; 28our $TICK_WATCHER;
29our $NEXT_TICK; 29our $NEXT_TICK;
30 30
31our %CFG; 31our %CFG;
32 32
33our $uptime; 33our $uptime;#d#
34 34our $UPTIME;
35$uptime ||= time; 35$UPTIME ||= $uptime;#d#
36$UPTIME ||= time;
36 37
37############################################################################# 38#############################################################################
38 39
39=head2 GLOBAL VARIABLES 40=head2 GLOBAL VARIABLES
40 41
41=over 4 42=over 4
43
44=item $cf::UPTIME
45
46The timestamp of the server start (so not actually an uptime).
42 47
43=item $cf::LIBDIR 48=item $cf::LIBDIR
44 49
45The perl library directory, where extensions and cf-specific modules can 50The perl library directory, where extensions and cf-specific modules can
46be found. It will be added to C<@INC> automatically. 51be found. It will be added to C<@INC> automatically.
523 unlink $filename; 528 unlink $filename;
524 unlink "$filename.pst"; 529 unlink "$filename.pst";
525 } 530 }
526} 531}
527 532
533sub object_freezer_as_string {
534 my ($rdata, $objs) = @_;
535
536 use Data::Dumper;
537
538 $$rdata . Dumper $objs
539}
540
528sub object_thawer_load { 541sub object_thawer_load {
529 my ($filename) = @_; 542 my ($filename) = @_;
530 543
531 local $/; 544 local $/;
532 545
634 . "#line 1 \"$path\"\n{\n" 647 . "#line 1 \"$path\"\n{\n"
635 . (do { local $/; <$fh> }) 648 . (do { local $/; <$fh> })
636 . "\n};\n1"; 649 . "\n};\n1";
637 650
638 eval $source 651 eval $source
639 or die "$path: $@"; 652 or die $@ ? "$path: $@\n"
653 : "extension disabled.\n";
640 654
641 push @exts, $pkg; 655 push @exts, $pkg;
642 $ext_pkg{$base} = $pkg; 656 $ext_pkg{$base} = $pkg;
643 657
644# no strict 'refs'; 658# no strict 'refs';
1177 $TICK_WATCHER->at ($NEXT_TICK); 1191 $TICK_WATCHER->at ($NEXT_TICK);
1178 $TICK_WATCHER->start; 1192 $TICK_WATCHER->start;
1179 }, 1193 },
1180); 1194);
1181 1195
1182eval { IO::AIO::max_poll_time $TICK * 0.2 }; #d# remove eval after restart 1196IO::AIO::max_poll_time $TICK * 0.2;
1183 1197
1184Event->io (fd => IO::AIO::poll_fileno, 1198Event->io (fd => IO::AIO::poll_fileno,
1185 poll => 'r', 1199 poll => 'r',
1186 prio => 5, 1200 prio => 5,
1187 cb => \&IO::AIO::poll_cb); 1201 cb => \&IO::AIO::poll_cb);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines