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

Comparing deliantra/server/ext/map-world.ext (file contents):
Revision 1.34 by root, Tue Sep 23 04:29:11 2008 UTC vs.
Revision 1.35 by root, Tue Sep 23 05:01:41 2008 UTC

84sub reload() { 84sub reload() {
85 $WORLD = load_gridmap "$MAPDIR/world"; 85 $WORLD = load_gridmap "$MAPDIR/world";
86 warn "worldmap gridmap loaded."; 86 warn "worldmap gridmap loaded.";
87} 87}
88 88
89# this is contorted, but likely the correct way to acquire the lock :) 89{
90cf::post_init {
91 my $guard = cf::lock_acquire "ext::world_gridmap"; 90 my $guard = cf::lock_acquire "ext::world_gridmap";
91
92 cf::post_init {
92 cf::async_ext { 93 cf::async_ext {
93 $Coro::current->{desc} = "worldmap loader"; 94 $Coro::current->{desc} = "worldmap loader";
94 reload; 95 reload;
95 undef $guard; 96 undef $guard;
97 };
96 }; 98 };
97}; 99}
98 100
99sub wxwy { 101sub wxwy {
100 $_[0]->path =~ m{/world/world_(\d\d\d)_(\d\d\d)$} 102 $_[0]->path =~ m{/world/world_(\d\d\d)_(\d\d\d)$}
101 ? ($1, $2) 103 ? ($1, $2)
102 : (0, 0) 104 : (0, 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines