… | |
… | |
79 | # $map->deactivate; |
79 | # $map->deactivate; |
80 | # delete $map->{active}; |
80 | # delete $map->{active}; |
81 | # } |
81 | # } |
82 | if ($map->should_reset) { |
82 | if ($map->should_reset) { |
83 | $map->reset; |
83 | $map->reset; |
84 | } elsif ($map->in_memory == cf::MAP_ACTIVE) { |
84 | } elsif ($map->linkable) { |
85 | my $max_idle = cf::clamp +(cf::lerp $cf::LOADAVG, $SWAP_LOAD1, $SWAP_LOAD2, $SWAP_TIMEOUT, $cf::TICK * 1.5), |
85 | my $max_idle = cf::clamp +(cf::lerp $cf::LOADAVG, $SWAP_LOAD1, $SWAP_LOAD2, $SWAP_TIMEOUT, $cf::TICK * 1.5), |
86 | $cf::TICK * 1.5, $SWAP_TIMEOUT; |
86 | $cf::TICK * 1.5, $SWAP_TIMEOUT; |
87 | |
87 | |
88 | if ($map->last_access + $max_idle <= $cf::RUNTIME && !$map->players) { |
88 | if ($map->last_access + $max_idle <= $cf::RUNTIME && !$map->players) { |
89 | $map->swap_out; |
89 | $map->swap_out; |