ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC.pm (file contents):
Revision 1.177 by root, Sun Mar 30 04:59:41 2008 UTC vs.
Revision 1.182 by root, Thu May 22 20:45:20 2008 UTC

15package DC; 15package DC;
16 16
17use Carp (); 17use Carp ();
18 18
19BEGIN { 19BEGIN {
20 $VERSION = '0.9969'; 20 $VERSION = '0.9972';
21 21
22 use XSLoader; 22 use XSLoader;
23 XSLoader::load "Deliantra::Client", $VERSION; 23 XSLoader::load "Deliantra::Client", $VERSION;
24} 24}
25 25
164 164
165 $::CFG = decode_json $CFG; 165 $::CFG = decode_json $CFG;
166} 166}
167 167
168sub write_cfg { 168sub write_cfg {
169 my ($file) = @_; 169 my $file = "$Deliantra::VARDIR/client.cf";
170 170
171 $::CFG->{VERSION} = $::VERSION; 171 $::CFG->{VERSION} = $::VERSION;
172 172
173 open my $fh, ">:utf8", $file 173 open my $fh, ">:utf8", $file
174 or return; 174 or return;
175 print $fh encode_json $::CFG; 175 print $fh JSON::XS->new->utf8->pretty->encode ($::CFG);
176} 176}
177 177
178sub http_proxy { 178sub http_proxy {
179 my @proxy = win32_proxy_info; 179 my @proxy = win32_proxy_info;
180 180
223 $nb = (! ! $nb) + 0; 223 $nb = (! ! $nb) + 0;
224 ioctl $fh, 0x8004667e, \$nb; # FIONBIO 224 ioctl $fh, 0x8004667e, \$nb; # FIONBIO
225 } else { 225 } else {
226 fcntl $fh, &Fcntl::F_SETFL, $nb ? &Fcntl::O_NONBLOCK : 0; 226 fcntl $fh, &Fcntl::F_SETFL, $nb ? &Fcntl::O_NONBLOCK : 0;
227 } 227 }
228
229} 228}
230 229
231package DC::Layout; 230package DC::Layout;
232 231
233$DC::OpenGL::INIT_HOOK{"DC::Layout"} = sub { 232$DC::OpenGL::INIT_HOOK{"DC::Layout"} = sub {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines