ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/map-per-player.ext
(Generate patch)

Comparing deliantra/server/ext/map-per-player.ext (file contents):
Revision 1.5 by elmex, Thu Jan 18 15:12:43 2007 UTC vs.
Revision 1.9 by root, Thu Apr 19 11:12:45 2007 UTC

1#! perl # MANDATORY 1#! perl # MANDATORY
2 2
3cf::map->register (qr{^~([^/]+)(/.*)}); 3cf::map->register (qr{^~([^/]+)(/.*)});
4
5sub decay_objects {
6 # do nothing on per player maps at the moment
7 # as the lone town apartment is broooken
8}
9 4
10sub init { 5sub init {
11 my ($self) = @_; 6 my ($self) = @_;
12 7
13 $self->{user} = $1; 8 $self->{user} = $1;
25} 20}
26 21
27sub load_path { 22sub 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
33sub save_path { 28sub 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
40sub uniq_path { 35sub 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
51sub 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
561 581
57 59

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines