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.6 by root, Sun Dec 31 17:17:22 2006 UTC vs.
Revision 1.9 by root, Mon Jan 1 17:30:34 2007 UTC

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
128my %IN_MEMORY = (
129 cf::MAP_IN_MEMORY => "I",
130 cf::MAP_SWAPPED => "S",
131 cf::MAP_LOADING => "L",
132);
133
134cf::register_command maps => sub {
135 my ($ob, $arg) = @_;
136
137 no re 'eval'; $arg = qr<$arg>;
138
139 my $format = "%2s %1s %3s %5s %-60.60s\n";
140
141 my $msg = sprintf $format, "Pl", "I", "Svd", "Reset", "Name";
142
143 for (sort keys %cf::MAP) {
144 my $map = $cf::MAP{$_}
145 or next;
146
147 next unless $map->path =~ $arg;
148
149 $msg .= sprintf $format,
150 (scalar $map->players),
151 $IN_MEMORY{$map->in_memory} || "?",
152 (int $cf::RUNTIME - $map->{last_save}),
153 (int $map->reset_at - $cf::RUNTIME),
154 $map->{path}->visible_name;
155 }
156
157 $ob->reply (undef, $msg);
158
159 1
160};
161

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines