--- deliantra/server/lib/cf.pm 2006/10/01 10:59:30 1.71 +++ deliantra/server/lib/cf.pm 2006/10/01 11:46:51 1.73 @@ -7,10 +7,14 @@ use Safe; use Safe::Hole; +use YAML::Syck (); use Time::HiRes; use Event; $Event::Eval = 1; # no idea why this is required, but it is +# work around bug in YAML::Syck - bad news for perl6, will it be as broken wrt. unicode? +$YAML::Syck::ImplicitUnicode = 1; + use strict; _init_vars; @@ -1027,7 +1031,18 @@ ############################################################################# # the server's main() +sub cfg_load { + open my $fh, "<:utf8", cf::confdir . "/config" + or return; + + local $/; + *CFG = YAML::Syck::Load <$fh>; + + use Data::Dumper; warn Dumper \%CFG; +} + sub main { + cfg_load; db_load; load_extensions; Event::loop; @@ -1089,7 +1104,8 @@ $msg->("reloading cf.pm"); require cf; - # load database again + # load config and database again + cf::cfg_load; cf::db_load; # load extensions