48{
49 std::shared_ptr<sol::state> lua = std::make_shared<sol::state>();
50
51 lua->open_libraries(sol::lib::base);
52 lua->open_libraries(sol::lib::package);
53
54 std::shared_ptr<StatusEffectComponent> sec = std::make_shared<StatusEffectComponent>();
55
56 sec->sync_definitions(lua);
57 sec->sync_data_types(lua);
58 sec->sync_functions(lua);
59
63 try {
64 int total_entries = 0;
65 std::string file_path =
sZone->config().get_static_db_path().string() +
"status_effect_db.lua";
66 sol::load_result fx = lua->load_file(file_path);
67 sol::table status_tbl = fx();
68 status_tbl.for_each([this, &total_entries] (sol::object const &key, sol::object const &value) {
70 });
71 HLog(info) <<
"Loaded " << total_entries <<
" entries from '" << file_path <<
"'.";
72 } catch (sol::error &e) {
73 HLog(error) <<
"StatusEffectDatabase::load: " << e.what();
74 return false;
75 }
76
77 return true;
78}
#define HLog(type)
Definition: Logger.hpp:122
#define sZone
Definition: Zone.hpp:247
bool load_internal(sol::object const &key, sol::object const &value)
Definition: StatusEffectDB.cpp:80