--- deliantra/server/lib/cf.pm 2007/06/07 19:12:22 1.275 +++ deliantra/server/lib/cf.pm 2007/06/10 04:05:47 1.276 @@ -1778,28 +1778,40 @@ $self->reset; # polite request, might not happen } -=item cf::map::unique_maps +=item $maps = cf::map::tmp_maps -Returns an arrayref of paths of all shared maps that have -instantiated unique items. May block. +Returns an arrayref with all map paths of currently instantiated and saved +maps. =cut -sub unique_maps() { - my $files = aio_readdir $UNIQUEDIR - or return; +sub tmp_maps() { + [ + map { + utf8::decode $_; + !/\.(?:pst|meta)$/ && /^$PATH_SEP/o + ? normalise $_ + : () + } @{ aio_readdir $TMPDIR or [] } + ] +} - my @paths; +=item cf::map::unique_maps - for (@$files) { - utf8::decode $_; - next if /\.pst$/; - next unless /^$PATH_SEP/o; +Returns an arrayref of paths of all shared maps that have +instantiated unique items. May block. - push @paths, cf::map::normalise $_; - } +=cut - \@paths +sub unique_maps() { + [ + map { + utf8::decode $_; + !/\.(?:pst|meta)$/ && /^$PATH_SEP/o + ? normalise $_ + : () + } @{ aio_readdir $UNIQUEDIR or [] } + ] } package cf;