ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/map-prefetch.ext
(Generate patch)

Comparing deliantra/maps/perl/map-prefetch.ext (file contents):
Revision 1.8 by root, Sun Jul 16 19:14:10 2006 UTC vs.
Revision 1.12 by root, Sun Aug 27 15:23:30 2006 UTC

110 110
111 my $exit = $MAP_EXITS{$map->path} ||= find_exits $map; 111 my $exit = $MAP_EXITS{$map->path} ||= find_exits $map;
112 prefetch map => $_ for @$exit; 112 prefetch map => $_ for @$exit;
113} 113}
114 114
115sub on_mapenter { 115cf::attach_to_players prio => -900,
116 my ($ob) = @_; 116 on_map_change => sub {
117 my ($pl, $old, $new) = @_;
117 118
118 prefetch_map $ob->map; 119 prefetch_map $new;
119} 120 },
121;
120 122
123if (0) { #test#
121# prefetch a few players/second 124# prefetch a few players/second
122{ 125{
123 my @players; 126 my @players;
124 127
125 Event->timer (interval => 0.2, cb => sub { 128 Event->timer (interval => 0.2, cb => sub {
149 }; 152 };
150 153
151 $prefetch->(); $prefetch->(); 154 $prefetch->(); $prefetch->();
152 }; 155 };
153}); 156});
157}
154 158
155 159
156 160

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines