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.10 by root, Thu Jun 7 19:12:22 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;
14 $self->{orig_path} = $2; 9 $self->{orig_path} = $2;
15 $self->{deny_reset} = 1; #d# for now
16} 10}
17 11
18sub thawer_merge { 12sub 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
27sub load_path { 20sub 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
33sub save_path { 26sub 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
40sub uniq_path { 33sub uniq_path {
41 undef 34 undef
42} 35}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines