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; |
… | |
… | |
25 | } |
20 | } |
26 | |
21 | |
27 | sub load_path { |
22 | sub load_path { |
28 | my ($self) = @_; |
23 | my ($self) = @_; |
29 | |
24 | |
30 | sprintf "%s/%s/%s", cf::datadir, cf::mapdir, $self->{orig_path} |
25 | "$cf::MAPDIR/$self->{orig_path}.map" |
31 | } |
26 | } |
32 | |
27 | |
33 | sub save_path { |
28 | sub save_path { |
34 | my ($self) = @_; |
29 | my ($self) = @_; |
35 | |
30 | |
36 | (my $path = $_[0]{orig_path}) =~ s/\//$PATH_SEP/g; |
31 | (my $path = $_[0]{orig_path}) =~ s/\//$PATH_SEP/g; |
37 | sprintf "%s/%s/%s/%s", cf::localdir, cf::playerdir, $self->{user}, $path |
32 | "$cf::PLAYERDIR/$self->{user}/$path.map" |
38 | } |
33 | } |
39 | |
34 | |
40 | sub uniq_path { |
35 | sub uniq_path { |
41 | undef |
36 | undef |
42 | } |
37 | } |
… | |
… | |
51 | $self->per_player (0); |
46 | $self->per_player (0); |
52 | |
47 | |
53 | 1 |
48 | 1 |
54 | } |
49 | } |
55 | |
50 | |
|
|
51 | sub decay_objects { |
|
|
52 | # do nothing on per player maps at the moment |
|
|
53 | # to protect apartments. |
|
|
54 | # TODO: apartments should be marked as such |
|
|
55 | # (no reset, no decay etc.) |
|
|
56 | } |
|
|
57 | |
56 | 1 |
58 | 1 |
57 | |
59 | |