--- deliantra/Deliantra-Client/DC.pm 2007/12/27 13:20:48 1.170 +++ deliantra/Deliantra-Client/DC.pm 2008/07/07 12:56:07 1.184 @@ -12,12 +12,14 @@ =cut +package Deliantra::Client; # work around CPAN breakage +package App::Deliantra; # try to reserve namespace package DC; use Carp (); BEGIN { - $VERSION = '0.9963'; + $VERSION = '0.9973'; use XSLoader; XSLoader::load "Deliantra::Client", $VERSION; @@ -166,13 +168,13 @@ } sub write_cfg { - my ($file) = @_; + my $file = "$Deliantra::VARDIR/client.cf"; $::CFG->{VERSION} = $::VERSION; open my $fh, ">:utf8", $file or return; - print $fh encode_json $::CFG; + print $fh JSON::XS->new->utf8->pretty->encode ($::CFG); } sub http_proxy { @@ -200,7 +202,7 @@ DC::set_proxy; my $ua = LWP::UserAgent->new ( - agent => "cfplus $VERSION", + agent => "deliantra $VERSION", keep_alive => 1, env_proxy => 1, timeout => 30, @@ -225,7 +227,6 @@ } else { fcntl $fh, &Fcntl::F_SETFL, $nb ? &Fcntl::O_NONBLOCK : 0; } - } package DC::Layout;