--- deliantra/server/ext/dmcommands.ext 2007/01/14 02:10:41 1.13 +++ deliantra/server/ext/dmcommands.ext 2007/03/02 13:43:58 1.18 @@ -2,6 +2,29 @@ # wizard commands +cf::register_command shutdown => sub { + my ($ob, $arg) = @_; + return $ob->reply (undef, "Sorry, you can't shutdown the server.") + unless $ob->flag (cf::FLAG_WIZ); + + my $name = $ob->name; + cf::cleanup ("dm '$name' initiated shutdown" . ($arg ? " with reason: $arg" : "."), 0); + + 1 +}; + +cf::register_command kick => sub { + my ($ob, $arg) = @_; + return unless $ob->flag (cf::FLAG_WIZ); + + my $other = cf::player::find_active $arg + or return 0; + $other->kick ($ob); + $ob->reply (undef, "$arg is kicked out of the game.", cf::NDI_UNIQUE | cf::NDI_ALL | cf::NDI_RED); + + 1 +}; + cf::register_command goto => sub { my ($ob, $arg) = @_; @@ -21,7 +44,7 @@ cf::async { my $other = cf::player::find $arg - or return $ob->reply ("$arg: no such player."); + or return $ob->reply (undef, "$arg: no such player."); $ob->goto ($other->maplevel, $other->ob->x, $other->ob->y); }; @@ -98,7 +121,7 @@ 1 }; -for my $command (qw(summon arrest kick banish)) { +for my $command (qw(summon arrest banish)) { my $method = "command_$command"; cf::register_command $command => sub {