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.144 by root, Wed May 9 11:46:49 2007 UTC vs.
Revision 1.160 by root, Wed Dec 5 11:06:51 2007 UTC

15package CFPlus; 15package CFPlus;
16 16
17use Carp (); 17use Carp ();
18 18
19BEGIN { 19BEGIN {
20 $VERSION = '0.98'; 20 $VERSION = '0.9957';
21 21
22 use XSLoader; 22 use XSLoader;
23 XSLoader::load "CFPlus", $VERSION; 23 XSLoader::load "CFPlus", $VERSION;
24} 24}
25 25
28use AnyEvent (); 28use AnyEvent ();
29use Pod::POM (); 29use Pod::POM ();
30use File::Path (); 30use File::Path ();
31use Storable (); # finally 31use Storable (); # finally
32use Fcntl (); 32use Fcntl ();
33 33use JSON::XS qw(encode_json decode_json);
34BEGIN {
35 use Crossfire::Protocol::Base ();
36 *to_json = \&Crossfire::Protocol::Base::to_json;
37 *from_json = \&Crossfire::Protocol::Base::from_json;
38}
39 34
40=item guard { BLOCK } 35=item guard { BLOCK }
41 36
42Returns an object that executes the given block as soon as it is destroyed. 37Returns an object that executes the given block as soon as it is destroyed.
43 38
170 if ($CFG =~ /^---/) { ## TODO compatibility cruft, remove 165 if ($CFG =~ /^---/) { ## TODO compatibility cruft, remove
171 require YAML; 166 require YAML;
172 utf8::decode $CFG; 167 utf8::decode $CFG;
173 $::CFG = YAML::Load ($CFG); 168 $::CFG = YAML::Load ($CFG);
174 } elsif ($CFG =~ /^\{/) { 169 } elsif ($CFG =~ /^\{/) {
175 $::CFG = from_json $CFG; 170 $::CFG = decode_json $CFG;
176 } else { 171 } else {
177 $::CFG = eval $CFG; ## todo comaptibility cruft 172 $::CFG = eval $CFG; ## todo comaptibility cruft
178 } 173 }
179} 174}
180 175
183 178
184 $::CFG->{VERSION} = $::VERSION; 179 $::CFG->{VERSION} = $::VERSION;
185 180
186 open my $fh, ">:utf8", $file 181 open my $fh, ">:utf8", $file
187 or return; 182 or return;
188 print $fh to_json $::CFG; 183 print $fh encode_json $::CFG;
189} 184}
190 185
191sub http_proxy { 186sub http_proxy {
192 my @proxy = win32_proxy_info; 187 my @proxy = win32_proxy_info;
193 188

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines