--- deliantra/server/ext/dmcommands.ext 2007/03/02 13:32:50 1.17 +++ deliantra/server/ext/dmcommands.ext 2007/06/03 17:42:39 1.21 @@ -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); @@ -82,7 +93,7 @@ return unless $ob->may ("command_wizlook"); - $ob->clear_los; + $ob->contr->clear_los; $ob->reply (undef, "You can temporarily see through walls."); @@ -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";