1 |
#! perl # MANDATORY |
2 |
|
3 |
cf::map->register (qr{^~([^/]+)(/.*)}); |
4 |
|
5 |
sub decay_objects { |
6 |
# do nothing on per player maps at the moment |
7 |
# as the lone town apartment is broooken |
8 |
} |
9 |
|
10 |
sub init { |
11 |
my ($self) = @_; |
12 |
|
13 |
$self->{user} = $1; |
14 |
$self->{orig_path} = $2; |
15 |
$self->{deny_reset} = 1; #d# for now |
16 |
} |
17 |
|
18 |
sub thawer_merge { |
19 |
# we have to keep some variables in memory intact |
20 |
local $_[0]{user}; |
21 |
local $_[0]{orig_path}; |
22 |
local $_[0]{deny_reset}; |
23 |
|
24 |
$_[0]->SUPER::thawer_merge ($_[1]); |
25 |
} |
26 |
|
27 |
sub load_path { |
28 |
my ($self) = @_; |
29 |
|
30 |
sprintf "%s/%s/%s", cf::datadir, cf::mapdir, $self->{orig_path} |
31 |
} |
32 |
|
33 |
sub save_path { |
34 |
my ($self) = @_; |
35 |
|
36 |
(my $path = $_[0]{orig_path}) =~ s/\//$PATH_SEP/g; |
37 |
sprintf "%s/%s/%s/%s", cf::localdir, cf::playerdir, $self->{user}, $path |
38 |
} |
39 |
|
40 |
sub uniq_path { |
41 |
undef |
42 |
} |
43 |
|
44 |
sub load_header { |
45 |
my ($self) = @_; |
46 |
|
47 |
$self->SUPER::load_header |
48 |
or return; |
49 |
|
50 |
# forcefully disable per_player flag |
51 |
$self->per_player (0); |
52 |
|
53 |
1 |
54 |
} |
55 |
|
56 |
1 |
57 |
|