--- deliantra/Deliantra-Client/DC/MapWidget.pm 2006/10/08 21:22:30 1.85 +++ deliantra/Deliantra-Client/DC/MapWidget.pm 2006/10/08 21:54:20 1.86 @@ -82,15 +82,10 @@ my $editsup = $::CONN && $::CONN->{editor_support} or return; - # putting the password into the env is somewhat tasteless -# local $ENV{CFPLUS_LOGIN} = $::PROFILE->{user}; -# local $ENV{CFPLUS_PASSWORD} = $::PROFILE->{password}; -# local $ENV{CFPLUS_UPLOAD} = $::CONN->{upload}; - my ($pid, $fh); unless ($pid = open $fh, "-|:utf8", "-") { $SIG{__DIE__} = sub { - warn "@_\n"; + warn "FATAL: @_\n"; CFPlus::_exit 99; }; @@ -144,6 +139,33 @@ my $map = (check_lwp $ua->get ("$editsup->{cvs_root}/$mapname?rev=$rev"))->decoded_content; + my $meta = { + %$editsup, + path => $mapname, + revision => $rev, + cf_login => $::PROFILE->{user}, + }; + + my $mappath = "$mapdir/$mapname"; + + require File::Basename; + require File::Path; + + File::Path::mkpath (File::Basename::dirname ($mappath)); + open my $fh, ">:raw:perlio", "$mappath.meta" + or die "$mappath.meta: $!"; + print $fh CFPlus::to_json $meta; + close $fh; + open my $fh, ">:raw:perlio:utf8", $mappath + or die "$mappath: $!"; + print $fh $map; + close $fh; + + print "saved as $mappath\n"; + + print "invoking editor...\n"; + exec "/root/s2/gce $mappath";#d# + # now upload it # require HTTP::Request::Common; # @@ -174,9 +196,6 @@ } } - print "invoking editor...\n"; - exec "/root/s2/gce";#d# - CFPlus::_exit; }