--- deliantra/server/ext/dmcommands.ext 2007/03/02 13:32:50 1.17 +++ deliantra/server/ext/dmcommands.ext 2007/06/03 17:05:35 1.20 @@ -1,7 +1,18 @@ -#! perl +#! perl # MANDATORY # 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); @@ -109,6 +120,17 @@ 1 }; + +cf::register_command observe => sub { + my ($ob, $arg) = @_; + + return unless $ob->may ("command_observe"); + + my $other = cf::player::find_active $arg; + $ob->contr->set_observe ($other ? $other->ob : undef); + + 1 +}; for my $command (qw(summon arrest banish)) { my $method = "command_$command";