ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/map-per-player.ext
Revision: 1.11
Committed: Mon Jun 11 21:38:13 2007 UTC (16 years, 11 months ago) by root
Branch: MAIN
CVS Tags: rel-2_82, rel-2_81, rel-2_80, rel-2_6, rel-2_7, rel-2_4, rel-2_5, rel-2_2, rel-2_3, rel-2_72, rel-2_73, rel-2_71, rel-2_76, rel-2_77, rel-2_74, rel-2_75, rel-2_54, rel-2_55, rel-2_56, rel-2_79, rel-2_52, rel-2_53, rel-2_32, rel-2_90, rel-2_92, rel-2_93, rel-2_78, rel-2_61, rel-2_43, rel-2_42, rel-2_41
Changes since 1.10: +1 -1 lines
Log Message:
port micropather to c++...

File Contents

# User Rev Content
1 root 1.11 #! perl # mandatory
2 root 1.1
3 root 1.2 cf::map->register (qr{^~([^/]+)(/.*)});
4 root 1.1
5     sub init {
6     my ($self) = @_;
7    
8 root 1.3 $self->{user} = $1;
9     $self->{orig_path} = $2;
10 root 1.1 }
11    
12 root 1.4 sub thawer_merge {
13     # we have to keep some variables in memory intact
14     local $_[0]{user};
15     local $_[0]{orig_path};
16    
17     $_[0]->SUPER::thawer_merge ($_[1]);
18     }
19    
20 root 1.2 sub load_path {
21 root 1.1 my ($self) = @_;
22    
23 root 1.9 "$cf::MAPDIR/$self->{orig_path}.map"
24 root 1.1 }
25    
26     sub save_path {
27     my ($self) = @_;
28    
29 root 1.2 (my $path = $_[0]{orig_path}) =~ s/\//$PATH_SEP/g;
30 root 1.9 "$cf::PLAYERDIR/$self->{user}/$path.map"
31 root 1.1 }
32    
33     sub uniq_path {
34     undef
35     }
36    
37 root 1.2 sub load_header {
38     my ($self) = @_;
39    
40     $self->SUPER::load_header
41     or return;
42    
43     # forcefully disable per_player flag
44     $self->per_player (0);
45    
46     1
47     }
48    
49 root 1.1 1
50