1 | #! perl # MANDATORY |
1 | #! perl # mandatory |
2 | |
2 | |
3 | cf::map->register (qr{^~([^/]+)(/.*)}); |
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 | |
4 | |
10 | sub init { |
5 | sub init { |
11 | my ($self) = @_; |
6 | my ($self) = @_; |
12 | |
7 | |
13 | $self->{user} = $1; |
8 | $self->{user} = $1; |
14 | $self->{orig_path} = $2; |
9 | $self->{orig_path} = $2; |
15 | $self->{deny_reset} = 1; #d# for now |
|
|
16 | } |
10 | } |
17 | |
11 | |
18 | sub thawer_merge { |
12 | sub thawer_merge { |
19 | # we have to keep some variables in memory intact |
13 | # we have to keep some variables in memory intact |
20 | local $_[0]{user}; |
14 | local $_[0]{user}; |
21 | local $_[0]{orig_path}; |
15 | local $_[0]{orig_path}; |
22 | local $_[0]{deny_reset}; |
|
|
23 | |
16 | |
24 | $_[0]->SUPER::thawer_merge ($_[1]); |
17 | $_[0]->SUPER::thawer_merge ($_[1]); |
25 | } |
18 | } |
26 | |
19 | |
27 | sub load_path { |
20 | sub load_path { |
28 | my ($self) = @_; |
21 | my ($self) = @_; |
29 | |
22 | |
30 | sprintf "%s/%s/%s", cf::datadir, cf::mapdir, $self->{orig_path} |
23 | "$cf::MAPDIR/$self->{orig_path}.map" |
31 | } |
24 | } |
32 | |
25 | |
33 | sub save_path { |
26 | sub save_path { |
34 | my ($self) = @_; |
27 | my ($self) = @_; |
35 | |
28 | |
36 | (my $path = $_[0]{orig_path}) =~ s/\//$PATH_SEP/g; |
29 | (my $path = $_[0]{orig_path}) =~ s/\//$PATH_SEP/g; |
37 | sprintf "%s/%s/%s/%s", cf::localdir, cf::playerdir, $self->{user}, $path |
30 | "$cf::PLAYERDIR/$self->{user}/$path.map" |
38 | } |
31 | } |
39 | |
32 | |
40 | sub uniq_path { |
33 | sub uniq_path { |
41 | undef |
34 | undef |
42 | } |
35 | } |