ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/map-per-player.ext
Revision: 1.2
Committed: Sat Jan 13 23:32:43 2007 UTC (17 years, 4 months ago) by root
Branch: MAIN
Changes since 1.1: +18 -4 lines
Log Message:
fixes, starting to look good again

File Contents

# User Rev Content
1 root 1.1 #! perl # MANDATORY
2    
3 root 1.2 cf::map->register (qr{^~([^/]+)(/.*)});
4 root 1.1
5     sub init {
6     my ($self) = @_;
7    
8     $self->{user} = $1;
9 root 1.2 $self->{orig_path} = $2;
10 root 1.1 }
11    
12 root 1.2 sub load_path {
13 root 1.1 my ($self) = @_;
14    
15 root 1.2 sprintf "%s/%s/%s", cf::datadir, cf::mapdir, $self->{orig_path}
16 root 1.1 }
17    
18     sub save_path {
19     my ($self) = @_;
20    
21 root 1.2 (my $path = $_[0]{orig_path}) =~ s/\//$PATH_SEP/g;
22     sprintf "%s/%s/%s/%s", cf::localdir, cf::playerdir, $self->{user}, $path
23 root 1.1 }
24    
25     sub uniq_path {
26     undef
27     }
28    
29 root 1.2 sub load_header {
30     my ($self) = @_;
31    
32     $self->SUPER::load_header
33     or return;
34    
35     # forcefully disable per_player flag
36     $self->per_player (0);
37    
38     1
39     }
40    
41 root 1.1 1
42