#! perl # mandatory cf::map->register (qr{^~([^/]+)(/.*)}); sub init { my ($self) = @_; $self->{user} = $1; $self->{orig_path} = $2; } sub thawer_merge { # we have to keep some variables in memory intact local $_[0]{user}; local $_[0]{orig_path}; $_[0]->SUPER::thawer_merge ($_[1]); } sub load_path { my ($self) = @_; "$cf::MAPDIR/$self->{orig_path}.map" } sub save_path { my ($self) = @_; (my $path = $_[0]{orig_path}) =~ s/\//$PATH_SEP/g; "$cf::PLAYERDIR/$self->{user}/$path.map" } 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 }