--- deliantra/server/ext/map-scheduler.ext 2007/01/09 21:32:42 1.20 +++ deliantra/server/ext/map-scheduler.ext 2007/01/13 23:32:43 1.23 @@ -1,4 +1,4 @@ -#! perl +#! perl # MANDATORY # this extension swaps out maps and resets them, in essence managing # the reset/swap policy of the server. @@ -22,8 +22,9 @@ utf8::decode $map; next if $map =~ /\.(?:pst|meta)$/; $map =~ s/∕/\//g; + $map =~ s/\.map$//; cf::map::find $map; - Coro::Timer::sleep 0.3; + $cf::WAIT_FOR_TICK_ONE->wait; } #TODO: should also preload random maps... @@ -70,33 +71,3 @@ $SCHEDULER->prio (-2); -# map load prefetch for tiled maps, possibly exits, too -cf::map->attach ( - on_enter => sub { - my ($map, $pl) = @_; - - (cf::async { - my @diag; # diagonal neighbours - - for (0 .. 3) { - my $neigh = $map->tile_path ($_) - or next; - $neigh = cf::map::find $neigh, $map - or next; - $neigh->load; - - push @diag, [$neigh->tile_path (($_ + 3) % 4), $neigh], - [$neigh->tile_path (($_ + 1) % 4), $neigh]; - } - - for (@diag) { - my $neigh = cf::map::find @$_ - or next; - $neigh->load; - } - })->prio (2); - # higher prio because prefetching is very important - # as it prefetches maps that can make the server block - }, -); -