ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/map-per-player.ext
Revision: 1.3
Committed: Sun Jan 14 01:09:46 2007 UTC (17 years, 4 months ago) by root
Branch: MAIN
Changes since 1.2: +3 -2 lines
Log Message:
re-bless in case extensions have been reloaded

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 $self->{deny_reset} = 1; #d# for now
11 }
12
13 sub load_path {
14 my ($self) = @_;
15
16 sprintf "%s/%s/%s", cf::datadir, cf::mapdir, $self->{orig_path}
17 }
18
19 sub save_path {
20 my ($self) = @_;
21
22 (my $path = $_[0]{orig_path}) =~ s/\//$PATH_SEP/g;
23 sprintf "%s/%s/%s/%s", cf::localdir, cf::playerdir, $self->{user}, $path
24 }
25
26 sub uniq_path {
27 undef
28 }
29
30 sub load_header {
31 my ($self) = @_;
32
33 $self->SUPER::load_header
34 or return;
35
36 # forcefully disable per_player flag
37 $self->per_player (0);
38
39 1
40 }
41
42 1
43