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

Comparing deliantra/server/ext/commands.ext (file contents):
Revision 1.23 by pippijn, Fri Mar 2 10:54:59 2007 UTC vs.
Revision 1.26 by pippijn, Fri Mar 2 11:23:17 2007 UTC

87 $ob->reply (undef, (join "\n", who_listing $ob->may ("extended_who")), cf::NDI_UNIQUE | cf::NDI_DK_ORANGE); 87 $ob->reply (undef, (join "\n", who_listing $ob->may ("extended_who")), cf::NDI_UNIQUE | cf::NDI_DK_ORANGE);
88 88
89 1 89 1
90}; 90};
91 91
92cf::register_command mapinfo => sub {
93 my ($ob) = @_;
94
95 my $map = $ob->map
96 or return;
97 $ob->reply (undef, (sprintf "%s (%s) %s", $map->name, $map->path, $ob->region->longname));
98 $ob->reply (undef, (sprintf "players: %d difficulty: %d size: %d start: %dx%d timeout: %d",
99 $map->players, $map->difficulty, $map->width, $map->height, $map->enter_x, $map->enter_y, $map->timeout))
100 if $ob->flag (cf::FLAG_WIZ);
101 $ob->reply (undef, $map->msg);
102
103 1
104};
105
106cf::register_command whereami => sub {
107 my ($ob) = @_;
108
109 my $reg = $ob->region;
110 $ob->reply (undef, (sprintf "You are %s.\n%s", $reg->longname, $reg->msg));
111
112 1
113};
114
92cf::register_command applymode => sub { 115cf::register_command applymode => sub {
93 my ($ob, $arg) = @_; 116 my ($ob, $arg) = @_;
94 my @types = ("nochoice", "never", "always"); 117 my @types = ("nochoice", "never", "always");
95 my $mapping = { 118 my $mapping = {
96 nochoice => 1, 119 nochoice => 1,
190 $ob->reply (undef, $ob->contr->braced ? "You are braced." : "Not braced."); 213 $ob->reply (undef, $ob->contr->braced ? "You are braced." : "Not braced.");
191 214
192 1 215 1
193}; 216};
194 217
218cf::register_command 'output-count' => sub {
219 my ($ob, $arg) = @_;
220
221 return $ob->reply (undef, "Output count is presently " . $ob->contr->outputs_count)
222 unless $arg > 0;
223
224 $ob->contr->outputs_count ($arg);
225 $ob->reply (undef, "Output count now set to " . $ob->contr->outputs_count);
226
227 1
228};
229
230cf::register_command 'output-sync' => sub {
231 my ($ob, $arg) = @_;
232
233 return $ob->reply (undef, "Output sync time is presently " . $ob->contr->outputs_sync)
234 unless $arg > 0;
235
236 $ob->contr->outputs_sync ($arg);
237 $ob->reply (undef, "Output sync time now set to " . $ob->contr->outputs_sync);
238
239 1
240};
241
195# XXX: This has a bug. After one sets his wimpy level to 0 and resets it to 242# XXX: This has a bug. After one sets his wimpy level to 0 and resets it to
196# some other level (which may also be 0), this does not get echoed, 243# some other level (which may also be 0), this does not get echoed,
197# but it does get set. 244# but it does get set.
198cf::register_command wimpy => sub { 245cf::register_command wimpy => sub {
199 my ($ob, $arg) = @_; 246 my ($ob, $arg) = @_;
221 #$ob->contr->peaceful ($ob->contr->peaceful ? 0 : 1); 268 #$ob->contr->peaceful ($ob->contr->peaceful ? 0 : 1);
222 #$ob->reply (undef, $ob->contr->peaceful ? "You will attack other players." : "You will not attack other players."); 269 #$ob->reply (undef, $ob->contr->peaceful ? "You will attack other players." : "You will not attack other players.");
223 270
224 1 271 1
225}; 272};
226
227 273
228cf::register_command rename => sub { 274cf::register_command rename => sub {
229 my ($ob, $arg) = @_; 275 my ($ob, $arg) = @_;
230 276
231 $ob->speed_left ($ob->speed_left - 0.25); 277 $ob->speed_left ($ob->speed_left - 0.25);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines