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.42 by root, Fri Apr 22 06:19:07 2011 UTC vs.
Revision 1.45 by root, Wed May 4 16:12:15 2011 UTC

1#! perl # optional 1#! perl # mandatory
2 2
3# manages the worldmap by directing to other handlers 3# manages the worldmap by directing to other handlers
4 4
5cf::map->register (qr{^/world/world_(-?\d+)_(-?\d+)(?:_(-?\d+))?$}, 100); 5cf::map->register (qr{^/world/world_(-?\d+)_(-?\d+)(?:_(-?\d+))?$}, 100);
6 6
61 61
62 $self->init_worldmap ($meta); 62 $self->init_worldmap ($meta);
63 63
64 last; 64 last;
65 } 65 }
66
67 } 66 }
68 67
69 $self->SUPER::init; 68 $self->SUPER::init;
70} 69}
71 70
118 } else { 117 } else {
119 $self->add_underlay ("\x00" x ($TILE_W * $TILE_H), 0, $TILE_W, ["deep_sea"]); 118 $self->add_underlay ("\x00" x ($TILE_W * $TILE_H), 0, $TILE_W, ["deep_sea"]);
120 } 119 }
121} 120}
122 121
123sub load { 122#sub load {
124 my ($self) = @_; 123# my ($self) = @_;
125 124#
126 if ($self->{load_path}) { 125# if ($self->{load_path}) {
126# warn "load $self\n";#d#
127 $self->SUPER::load; 127# $self->SUPER::load;
128 } else { 128# } else {
129# warn "fill $self\n";#d#
130# my $guard = cf::lock_acquire "map_data:$self->{path}";
131#
129 $self->alloc; 132# $self->alloc;
130 $self->fill; 133# $self->fill;
131 $self->in_memory (cf::MAP_ACTIVE); 134# $self->state (cf::MAP_ACTIVE);
132 $self->activate; 135# $self->activate;
136# $self->post_load;
133 } 137# }
134} 138#}
135 139
136# MUST be overwritten to call at least ->fill 140# MUST be overwritten to call at least ->fill
137sub post_load { 141sub post_load {
138 my ($self) = @_; 142 my ($self) = @_;
139 143

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines