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.14 by pippijn, Wed Feb 28 16:38:56 2007 UTC vs.
Revision 1.19 by root, Wed Mar 14 15:44:47 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");
96 }; 119 };
97 120
98 1 121 1
99}; 122};
100 123
101for my $command (qw(summon arrest kick banish)) { 124for my $command (qw(summon arrest banish)) {
102 my $method = "command_$command"; 125 my $method = "command_$command";
103 126
104 cf::register_command $command => sub { 127 cf::register_command $command => sub {
105 my ($ob, $arg) = @_; 128 my ($ob, $arg) = @_;
106 129

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines