ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf.pm
(Generate patch)

Comparing deliantra/server/lib/cf.pm (file contents):
Revision 1.275 by root, Thu Jun 7 19:12:22 2007 UTC vs.
Revision 1.277 by root, Sun Jun 10 04:24:50 2007 UTC

1776 $cf::MAP{$self->path} = $self; 1776 $cf::MAP{$self->path} = $self;
1777 1777
1778 $self->reset; # polite request, might not happen 1778 $self->reset; # polite request, might not happen
1779} 1779}
1780 1780
1781=item $maps = cf::map::tmp_maps
1782
1783Returns an arrayref with all map paths of currently instantiated and saved
1784maps. May block.
1785
1786=cut
1787
1788sub tmp_maps() {
1789 [
1790 map {
1791 utf8::decode $_;
1792 /\.map$/
1793 ? normalise $_
1794 : ()
1795 } @{ aio_readdir $TMPDIR or [] }
1796 ]
1797}
1798
1799=item $maps = cf::map::random_maps
1800
1801Returns an arrayref with all map paths of currently instantiated and saved
1802random maps. May block.
1803
1804=cut
1805
1806sub random_maps() {
1807 [
1808 map {
1809 utf8::decode $_;
1810 /\.map$/
1811 ? normalise "?random/$_"
1812 : ()
1813 } @{ aio_readdir $RANDOMDIR or [] }
1814 ]
1815}
1816
1781=item cf::map::unique_maps 1817=item cf::map::unique_maps
1782 1818
1783Returns an arrayref of paths of all shared maps that have 1819Returns an arrayref of paths of all shared maps that have
1784instantiated unique items. May block. 1820instantiated unique items. May block.
1785 1821
1786=cut 1822=cut
1787 1823
1788sub unique_maps() { 1824sub unique_maps() {
1789 my $files = aio_readdir $UNIQUEDIR 1825 [
1790 or return; 1826 map {
1791
1792 my @paths;
1793
1794 for (@$files) {
1795 utf8::decode $_; 1827 utf8::decode $_;
1796 next if /\.pst$/; 1828 /\.map$/
1797 next unless /^$PATH_SEP/o; 1829 ? normalise $_
1798 1830 : ()
1799 push @paths, cf::map::normalise $_; 1831 } @{ aio_readdir $UNIQUEDIR or [] }
1800 } 1832 ]
1801
1802 \@paths
1803} 1833}
1804 1834
1805package cf; 1835package cf;
1806 1836
1807=back 1837=back

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines