… | |
… | |
3522 | # the server's init and main functions |
3522 | # the server's init and main functions |
3523 | |
3523 | |
3524 | our %FACEHASH; # hash => idx, #d# HACK for http server |
3524 | our %FACEHASH; # hash => idx, #d# HACK for http server |
3525 | |
3525 | |
3526 | # internal api, not fianlised |
3526 | # internal api, not fianlised |
3527 | sub add_face { |
3527 | sub set_face { |
3528 | my ($name, $type, $data) = @_; |
3528 | my ($name, $type, $data) = @_; |
3529 | |
3529 | |
3530 | my $idx = cf::face::find $name; |
3530 | my $idx = cf::face::find $name; |
3531 | |
3531 | |
3532 | if ($idx) { |
3532 | if ($idx) { |
… | |
… | |
3652 | } |
3652 | } |
3653 | |
3653 | |
3654 | sub reload_exp_table { |
3654 | sub reload_exp_table { |
3655 | _reload_exp_table; |
3655 | _reload_exp_table; |
3656 | |
3656 | |
3657 | add_face "res/exp_table" => FT_RSRC, |
3657 | set_face "res/exp_table" => FT_RSRC, |
3658 | JSON::XS->new->utf8->canonical->encode ( |
3658 | JSON::XS->new->utf8->canonical->encode ( |
3659 | [map cf::level_to_min_exp $_, 1 .. cf::settings->max_level] |
3659 | [map cf::level_to_min_exp $_, 1 .. cf::settings->max_level] |
3660 | ); |
3660 | ); |
3661 | } |
3661 | } |
3662 | |
3662 | |
… | |
… | |
3685 | |
3685 | |
3686 | sub reload_archetypes { |
3686 | sub reload_archetypes { |
3687 | load_resource_file "$DATADIR/archetypes" |
3687 | load_resource_file "$DATADIR/archetypes" |
3688 | or die "unable to load archetypes\n"; |
3688 | or die "unable to load archetypes\n"; |
3689 | |
3689 | |
3690 | add_face "res/skill_info" => FT_RSRC, |
3690 | set_face "res/skill_info" => FT_RSRC, |
3691 | JSON::XS->new->utf8->canonical->encode ( |
3691 | JSON::XS->new->utf8->canonical->encode ( |
3692 | [map [cf::arch::skillvec ($_)->name], 0 .. cf::arch::skillvec_size - 1] |
3692 | [map [cf::arch::skillvec ($_)->name], 0 .. cf::arch::skillvec_size - 1] |
3693 | ); |
3693 | ); |
3694 | add_face "res/spell_paths" => FT_RSRC, |
3694 | set_face "res/spell_paths" => FT_RSRC, |
3695 | JSON::XS->new->utf8->canonical->encode ( |
3695 | JSON::XS->new->utf8->canonical->encode ( |
3696 | [map [cf::spellpathnames ($_)], 0 .. NRSPELLPATHS - 1] |
3696 | [map [cf::spellpathnames ($_)], 0 .. NRSPELLPATHS - 1] |
3697 | ); |
3697 | ); |
3698 | } |
3698 | } |
3699 | |
3699 | |