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.173 by root, Sat Jan 19 04:55:42 2008 UTC vs.
Revision 1.186 by root, Tue Aug 19 17:38:29 2008 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines