--- deliantra/server/ext/commands.ext 2006/12/31 17:17:22 1.6 +++ deliantra/server/ext/commands.ext 2007/01/01 16:00:09 1.7 @@ -125,3 +125,30 @@ 1 }; +cf::register_command maps => sub { + my ($ob, $arg) = @_; + + no re 'eval'; $arg = qr<$arg>; + + my $format = "%2s %2s %5s %-30.30s\n"; + + my $msg = sprintf $format, "Pl", "Fl", "Reset", "Name"; + + for (sort keys %cf::MAP) { + my $map = $cf::MAP{$_} + or next; + + next unless $map->path =~ $arg; + + $msg .= sprintf $format, + (scalar $map->players), + 0, + (int $map->reset_at - $cf::RUNTIME), + $map->{path}->visible_name; + } + + $ob->reply (undef, $msg); + + 1 +}; +