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

Comparing deliantra/server/ext/dmcommands.ext (file contents):
Revision 1.19 by root, Wed Mar 14 15:44:47 2007 UTC vs.
Revision 1.23 by root, Wed Sep 19 21:56:30 2007 UTC

1#! perl # MANDATORY 1#! perl # mandatory
2 2
3# wizard commands 3# wizard commands
4 4
5cf::register_command shutdown => sub { 5cf::register_command shutdown => sub {
6 my ($ob, $arg) = @_; 6 my ($ob, $arg) = @_;
41 my ($ob, $arg) = @_; 41 my ($ob, $arg) = @_;
42 42
43 return unless $ob->may ("command_teleport"); 43 return unless $ob->may ("command_teleport");
44 44
45 cf::async { 45 cf::async {
46 $Coro::current->{desc} = "teleport $arg";
47
46 my $other = cf::player::find $arg 48 my $other = cf::player::find $arg
47 or return $ob->reply (undef, "$arg: no such player."); 49 or return $ob->reply (undef, "$arg: no such player.");
48 50
49 $ob->goto ($other->maplevel, $other->ob->x, $other->ob->y); 51 $ob->goto ($other->maplevel, $other->ob->x, $other->ob->y);
50 }; 52 };
91cf::register_command wizlook => sub { 93cf::register_command wizlook => sub {
92 my ($ob, $arg) = @_; 94 my ($ob, $arg) = @_;
93 95
94 return unless $ob->may ("command_wizlook"); 96 return unless $ob->may ("command_wizlook");
95 97
96 $ob->clear_los; 98 $ob->contr->clear_los;
97 99
98 $ob->reply (undef, "You can temporarily see through walls."); 100 $ob->reply (undef, "You can temporarily see through walls.");
99 101
100 1 102 1
101}; 103};
109 111
110 my @pl = $map->players; 112 my @pl = $map->players;
111 $_->enter_link for @pl; 113 $_->enter_link for @pl;
112 cf::async { 114 cf::async {
113 my $name = $map->visible_name; 115 my $name = $map->visible_name;
116 $Coro::current->{desc} = "reset $name";
114 117
115 $map->reset; 118 $map->reset;
116 $_->leave_link for @pl; 119 $_->leave_link for @pl;
117 120
118 $ob->reply (undef, "$name was reset."); 121 $ob->reply (undef, "$name was reset.");
119 }; 122 };
123
124 1
125};
126
127cf::register_command observe => sub {
128 my ($ob, $arg) = @_;
129
130 return unless $ob->may ("command_observe");
131
132 my $other = cf::player::find_active $arg;
133 $ob->contr->set_observe ($other ? $other->ob : undef);
120 134
121 1 135 1
122}; 136};
123 137
124for my $command (qw(summon arrest banish)) { 138for my $command (qw(summon arrest banish)) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines