--- deliantra/server/ext/commands.ext 2007/03/02 15:09:05 1.33 +++ deliantra/server/ext/commands.ext 2007/03/16 02:37:54 1.36 @@ -1,4 +1,4 @@ -#! perl +#! perl # MANDATORY use POSIX (); @@ -152,16 +152,15 @@ cf::register_command $cmd => sub { my ($ob, $arg) = @_; - $ob->contr->$oncmd (1); - - return $ob->reply (undef, "Can't $cmd into a non adjacent square.") + $ob->reply (undef, "Can't $cmd into a non adjacent square.") if $arg < 0 or $arg >= 9; - $ob->move ($arg); + $ob->contr->$oncmd (1); + $ob->move_player ($arg); 1 }; - + cf::register_command "${cmd}_stop" => sub { my ($ob) = @_; @@ -259,6 +258,18 @@ 1 }; + +cf::register_command 'output-rate' => sub { + my ($ob, $arg) = @_; + + return $ob->reply (undef, sprintf "Output rate is presently %dbps.", $ob->contr->ns->max_rate / $cf::TICK) + unless $arg > 0; + + $ob->contr->ns->max_rate ($arg * $cf::TICK); + $ob->reply (undef, sprintf "Output rate now set to %dbps.", $ob->contr->ns->max_rate / $cf::TICK); + + 1 +}; cf::register_command 'output-count' => sub { my ($ob, $arg) = @_;