--- deliantra/gde/GCE/Util.pm 2006/10/14 15:18:46 1.21 +++ deliantra/gde/GCE/Util.pm 2007/01/05 14:17:12 1.23 @@ -22,6 +22,7 @@ use File::Path; use HTTP::Request::Common; use Cwd 'abs_path'; +use strict; our @EXPORT = qw(insert_arch_stack_layer replace_arch_stack_layer new_arch_pb fill_pb_from_arch arch_is_floor stack_find_floor stack_find_wall @@ -73,7 +74,7 @@ sub map2abs { my ($dest, $mape) = @_; - $mappath = abs_path $mappath; + $dest = abs_path $dest; my $dir; if (File::Spec->file_name_is_absolute($dest)) { $dir = catdir ($::MAPDIR, $dest); @@ -121,8 +122,11 @@ my ($pb, $a) = @_; my $o = $Crossfire::ARCH{$a->{_name}}; - my $face = $Crossfire::FACE{$a->{face} || $o->{face} || "blank.111"} - or warn "no gfx found for arch '$a->{_name}' at ($x|$y)\n"; + my $face = $Crossfire::FACE{$a->{face} || $o->{face} || "blank.111"}; + unless ($face) { + $face = $Crossfire::FACE{"blank.x11"} + or warn "no gfx found for arch '$a->{_name}'\n"; + } $face or return; @@ -357,7 +361,14 @@ } sub upload { - my ($login, $password, $path, $rev, $mapdata) = @_; + my ($login, $password, $srcrep, $path, $rev, $mapdata) = @_; + require LWP::UserAgent; + my $ua = LWP::UserAgent->new ( + agent => "gcrossedit", + keep_alive => 1, + env_proxy => 1, + timeout => 30, + ); require HTTP::Request::Common; my $res = $ua->post ( @@ -365,7 +376,7 @@ Content_Type => 'multipart/form-data', Content => [ path => $path, - mapdir => $::MAPDIR, + mapdir => $srcrep, map => $mapdata, revision => $rev, cf_login => $login, #ENV{CFPLUS_LOGIN},