… | |
… | |
47 | cf::register_command who => sub { |
47 | cf::register_command who => sub { |
48 | my ($ob, $arg) = @_; |
48 | my ($ob, $arg) = @_; |
49 | |
49 | |
50 | $ob->speed_left ($ob->speed_left - 4); |
50 | $ob->speed_left ($ob->speed_left - 4); |
51 | |
51 | |
52 | $ob->contr->ns->send_msg (log => (join "\n\n", who_listing $ob->may ("extended_who"), $arg), cf::NDI_DK_ORANGE); |
52 | $ob->send_msg (log => (join "\n\n", who_listing $ob->may ("extended_who"), $arg), cf::NDI_DK_ORANGE | cf::NDI_REPLY); |
53 | }; |
53 | }; |
54 | |
54 | |
55 | cf::register_command seen => sub { |
55 | cf::register_command seen => sub { |
56 | my ($pl, $args) = @_; |
56 | my ($pl, $args) = @_; |
57 | |
57 | |
… | |
… | |
145 | |
145 | |
146 | my $observe = $ob->contr->observe; |
146 | my $observe = $ob->contr->observe; |
147 | |
147 | |
148 | my $map = $observe->map |
148 | my $map = $observe->map |
149 | or return; |
149 | or return; |
|
|
150 | |
150 | $ob->reply (undef, (sprintf "%s (%s) %s", $map->name, $map->path, $observe->region->longname)); |
151 | my $msg = sprintf "%s (%s) %s", $map->name, $map->path, $observe->region->longname; |
151 | $ob->reply (undef, (sprintf "players: %d difficulty: %d size: %d start: %dx%d timeout: %d", |
152 | $msg .= sprintf "\n\nplayers: %d difficulty: %d size: %d start: %dx%d timeout: %d", |
152 | (scalar $map->players), $map->difficulty, $map->width, $map->height, $map->enter_x, $map->enter_y, $map->timeout)) |
153 | (scalar $map->players), $map->difficulty, $map->width, $map->height, $map->enter_x, $map->enter_y, $map->timeout |
153 | if $ob->flag (cf::FLAG_WIZ); |
154 | if $ob->flag (cf::FLAG_WIZ); |
154 | $ob->reply (undef, $map->msg); |
155 | $ob->send_msg (log => $msg, cf::NDI_REPLY); |
155 | }; |
156 | }; |
156 | |
157 | |
157 | cf::register_command whereami => sub { |
158 | cf::register_command whereami => sub { |
158 | my ($ob) = @_; |
159 | my ($ob) = @_; |
159 | |
160 | |
… | |
… | |
169 | for my $pl (cf::player::list) { |
170 | for my $pl (cf::player::list) { |
170 | ++$count{$pl->ob->region->longname}; |
171 | ++$count{$pl->ob->region->longname}; |
171 | } |
172 | } |
172 | |
173 | |
173 | my $msg = "In the world currently there are:\n\n" |
174 | my $msg = "In the world currently there are:\n\n" |
174 | . join "", map "$count{$_} player(s) in $_\n\n", sort keys %count; |
175 | . join "", map "$count{$_} player(s) $_\n\n", sort keys %count; |
175 | |
176 | |
176 | $ob->contr->ns->send_msg (log => $msg, cf::NDI_REPLY); |
177 | $ob->send_msg (log => $msg, cf::NDI_REPLY); |
177 | }; |
178 | }; |
178 | |
179 | |
179 | cf::register_command hiscore => sub { |
180 | cf::register_command hiscore => sub { |
180 | my ($ob, $arg) = @_; |
181 | my ($ob, $arg) = @_; |
181 | |
182 | |
182 | my $url = $cf::CFG->{hiscore_url}; |
183 | my $url = $cf::CFG->{hiscore_url}; |
183 | $ob->contr->ns->send_msg (log => "See $url", cf::NDI_REPLY); |
184 | $ob->send_msg (log => "See $url", cf::NDI_REPLY); |
184 | }; |
185 | }; |
185 | |
186 | |
186 | sub _set_mode($$$@) { |
187 | sub _set_mode($$$@) { |
187 | my ($name, $ob, $arg, $slot, @choices) = @_; |
188 | my ($name, $ob, $arg, $slot, @choices) = @_; |
188 | |
189 | |