ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/map-per-player.ext
Revision: 1.10
Committed: Thu Jun 7 19:12:22 2007 UTC (17 years ago) by root
Branch: MAIN
Changes since 1.9: +0 -9 lines
Log Message:
- new map header boolean "no_reset 1" to deny reset.
- allow reset of per-player maps, effectviely implementing
  player-private dungeons.
- re-enabled reset-on-load feature again.
- remove fail-safe mechanism that prevented per-player maps from
  being reset. keep your fingers crossed.
- fixed two bugs in archetype finding (archname vs. object name).
- singularities no longer crash the server but will log a backtrace
  now as they are really are fatal.

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 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 sub load_path {
21 my ($self) = @_;
22
23 "$cf::MAPDIR/$self->{orig_path}.map"
24 }
25
26 sub save_path {
27 my ($self) = @_;
28
29 (my $path = $_[0]{orig_path}) =~ s/\//$PATH_SEP/g;
30 "$cf::PLAYERDIR/$self->{user}/$path.map"
31 }
32
33 sub uniq_path {
34 undef
35 }
36
37 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 1
50