--- deliantra/server/lib/cf.pm 2007/09/11 08:41:11 1.364 +++ deliantra/server/lib/cf.pm 2007/09/13 10:59:41 1.370 @@ -2460,14 +2460,33 @@ $self->enter_link; (async { + # *tag paths override both path and x|y + if ($path =~ /^\*(.*)$/) { + if (my @obs = grep $_->map, ext::map_tags::find $1) { + my $ob = $obs[rand @obs]; + + # see if we actually can go there + if (@obs = grep !$self->blocked ($_->map, $_->x, $_->y), $ob, $ob->tail) { + $ob = $obs[rand @obs]; + } else { + $self->message ("Wow, it's pretty crowded in there.", cf::NDI_UNIQUE | cf::NDI_RED); + } + # else put us there anyways for now #d# + + ($path, $x, $y) = ($ob->map, $ob->x, $ob->y); + } else { + ($path, $x, $y) = (undef, undef, undef); + } + } + my $map = eval { - my $map = cf::map::find $path; + my $map = defined $path ? cf::map::find $path : undef; if ($map) { $map = $map->customise_for ($self); $map = $check->($map) if $check && $map; } else { - $self->message ("The exit to '$path' is closed", cf::NDI_UNIQUE | cf::NDI_RED); + $self->message ("The exit to '$path' is closed.", cf::NDI_UNIQUE | cf::NDI_RED); } $map @@ -3447,9 +3466,6 @@ $signal->wait; } -our $stat_fh; -sysopen $stat_fh, "/tmp/cfstats", Fcntl::O_APPEND | Fcntl::O_CREAT | Fcntl::O_WRONLY, 0600;#d# - $TICK_WATCHER = Event->timer ( reentrant => 0, parked => 1, @@ -3463,8 +3479,6 @@ return; } - my @pl = cf::player::list; my $stats = sprintf "%.2f %d %d %d", $RUNTIME, (scalar @pl), cf::object::actives_size, cf::object::objects_size; #d# - $NOW = $tick_start = Event::time; cf::server_tick; # one server iteration @@ -3480,9 +3494,6 @@ }; } -# my $AFTER = Event::time; -# warn $AFTER - $NOW;#d# - if (my $sig = shift @WAIT_FOR_TICK_BEGIN) { $sig->send; } @@ -3502,10 +3513,6 @@ $LOADAVG = $LOADAVG * 0.75 + $LOAD * 0.25; _post_tick; - - # gather some statistics#d# - $stats .= sprintf " %d\n", 10000 * ($NOW - $tick_start);#d# - IO::AIO::aio_write $stat_fh, undef, undef, $stats, 0;#d# }, );