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

# Content
1 #! perl # MANDATORY
2
3 cf::map->register (qr{^~([^/]+)(/.*)});
4
5 sub init {
6 my ($self) = @_;
7
8 $self->{user} = $1;
9 $self->{orig_path} = $2;
10 }
11
12 sub load_path {
13 my ($self) = @_;
14
15 sprintf "%s/%s/%s", cf::datadir, cf::mapdir, $self->{orig_path}
16 }
17
18 sub save_path {
19 my ($self) = @_;
20
21 (my $path = $_[0]{orig_path}) =~ s/\//$PATH_SEP/g;
22 sprintf "%s/%s/%s/%s", cf::localdir, cf::playerdir, $self->{user}, $path
23 }
24
25 sub uniq_path {
26 undef
27 }
28
29 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 1
42