--- deliantra/server/ext/map-scheduler.ext 2007/01/08 14:11:05 1.19 +++ deliantra/server/ext/map-scheduler.ext 2007/01/09 21:32:42 1.20 @@ -8,7 +8,6 @@ our $SWAP_TIMEOUT = 35; # number of seconds after which maps inactive get swapped out our $SCHEDULE_INTERVAL = 2; # time the map scheduler sleeps between runs our $SAVE_TIMEOUT = 20; # save maps every n seconds -our $SAVE_INTERVAL = 0.2; # save at max. one map every $SAVE_INTERVAL cf::async_ext { $Coro::current->prio (Coro::PRIO_MIN); @@ -55,11 +54,11 @@ $map->reset; } elsif ($map->in_memory == cf::MAP_IN_MEMORY) { if ($map->last_access + $SWAP_TIMEOUT <= $cf::RUNTIME && !$map->players) { + $cf::WAIT_FOR_TICK_ONE->wait; $map->swap_out; - Coro::Timer::sleep $SAVE_INTERVAL; } elsif ($map->{last_save} + $SAVE_TIMEOUT <= $cf::RUNTIME) { + $cf::WAIT_FOR_TICK_ONE->wait; $map->save; - Coro::Timer::sleep $SAVE_INTERVAL; } } };