--- deliantra/server/ext/dmcommands.ext 2007/03/02 13:32:50 1.17 +++ deliantra/server/ext/dmcommands.ext 2008/12/23 06:58:23 1.25 @@ -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); @@ -32,6 +43,8 @@ return unless $ob->may ("command_teleport"); cf::async { + $Coro::current->{desc} = "teleport $arg"; + my $other = cf::player::find $arg or return $ob->reply (undef, "$arg: no such player."); @@ -82,9 +95,17 @@ return unless $ob->may ("command_wizlook"); - $ob->clear_los; + my $new_val = length $arg ? $arg * 1 : !$ob->flag (cf::FLAG_WIZLOOK); + + $ob->flag (cf::FLAG_WIZLOOK, $new_val); - $ob->reply (undef, "You can temporarily see through walls."); + $ob->contr->do_los (1); + + $ob->reply (undef, + $new_val + ? "You can now look through walls." + : "You will now see the same thing as you would normally.", + ); 1 }; @@ -100,6 +121,7 @@ $_->enter_link for @pl; cf::async { my $name = $map->visible_name; + $Coro::current->{desc} = "reset $name"; $map->reset; $_->leave_link for @pl; @@ -109,6 +131,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";