… | |
… | |
68 | "* " . $ob->name . "/" . $ob->level . " " . (length $pl->own_title ? $pl->own_title : "the " . $pl->title) |
68 | "* " . $ob->name . "/" . $ob->level . " " . (length $pl->own_title ? $pl->own_title : "the " . $pl->title) |
69 | . ($pl->peaceful ? " [peaceful]" : " [HOSTILE]") |
69 | . ($pl->peaceful ? " [peaceful]" : " [HOSTILE]") |
70 | . ($ns->afk ? " [AFK]" : "") |
70 | . ($ns->afk ? " [AFK]" : "") |
71 | . ($ob->flag (cf::FLAG_WIZ) ? " [WIZ]" : "") |
71 | . ($ob->flag (cf::FLAG_WIZ) ? " [WIZ]" : "") |
72 | . " [" . $pl->ns->version . "]" |
72 | . " [" . $pl->ns->version . "]" |
73 | . " [" . ($pl->peaceful || $privileged ? $ob->map->{path}->visible_name : $ob->map->region ? $ob->map->region->name : "the unknown") . "]" |
73 | . " [" . ($pl->peaceful || $privileged ? $ob->map->visible_name : $ob->region->name) . "]" |
74 | . (sprintf " [rtt %.3fs]", $pl->ns->rtt * 1e-6) |
74 | . (sprintf " [rtt %.3fs]", $pl->ns->rtt * 1e-6) |
75 | . ($privileged ? " " . $pl->ns->host : "") |
75 | . ($privileged ? " " . $pl->ns->host : "") |
76 | } sort { (lc $a->ob->name) cmp (lc $b->ob->name) } @pl |
76 | } sort { (lc $a->ob->name) cmp (lc $b->ob->name) } @pl |
77 | ), |
77 | ), |
78 | eval { "* IRC: " . join ", ", ext::schmorp_irc::users }, |
78 | eval { "* IRC: " . join ", ", ext::schmorp_irc::users }, |
… | |
… | |
85 | $ob->speed_left ($ob->speed_left - 0.25); |
85 | $ob->speed_left ($ob->speed_left - 0.25); |
86 | |
86 | |
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 | }; |
|
|
91 | |
|
|
92 | cf::register_command afk => sub { |
|
|
93 | my ($ob, $arg) = @_; |
|
|
94 | |
|
|
95 | $ob->contr->ns->afk ($ob->contr->ns->afk ? 0 : 1); |
|
|
96 | $ob->reply (undef, $ob->contr->ns->afk ? "You are now AFK" : "You are no longer AFK"); |
90 | }; |
97 | }; |
91 | |
98 | |
92 | cf::register_command rename => sub { |
99 | cf::register_command rename => sub { |
93 | my ($ob, $arg) = @_; |
100 | my ($ob, $arg) = @_; |
94 | |
101 | |
… | |
… | |
143 | for (sort keys %cf::MAP) { |
150 | for (sort keys %cf::MAP) { |
144 | my $map = $cf::MAP{$_} |
151 | my $map = $cf::MAP{$_} |
145 | or next; |
152 | or next; |
146 | |
153 | |
147 | next unless $map->path =~ $arg; |
154 | next unless $map->path =~ $arg; |
148 | next if $map->{path}->is_style_map; |
155 | next if $map->{deny_list}; |
149 | |
156 | |
150 | my $svd = int $cf::RUNTIME - $map->{last_save}; |
157 | my $svd = int $cf::RUNTIME - $map->{last_save}; |
151 | $svd = "++" if $svd > 99; |
158 | $svd = "++" if $svd > 99; |
152 | |
159 | |
153 | $ob->reply (undef, |
160 | $ob->reply (undef, |
154 | (sprintf $format, |
161 | (sprintf $format, |
155 | (scalar $map->players), |
162 | (scalar $map->players), |
156 | $IN_MEMORY{$map->in_memory} || "?", |
163 | $IN_MEMORY{$map->in_memory} || "?", |
157 | $svd, |
164 | $svd, |
158 | (int $map->reset_at - $cf::RUNTIME), |
165 | (int $map->reset_at - $cf::RUNTIME), |
159 | $map->{path}->visible_name), |
166 | $map->visible_name), |
160 | cf::NDI_BLACK | cf::NDI_UNIQUE); |
167 | cf::NDI_BLACK | cf::NDI_UNIQUE); |
161 | } |
168 | } |
162 | |
169 | |
163 | 1 |
170 | 1 |
164 | }; |
171 | }; |