… | |
… | |
82 | |
82 | |
83 | if ($map->last_access + $max_idle <= $cf::RUNTIME && !$map->players) { |
83 | if ($map->last_access + $max_idle <= $cf::RUNTIME && !$map->players) { |
84 | $map->swap_out; |
84 | $map->swap_out; |
85 | } elsif ($map->{last_save} + $SAVE_TIMEOUT <= $cf::RUNTIME) { |
85 | } elsif ($map->{last_save} + $SAVE_TIMEOUT <= $cf::RUNTIME) { |
86 | $map->save; |
86 | $map->save; |
|
|
87 | $map->{last_save} -= rand; # randomise map save times a bit |
87 | } |
88 | } |
88 | } |
89 | } |
89 | }; |
90 | }; |
90 | warn $@ if $@; |
91 | warn $@ if $@; |
91 | cf::cede_to_tick; |
92 | cf::cede_to_tick; |