1 | #! perl |
1 | #! perl # MANDATORY |
2 | |
2 | |
3 | use POSIX (); |
3 | use POSIX (); |
4 | |
4 | |
5 | # miscellaneous commands |
5 | # miscellaneous commands |
6 | |
6 | |
… | |
… | |
257 | $ob->reply (undef, $ob->contr->braced ? "You are braced." : "Not braced."); |
257 | $ob->reply (undef, $ob->contr->braced ? "You are braced." : "Not braced."); |
258 | |
258 | |
259 | 1 |
259 | 1 |
260 | }; |
260 | }; |
261 | |
261 | |
|
|
262 | cf::register_command 'output-rate' => sub { |
|
|
263 | my ($ob, $arg) = @_; |
|
|
264 | |
|
|
265 | return $ob->reply (undef, sprintf "Output rate is presently %dbps.", $ob->contr->ns->max_rate / $cf::TICK) |
|
|
266 | unless $arg > 0; |
|
|
267 | |
|
|
268 | $ob->contr->ns->max_rate ($arg * $cf::TICK); |
|
|
269 | $ob->reply (undef, sprintf "Output rate now set to%dbps.", $ob->contr->ns->max_rate / $cf::TICK); |
|
|
270 | |
|
|
271 | 1 |
|
|
272 | }; |
|
|
273 | |
262 | cf::register_command 'output-count' => sub { |
274 | cf::register_command 'output-count' => sub { |
263 | my ($ob, $arg) = @_; |
275 | my ($ob, $arg) = @_; |
264 | |
276 | |
265 | return $ob->reply (undef, "Output count is presently " . $ob->contr->outputs_count) |
277 | return $ob->reply (undef, "Output count is presently " . $ob->contr->outputs_count) |
266 | unless $arg > 0; |
278 | unless $arg > 0; |