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.4 by root, Sun Jan 14 02:00:36 2007 UTC vs.
Revision 1.11 by root, Mon Jun 11 21:38:13 2007 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines