--- deliantra/server/utils/cfutil.in 2007/07/23 23:38:18 1.43 +++ deliantra/server/utils/cfutil.in 2007/07/24 04:55:35 1.44 @@ -392,7 +392,7 @@ sub process_res { while (@res) { - my ($dir, $file) = @{pop @res}; + my ($dir, $file, $type) = @{pop @res}; my $data; aio_load "$dir/$file", $data; @@ -404,12 +404,10 @@ $file =~ /\.([^.]+)$/ or next; - my $type = $1; - substr $dir, 0, 1 + length $PATH, ""; $RESOURCE{"$dir/$file"} = { - type => $1, + type => $type, copyright => $copyright, data => $data, chksum => Digest::MD5::md5 $data, @@ -432,14 +430,29 @@ substr $dir, 0, 1 + length $PATH, ""; for my $file (@$nondirs) { - if ($file =~ /\.(ogg|jpg|res)$/ || $dir =~ /^res(?:\/|$)/) { - push @res, [$path, $file]; + if ($dir =~ /^music(?:\/|$)/) { + push @res, [$path, $file, 3] # FT_MUSIC + if $file =~ /\.(ogg)$/; + + } elsif ($dir =~ /^sounds(?:\/|$)/) { + push @res, [$path, $file, 5] # FT_SOUND + if $file =~ /\.(wav|ogg)$/; + + } elsif ($dir =~ /^res(?:\/|$)/) { + push @res, [$path, $file, 0] # FT_FACE + if $file =~ /\.(jpg|png)$/; + push @res, [$path, $file, 7] # FT_RSRC + if $file =~ /\.(res)$/; + } elsif ($file =~ /\.png$/) { push @png, ["$path/$file", 0]; + } elsif ($file =~ /\.trs$/) { push @trs, [$path, $file]; + } elsif ($file =~ /\.arc$/) { push @arc, [$path, $file]; + } else { warn "ignoring $path/$file\n" if $VERBOSE >= 3; }