ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf.pm
(Generate patch)

Comparing deliantra/server/lib/cf.pm (file contents):
Revision 1.164 by root, Thu Jan 11 01:24:25 2007 UTC vs.
Revision 1.165 by root, Fri Jan 12 22:09:22 2007 UTC

496 496
497# the unique path, undef == no special unique path 497# the unique path, undef == no special unique path
498sub uniq_path { 498sub uniq_path {
499 my ($self) = @_; 499 my ($self) = @_;
500 500
501 $self->{user_rel} || $self->{ext}
502 ? undef
501 sprintf "%s/%s/%s", cf::localdir, cf::uniquedir, $self->_escaped_path 503 : sprintf "%s/%s/%s", cf::localdir, cf::uniquedir, $self->_escaped_path
504}
505
506sub customise_for {
507 my ($self, $map, $ob) = @_;
508
509 if ($map->per_player) {
510 return cf::map::find ("~" . $ob->name . "/" . $map->{path}{path});
511 }
512
513 $map
502} 514}
503 515
504# this is somewhat ugly, but style maps do need special treatment 516# this is somewhat ugly, but style maps do need special treatment
505sub is_style_map { 517sub is_style_map {
506 $_[0]{path} =~ m{^/styles/} 518 $_[0]{path} =~ m{^/styles/}
1598 $self->reset_timeout (1); 1610 $self->reset_timeout (1);
1599 $self->rename ("{nuke}/" . ($nuke_counter++)); 1611 $self->rename ("{nuke}/" . ($nuke_counter++));
1600 $self->reset; # polite request, might not happen 1612 $self->reset; # polite request, might not happen
1601} 1613}
1602 1614
1603sub customise_for {
1604 my ($map, $ob) = @_;
1605
1606 if ($map->per_player) {
1607 return cf::map::find "~" . $ob->name . "/" . $map->{path}{path};
1608 }
1609
1610 $map
1611}
1612
1613=item cf::map::unique_maps 1615=item cf::map::unique_maps
1614 1616
1615Returns an arrayref of cf::path's of all shared maps that have 1617Returns an arrayref of cf::path's of all shared maps that have
1616instantiated unique items. May block. 1618instantiated unique items. May block.
1617 1619
1815 1817
1816 $self->enter_link; 1818 $self->enter_link;
1817 1819
1818 (async { 1820 (async {
1819 my $map = cf::map::find $path->as_string; 1821 my $map = cf::map::find $path->as_string;
1820 $map = $map->customise_for ($self) if $map; 1822 $map = $map->{path}->customise_for ($map, $self) if $map;
1821 1823
1822# warn "entering ", $map->path, " at ($x, $y)\n" 1824# warn "entering ", $map->path, " at ($x, $y)\n"
1823# if $map; 1825# if $map;
1824 1826
1825 $map or $self->message ("The exit to '" . ($path->visible_name) . "' is closed", cf::NDI_UNIQUE | cf::NDI_RED); 1827 $map or $self->message ("The exit to '" . ($path->visible_name) . "' is closed", cf::NDI_UNIQUE | cf::NDI_RED);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines