… | |
… | |
32 | "* " . $ob->name . "/" . $ob->level . " " . (length $pl->own_title ? $pl->own_title : "the " . $pl->title) |
32 | "* " . $ob->name . "/" . $ob->level . " " . (length $pl->own_title ? $pl->own_title : "the " . $pl->title) |
33 | . ($pl->gender ? " [f]" : " [m]") |
33 | . ($pl->gender ? " [f]" : " [m]") |
34 | . ($pl->peaceful ? " [peaceful]" : " [HOSTILE]") |
34 | . ($pl->peaceful ? " [peaceful]" : " [HOSTILE]") |
35 | . ($ns->afk ? " [AFK]" : "") |
35 | . ($ns->afk ? " [AFK]" : "") |
36 | . ($ob->flag (cf::FLAG_WIZ) ? " [WIZ]" : "") |
36 | . ($ob->flag (cf::FLAG_WIZ) ? " [WIZ]" : "") |
37 | . " [" . $pl->ns->version . "]" |
37 | . " [" . $pl->ns->{who_version} . "]" |
38 | . " [" . ($pl->peaceful || $privileged ? $ob->map->visible_name : $ob->region->name) . "]" |
38 | . " [" . ($pl->peaceful || $privileged ? $ob->map->visible_name : $ob->region->name) . "]" |
39 | . (sprintf " [rtt %.3fs]", $pl->ns->tcpi_rtt * 1e-6) |
39 | . (sprintf " [rtt %.3fs]", $pl->ns->tcpi_rtt * 1e-6) |
40 | . ($privileged ? " " . $pl->ns->host : "") |
40 | . ($privileged ? " " . $pl->ns->host : "") |
41 | } sort { (lc $a->ob->name) cmp (lc $b->ob->name) } @pl |
41 | } sort { (lc $a->ob->name) cmp (lc $b->ob->name) } @pl |
42 | ), |
42 | ), |
… | |
… | |
248 | my ($ob, $arg) = @_; |
248 | my ($ob, $arg) = @_; |
249 | |
249 | |
250 | return $ob->reply (undef, sprintf "Output rate is presently %dbps.", $ob->contr->ns->max_rate / $cf::TICK) |
250 | return $ob->reply (undef, sprintf "Output rate is presently %dbps.", $ob->contr->ns->max_rate / $cf::TICK) |
251 | unless $arg > 0; |
251 | unless $arg > 0; |
252 | |
252 | |
253 | # minimum is 5k/s |
253 | $ob->contr->ns->max_rate ((cf::clamp $arg, $OUTPUT_RATE_MIN, $OUTPUT_RATE_MAX) * $TICK); |
254 | # maximum is 100k/s, this should be configurable |
|
|
255 | $ob->contr->ns->max_rate ((List::Util::max 5000, List::Util::min 100000, $arg) * $cf::TICK); |
|
|
256 | $ob->reply (undef, sprintf "Output rate now set to %dbps.", $ob->contr->ns->max_rate / $cf::TICK); |
254 | $ob->reply (undef, sprintf "Output rate now set to %dbps.", $ob->contr->ns->max_rate / $TICK); |
257 | }; |
255 | }; |
258 | |
256 | |
259 | cf::register_command 'output-count' => sub { |
257 | cf::register_command 'output-count' => sub { |
260 | my ($ob, $arg) = @_; |
258 | my ($ob, $arg) = @_; |
261 | |
259 | |