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.10 by root, Sat Feb 10 01:52:27 2007 UTC vs.
Revision 1.11 by root, Sun Feb 11 01:38:47 2007 UTC

67} 67}
68 68
69sub load_gridmap($) { 69sub load_gridmap($) {
70 my ($path) = @_; 70 my ($path) = @_;
71 71
72 if (! -e "/tmp/xxxx.gridmap") {
72 0 < aio_load "$path/gridmap.meta", my $map 73 0 < aio_load "$path/gridmap.meta", my $map
73 or cf::cleanup "$path/gridmap.meta: $!\n"; 74 or cf::cleanup "$path/gridmap.meta: $!\n";
74 75
75 $map = cf::from_json $map; 76 $map = cf::from_json $map;
76 77
77 my $size = $map->{tile_w} * $map->{tile_h} * $map->{grid_w} * $map->{grid_h} 78 my $size = $map->{tile_w} * $map->{tile_h} * $map->{grid_w} * $map->{grid_h}
78 or cf::cleanup "$path/gridmap.meta: empty gridmap?"; 79 or cf::cleanup "$path/gridmap.meta: empty gridmap?";
79 80
80 ($map->{arc_data}, $map->{arc_plt}) = load_indexed "$path/gridmap.arch", $size; 81 ($map->{arc_data}, $map->{arc_plt}) = load_indexed "$path/gridmap.arch", $size;
81 ($map->{reg_data}, $map->{reg_plt}) = load_indexed "$path/gridmap.regn", $size; 82 ($map->{reg_data}, $map->{reg_plt}) = load_indexed "$path/gridmap.regn", $size;
82 83
84 Storable::nstore $map, "/tmp/xxxx.gridmap";#d#
85
83 $map 86 $map
87 } else {
88 Storable::retrieve "/tmp/xxxx.gridmap";
89 }
84} 90}
85 91
86# this is contorted, but likely the correct way to acquire the lock :) 92# this is contorted, but likely the correct way to acquire the lock :)
87cf::sync_job { 93cf::sync_job {
88 my $guard = cf::lock_acquire "ext::world_gridmap"; 94 my $guard = cf::lock_acquire "ext::world_gridmap";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines