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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines