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.13 by root, Sun Jan 14 02:10:41 2007 UTC vs.
Revision 1.21 by root, Sun Jun 3 17:42:39 2007 UTC

1#! perl 1#! perl # MANDATORY
2 2
3# wizard commands 3# wizard commands
4
5cf::register_command shutdown => sub {
6 my ($ob, $arg) = @_;
7 return $ob->reply (undef, "Sorry, you can't shutdown the server.")
8 unless $ob->flag (cf::FLAG_WIZ);
9
10 my $name = $ob->name;
11 cf::cleanup ("dm '$name' initiated shutdown" . ($arg ? " with reason: $arg" : "."), 0);
12
13 1
14};
15
16cf::register_command kick => sub {
17 my ($ob, $arg) = @_;
18 return unless $ob->flag (cf::FLAG_WIZ);
19
20 my $other = cf::player::find_active $arg
21 or return 0;
22 $other->kick ($ob);
23 $ob->reply (undef, "$arg is kicked out of the game.", cf::NDI_UNIQUE | cf::NDI_ALL | cf::NDI_RED);
24
25 1
26};
4 27
5cf::register_command goto => sub { 28cf::register_command goto => sub {
6 my ($ob, $arg) = @_; 29 my ($ob, $arg) = @_;
7 30
8 return unless $ob->may ("command_goto"); 31 return unless $ob->may ("command_goto");
19 42
20 return unless $ob->may ("command_teleport"); 43 return unless $ob->may ("command_teleport");
21 44
22 cf::async { 45 cf::async {
23 my $other = cf::player::find $arg 46 my $other = cf::player::find $arg
24 or return $ob->reply ("$arg: no such player."); 47 or return $ob->reply (undef, "$arg: no such player.");
25 48
26 $ob->goto ($other->maplevel, $other->ob->x, $other->ob->y); 49 $ob->goto ($other->maplevel, $other->ob->x, $other->ob->y);
27 }; 50 };
28 51
29 1 52 1
68cf::register_command wizlook => sub { 91cf::register_command wizlook => sub {
69 my ($ob, $arg) = @_; 92 my ($ob, $arg) = @_;
70 93
71 return unless $ob->may ("command_wizlook"); 94 return unless $ob->may ("command_wizlook");
72 95
73 $ob->clear_los; 96 $ob->contr->clear_los;
74 97
75 $ob->reply (undef, "You can temporarily see through walls."); 98 $ob->reply (undef, "You can temporarily see through walls.");
76 99
77 1 100 1
78}; 101};
96 }; 119 };
97 120
98 1 121 1
99}; 122};
100 123
124cf::register_command observe => sub {
125 my ($ob, $arg) = @_;
126
127 return unless $ob->may ("command_observe");
128
129 my $other = cf::player::find_active $arg;
130 $ob->contr->set_observe ($other ? $other->ob : undef);
131
132 1
133};
134
101for my $command (qw(summon arrest kick banish)) { 135for my $command (qw(summon arrest banish)) {
102 my $method = "command_$command"; 136 my $method = "command_$command";
103 137
104 cf::register_command $command => sub { 138 cf::register_command $command => sub {
105 my ($ob, $arg) = @_; 139 my ($ob, $arg) = @_;
106 140

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines