… | |
… | |
481 | |
481 | |
482 | our $SCHEDULE_INTERVAL = 10; # time the player scheduler sleeps between runs |
482 | our $SCHEDULE_INTERVAL = 10; # time the player scheduler sleeps between runs |
483 | our $SAVE_TIMEOUT = 20; # save players every n seconds |
483 | our $SAVE_TIMEOUT = 20; # save players every n seconds |
484 | |
484 | |
485 | our $SCHEDULER = cf::async_ext { |
485 | our $SCHEDULER = cf::async_ext { |
486 | my $schedule_interval = Coro::Event->timer (after => 1, interval => $SCHEDULE_INTERVAL); |
486 | my $schedule_interval = Coro::Event->timer (after => 1); |
487 | while () { |
487 | while () { |
|
|
488 | $schedule_interval->interval ($SCHEDULE_INTERVAL); |
488 | $schedule_interval->next; |
489 | $schedule_interval->next; |
489 | |
490 | |
490 | # this weird form of iteration over values is used because |
491 | # this weird form of iteration over values is used because |
491 | # the hash changes underneath us frequently, and for |
492 | # the hash changes underneath us frequently, and for |
492 | # keeps a direct reference to the value without (in 5.8 perls) |
493 | # keeps a direct reference to the value without (in 5.8 perls) |