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.200 by root, Sun Jan 4 10:22:19 2009 UTC vs.
Revision 1.201 by root, Sun Jan 11 03:19:47 2009 UTC

195} 195}
196 196
197sub read_cfg { 197sub read_cfg {
198 my ($file) = @_; 198 my ($file) = @_;
199 199
200 $::CFG = load_json $file; 200 $::CFG = (load_json $file) || (load_json "$file.bak");
201} 201}
202 202
203sub write_cfg { 203sub write_cfg {
204 my $file = "$Deliantra::VARDIR/client.cf"; 204 my $file = "$Deliantra::VARDIR/client.cf";
205 205
206 $::CFG->{VERSION} = $::VERSION; 206 $::CFG->{VERSION} = $::VERSION;
207 $::CFG->{layout} = DC::UI::get_layout ();
207 208
208 open my $fh, ">:utf8", $file 209 open my $fh, ">:utf8", "$file~"
209 or return; 210 or return;
210 print $fh JSON::XS->new->utf8->pretty->encode ($::CFG); 211 print $fh JSON::XS->new->utf8->pretty->encode ($::CFG);
212 close $fh;
213
214 rename $file, "$file.bak";
215 rename "$file~", $file;
211} 216}
212 217
213sub http_proxy { 218sub http_proxy {
214 my @proxy = win32_proxy_info; 219 my @proxy = win32_proxy_info;
215 220

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines