--- deliantra/server/ext/commands.ext 2007/07/04 17:48:56 1.52 +++ deliantra/server/ext/commands.ext 2007/07/28 00:15:03 1.57 @@ -70,7 +70,7 @@ . ($ob->flag (cf::FLAG_WIZ) ? " [WIZ]" : "") . " [" . $pl->ns->version . "]" . " [" . ($pl->peaceful || $privileged ? $ob->map->visible_name : $ob->region->name) . "]" - . (sprintf " [rtt %.3fs]", $pl->ns->rtt * 1e-6) + . (sprintf " [rtt %.3fs]", $pl->ns->tcpi_rtt * 1e-6) . ($privileged ? " " . $pl->ns->host : "") } sort { (lc $a->ob->name) cmp (lc $b->ob->name) } @pl ), @@ -187,11 +187,13 @@ cf::register_command mapinfo => sub { my ($ob) = @_; - my $map = $ob->contr->observe->map + my $observe = $ob->contr->observe; + + my $map = $observe->map or return; - $ob->reply (undef, (sprintf "%s (%s) %s", $map->name, $map->path, $ob->region->longname)); + $ob->reply (undef, (sprintf "%s (%s) %s", $map->name, $map->path, $observe->region->longname)); $ob->reply (undef, (sprintf "players: %d difficulty: %d size: %d start: %dx%d timeout: %d", - $map->players, $map->difficulty, $map->width, $map->height, $map->enter_x, $map->enter_y, $map->timeout)) + (scalar $map->players), $map->difficulty, $map->width, $map->height, $map->enter_x, $map->enter_y, $map->timeout)) if $ob->flag (cf::FLAG_WIZ); $ob->reply (undef, $map->msg); @@ -287,8 +289,9 @@ return $ob->reply (undef, sprintf "Output rate is presently %dbps.", $ob->contr->ns->max_rate / $cf::TICK) unless $arg > 0; - # minimum is 2k/s - $ob->contr->ns->max_rate ((List::Util::max 2048, $arg) * $cf::TICK); + # minimum is 5k/s + # maximum is 100k/s, this should be configurable + $ob->contr->ns->max_rate ((List::Util::max 5000, List::Util::min 100000, $arg) * $cf::TICK); $ob->reply (undef, sprintf "Output rate now set to %dbps.", $ob->contr->ns->max_rate / $cf::TICK); 1