ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/commands.ext
(Generate patch)

Comparing deliantra/server/ext/commands.ext (file contents):
Revision 1.37 by root, Sat Mar 17 22:52:32 2007 UTC vs.
Revision 1.39 by root, Mon Apr 2 19:56:11 2007 UTC

253 my ($ob, $arg) = @_; 253 my ($ob, $arg) = @_;
254 254
255 return $ob->reply (undef, sprintf "Output rate is presently %dbps.", $ob->contr->ns->max_rate / $cf::TICK) 255 return $ob->reply (undef, sprintf "Output rate is presently %dbps.", $ob->contr->ns->max_rate / $cf::TICK)
256 unless $arg > 0; 256 unless $arg > 0;
257 257
258 # minimum is 2k/s
258 $ob->contr->ns->max_rate ($arg * $cf::TICK); 259 $ob->contr->ns->max_rate ((List::Util::max 2048, $arg) * $cf::TICK);
259 $ob->reply (undef, sprintf "Output rate now set to %dbps.", $ob->contr->ns->max_rate / $cf::TICK); 260 $ob->reply (undef, sprintf "Output rate now set to %dbps.", $ob->contr->ns->max_rate / $cf::TICK);
260 261
261 1 262 1
262}; 263};
263 264
274}; 275};
275 276
276cf::register_command 'output-sync' => sub { 277cf::register_command 'output-sync' => sub {
277 my ($ob, $arg) = @_; 278 my ($ob, $arg) = @_;
278 279
279 return $ob->reply (undef, "Output sync time is presently " . $ob->contr->outputs_sync) 280 return $ob->reply (undef, sprintf "Output sync time is presently %.1fs", $ob->contr->outputs_sync * $cf::TICK)
280 unless $arg > 0; 281 unless length $arg;
281 282
282 $ob->contr->outputs_sync ($arg); 283 $ob->contr->outputs_sync ($arg / $cf::TICK);
283 $ob->reply (undef, "Output sync time now set to " . $ob->contr->outputs_sync); 284 $ob->reply (undef, sprintf "Output sync time now set to %.1fs", $ob->contr->outputs_sync * $cf::TICK);
284 285
285 1 286 1
286}; 287};
287 288
288# XXX: This has a bug. After one sets his wimpy level to 0 and resets it to 289# XXX: This has a bug. After one sets his wimpy level to 0 and resets it to

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines