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.5 by root, Sat Dec 23 15:49:40 2006 UTC vs.
Revision 1.7 by root, Mon Jan 1 16:00:09 2007 UTC

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 : $ob->map->region ? $ob->map->region->name : "the unknown") . "]" 73 . " [" . ($pl->peaceful || $privileged ? $ob->map->{path}->visible_name : $ob->map->region ? $ob->map->region->name : "the unknown") . "]"
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 },
123 $ob->reply (undef, "server started $startup, uptime ${runtime}\d"); 123 $ob->reply (undef, "server started $startup, uptime ${runtime}\d");
124 124
125 1 125 1
126}; 126};
127 127
128cf::register_command maps => sub {
129 my ($ob, $arg) = @_;
130
131 no re 'eval'; $arg = qr<$arg>;
132
133 my $format = "%2s %2s %5s %-30.30s\n";
134
135 my $msg = sprintf $format, "Pl", "Fl", "Reset", "Name";
136
137 for (sort keys %cf::MAP) {
138 my $map = $cf::MAP{$_}
139 or next;
140
141 next unless $map->path =~ $arg;
142
143 $msg .= sprintf $format,
144 (scalar $map->players),
145 0,
146 (int $map->reset_at - $cf::RUNTIME),
147 $map->{path}->visible_name;
148 }
149
150 $ob->reply (undef, $msg);
151
152 1
153};
154

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines