--- deliantra/server/utils/cfutil.in 2007/12/17 08:03:22 1.63 +++ deliantra/server/utils/cfutil.in 2007/12/28 12:44:45 1.67 @@ -20,7 +20,7 @@ use JSON::XS (); use IO::AIO (); use File::Temp; -use Crossfire; +use Deliantra; use Coro; use Coro::AIO; use Coro::Util; @@ -509,6 +509,7 @@ # a meta file for resources is now mandatory unless (exists $meta->{$file}) { warn "skipping $dir/$file\n" if $VERBOSE >= 3; + next; } $meta = { @@ -535,6 +536,11 @@ if (my $filter = $meta->{cfutil_filter}) { if ($filter eq "yaml2json") { $data = JSON::XS::encode_json YAML::Syck::Load $data; + } elsif ($filter eq "json2json") { + $data = JSON::XS::encode_json JSON::XS->relaxed->utf8->decode ($data); + } elsif ($filter eq "perl2json") { + $data = eval $data; die if $@; + $data = JSON::XS::encode_json $data; } else { warn "$dir/$file: unknown filter $filter, skipping\n"; } @@ -575,7 +581,7 @@ if ($file =~ /\.(jpg|png)$/) { $c_res->put ([$path, $file, 0]) # FT_FACE } elsif ($file =~ /\.(res)$/) { - $c_res->put ([$path, $file, 7]) # FT_RSRC + $c_res->put ([$path, $file, 6]) # FT_RSRC } else { $c_res->put ([$path, $file, undef]); } @@ -686,7 +692,7 @@ print "writing archetypes...\n" if $VERBOSE; open my $fh, ">:utf8", "$DATADIR/archetypes~" or die "$DATADIR/archetypes~: $!"; - print $fh Crossfire::archlist_to_string [sort { $a->{_name} cmp $b->{_name} } @ARC]; + print $fh Deliantra::archlist_to_string [sort { $a->{_name} cmp $b->{_name} } @ARC]; } {