--- deliantra/server/ext/commands.ext 2007/01/01 17:30:34 1.9 +++ deliantra/server/ext/commands.ext 2007/01/05 22:47:18 1.14 @@ -7,7 +7,7 @@ sub rename_to($$$) { my ($ob, $from, $to) = @_; - $to =~ /^[a-zA-Z0-9.,=#\/%$!^]*$/ + $to =~ /^[a-zA-Z0-9.,=#\/%$!^ ]*$/ or return $ob->message ("rename: name must consist only of letters, digits, spaces and a few other things."); 127 >= length $to @@ -136,9 +136,9 @@ no re 'eval'; $arg = qr<$arg>; - my $format = "%2s %1s %3s %5s %-60.60s\n"; + my $format = "%2s %1s %3s %5s %.60s\n"; - my $msg = sprintf $format, "Pl", "I", "Svd", "Reset", "Name"; + $ob->reply (undef, sprintf $format, "Pl", "I", "Svd", "Reset", "Name", cf::NDI_BLACK | cf::NDI_UNIQUE); for (sort keys %cf::MAP) { my $map = $cf::MAP{$_} @@ -146,15 +146,18 @@ next unless $map->path =~ $arg; - $msg .= sprintf $format, - (scalar $map->players), - $IN_MEMORY{$map->in_memory} || "?", - (int $cf::RUNTIME - $map->{last_save}), - (int $map->reset_at - $cf::RUNTIME), - $map->{path}->visible_name; - } + my $svd = int $cf::RUNTIME - $map->{last_save}; + $svd = "++" if $svd > 99; - $ob->reply (undef, $msg); + $ob->reply (undef, + (sprintf $format, + (scalar $map->players), + $IN_MEMORY{$map->in_memory} || "?", + $svd, + (int $map->reset_at - $cf::RUNTIME), + $map->{path}->visible_name), + cf::NDI_BLACK | cf::NDI_UNIQUE); + } 1 };