--- deliantra/server/utils/cfutil.in 2007/08/19 15:47:56 1.56 +++ deliantra/server/utils/cfutil.in 2007/09/10 18:30:30 1.62 @@ -23,7 +23,6 @@ use Coro::AIO; use Coro::Util; use POSIX (); -use Digest::MD5; use Carp; use Coro::Channel; use Coro::Storable; $Storable::canonical = 1; @@ -99,7 +98,10 @@ exit 1 unless $FORCE; } - system $RSYNC, "-a", "--chmod=u=rwX,go=rX", "$path/.", "$DATADIR/maps/.", "--delete", "--exclude", "CVS", "--delete-excluded" + system $RSYNC, "-av", "--chmod=u=rwX,go=rX", + "$path/.", "$DATADIR/maps/.", + "--exclude", "CVS", "--exclude", "/world-precomposed", + "--delete", "--delete-excluded" and die "map installation failed.\n"; print "maps installed successfully.\n"; @@ -176,12 +178,11 @@ my $fi = $FACEINFO{$base}; unless ($fi) { - warn "$path: <$base> not referenced by any archetype, skipping.\n"; - next; + #warn "$path: <$base> not referenced by any archetype, skipping.\n"; + #next; } - my $arc = $FACEINFO{$base}{arc} - or die "FATAL: internal error <$base>, cannot continue"; + my $arc = $fi->{arc} || { }; unless ($path =~ /~$/) { # possibly enlarge @@ -428,8 +429,11 @@ }; } - for my $face ($o->{face} || (), @{$anim || []}) { - next if $face =~ /^facings\s/; + for ($o->{face} || (), @{$anim || []}) { + next if /^facings\s/; + + my $face = $_; + $face =~ s/\+\d+\+\d+$//; # remove tile offset coordinates my $info = $FACEINFO{$face} ||= { }; $info->{arc} = $o; @@ -495,9 +499,17 @@ my $data; aio_load "$dir/$file", $data; - my $meta = load_cached "$dir/meta", sub { JSON::XS::from_json shift }; - next if $meta && !exists $meta->{$file}; + my $meta = load_cached "$dir/meta", sub { JSON::XS->new->utf8->relaxed->decode (shift) }; + + utf8::decode $dir; + utf8::decode $file; + + # a meta file for resources is now mandatory + unless (exists $meta->{$file}) { + warn "skipping $dir/$file\n" if $VERBOSE >= 3; + next; + } $meta = { %{ $meta->{"" } || {} }, @@ -523,7 +535,6 @@ $RESOURCE{"$dir/$file"} = { type => (delete $meta->{type}) || $type, data => $data, - chksum => (Digest::MD5::md5 $data), %$meta ? (meta => $meta) : (), }; } @@ -683,9 +694,6 @@ length $v->{data32} <= 10000 or warn "$k: face32 larger than 10000 bytes, will not work with crossfire client.\n"; #length $v->{data64} <= 10000 or warn "$k: face64 larger than 10000 bytes.\n"; - $v->{chksum32} = Digest::MD5::md5 $v->{data32}; - $v->{chksum64} = Digest::MD5::md5 $v->{data64}; - if (my $magicmap = $v->{magicmap}) { $magicmap =~ y/A-Z_\-/a-z/d; $v->{magicmap} = $COLOR{$magicmap};