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.17 by pippijn, Fri Mar 2 13:32:50 2007 UTC vs.
Revision 1.20 by root, Sun Jun 3 17:05:35 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};
4 15
5cf::register_command kick => sub { 16cf::register_command kick => sub {
6 my ($ob, $arg) = @_; 17 my ($ob, $arg) = @_;
7 return unless $ob->flag (cf::FLAG_WIZ); 18 return unless $ob->flag (cf::FLAG_WIZ);
8 19
108 }; 119 };
109 120
110 1 121 1
111}; 122};
112 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
113for my $command (qw(summon arrest banish)) { 135for my $command (qw(summon arrest banish)) {
114 my $method = "command_$command"; 136 my $method = "command_$command";
115 137
116 cf::register_command $command => sub { 138 cf::register_command $command => sub {
117 my ($ob, $arg) = @_; 139 my ($ob, $arg) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines