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.215 by root, Wed Jan 18 13:42:19 2012 UTC vs.
Revision 1.216 by root, Sat Nov 17 10:40:08 2012 UTC

42use List::Util (); 42use List::Util ();
43use IO::AIO (); 43use IO::AIO ();
44use Coro::AIO (); 44use Coro::AIO ();
45use AnyEvent::AIO (); 45use AnyEvent::AIO ();
46 46
47use Deliantra::Util ();
47use Deliantra::Protocol::Constants (); 48use Deliantra::Protocol::Constants ();
48 49
49=item shorten $string[, $maxlength] 50=item shorten $string[, $maxlength]
50 51
51=cut 52=cut
212 213
213sub load_cfg() { 214sub load_cfg() {
214 if (-e "$Deliantra::VARDIR/client.cf") { 215 if (-e "$Deliantra::VARDIR/client.cf") {
215 DC::read_cfg "$Deliantra::VARDIR/client.cf"; 216 DC::read_cfg "$Deliantra::VARDIR/client.cf";
216 } else { 217 } else {
217 $::CFG = {}; 218 $::CFG = { cfg_schema => 1, db_schema => 1 };
218 } 219 }
219} 220}
220 221
221sub save_cfg() { 222sub save_cfg() {
222 write_cfg "$Deliantra::VARDIR/client.cf"; 223 write_cfg "$Deliantra::VARDIR/client.cf";
263 logview_max_par => 1000, 264 logview_max_par => 1000,
264 shift_fire_stop => 0, 265 shift_fire_stop => 0,
265 uitheme => "wood", 266 uitheme => "wood",
266 map_shift_x => -24, # arbitrary 267 map_shift_x => -24, # arbitrary
267 map_shift_y => +24, # arbitrary 268 map_shift_y => +24, # arbitrary
268 #db_schema => 0,
269 ); 269 );
270 270
271 while (my ($k, $v) = each %DEF_CFG) { 271 while (my ($k, $v) = each %DEF_CFG) {
272 $::CFG->{$k} = $v unless exists $::CFG->{$k}; 272 $::CFG->{$k} = $v unless exists $::CFG->{$k};
273 }
274
275 if ($::CFG->{cfg_schema} < 1) {
276 for my $profile (values %{ $::CFG->{profile} }) {
277 $profile->{password} = unpack "H*", Deliantra::Util::hash_pw $profile->{password};
278 }
279 $::CFG->{cfg_schema} = 1;
273 } 280 }
274} 281}
275 282
276sub http_proxy { 283sub http_proxy {
277 my @proxy = win32_proxy_info; 284 my @proxy = win32_proxy_info;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines