ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/Jeweler.pm
(Generate patch)

Comparing deliantra/server/ext/Jeweler.pm (file contents):
Revision 1.32 by elmex, Tue Apr 27 17:08:09 2010 UTC vs.
Revision 1.33 by root, Wed Apr 28 21:05:33 2010 UTC

20 20
21=cut 21=cut
22 22
23our $CFG; 23our $CFG;
24 24
25sub read_config { 25sub load_config {
26 my ($filename) = @_; 26 0 < Coro::AIO::aio_load "$cf::DATADIR/jeweler", my $data
27 or die "$cf::DATADIR/jeweler: $!";
27 28
28 if (my $meta = $cf::RESOURCE{$filename}) {
29 $CFG = cf::decode_json $meta->{data}; 29 $CFG = cf::decode_json $data;
30 } else {
31 warn "$filename doesn't exist! no config for jeweler skill loaded!\n";
32 $CFG = {};
33 }
34} 30}
35 31
36sub getcfg { 32sub getcfg {
37 my ($sect, $key) = @_; 33 my ($sect, $key) = @_;
38 return $CFG->{$sect} unless defined $key; 34 return $CFG->{$sect} unless defined $key;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines