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.76 by root, Mon Oct 2 15:28:36 2006 UTC vs.
Revision 1.77 by root, Sun Nov 5 11:13:01 2006 UTC

5use Storable; 5use Storable;
6use Opcode; 6use Opcode;
7use Safe; 7use Safe;
8use Safe::Hole; 8use Safe::Hole;
9 9
10use IO::AIO ();
10use YAML::Syck (); 11use YAML::Syck ();
11use Time::HiRes; 12use Time::HiRes;
12use Event; 13use Event;
13$Event::Eval = 1; # no idea why this is required, but it is 14$Event::Eval = 1; # no idea why this is required, but it is
14 15
1144register "<global>", __PACKAGE__; 1145register "<global>", __PACKAGE__;
1145 1146
1146unshift @INC, $LIBDIR; 1147unshift @INC, $LIBDIR;
1147 1148
1148$TICK_WATCHER = Event->timer ( 1149$TICK_WATCHER = Event->timer (
1149 prio => 1, 1150 prio => 1,
1151 async => 1,
1150 at => $NEXT_TICK || 1, 1152 at => $NEXT_TICK || 1,
1151 cb => sub { 1153 cb => sub {
1152 cf::server_tick; # one server iteration 1154 cf::server_tick; # one server iteration
1153 1155
1154 my $NOW = Event::time; 1156 my $NOW = Event::time;
1155 $NEXT_TICK += $TICK; 1157 $NEXT_TICK += $TICK;
1156 1158
1160 $TICK_WATCHER->at ($NEXT_TICK); 1162 $TICK_WATCHER->at ($NEXT_TICK);
1161 $TICK_WATCHER->start; 1163 $TICK_WATCHER->start;
1162 }, 1164 },
1163); 1165);
1164 1166
1167IO::AIO::max_poll_time $TICK * 0.2;
1168
1169Event->io (fd => IO::AIO::poll_fileno,
1170 poll => 'r',
1171 prio => 5,
1172 cb => \&IO::AIO::poll_cb);
1173
11651 11741
1166 1175

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines