#! perl # MANDATORY cf::map->register (qr{^~([^/]+)(/.*)}); sub init { my ($self) = @_; $self->{user} = $1; $self->{orig_path} = $2; $self->{deny_reset} = 1; #d# for now } sub thawer_merge { # we have to keep some variables in memory intact local $_[0]{user}; local $_[0]{orig_path}; local $_[0]{deny_reset}; $_[0]->SUPER::thawer_merge ($_[1]); } sub load_path { my ($self) = @_; "$cf::MAPDIR/$self->{orig_path}" } sub save_path { my ($self) = @_; (my $path = $_[0]{orig_path}) =~ s/\//$PATH_SEP/g; "$cf::PLAYERDIR/$self->{user}/$path" } sub uniq_path { undef } sub load_header { my ($self) = @_; $self->SUPER::load_header or return; # forcefully disable per_player flag $self->per_player (0); 1 } sub decay_objects { # do nothing on per player maps at the moment # to protect apartments. # TODO: apartments should be marked as such # (no reset, no decay etc.) } 1