From 3b9f62f0a1521fbdadd3698375a8565516a8db04 Mon Sep 17 00:00:00 2001 From: JJ Date: Wed, 18 Mar 2015 02:49:00 -0400 Subject: [PATCH] Exported ReloadZoneStaticData to perl and lua. Usage: (perl) quest::reloadzonestaticdata(); (lua) eq.reloadzonestaticdata(); --- zone/embparser_api.cpp | 11 +++++++++++ zone/lua_general.cpp | 5 +++++ zone/questmgr.cpp | 7 +++++++ zone/questmgr.h | 1 + 4 files changed, 24 insertions(+) diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index 8b49f01b2..1729978b0 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -3429,6 +3429,16 @@ XS(XS__clear_npctype_cache) XSRETURN_EMPTY; } +XS(XS__reloadzonestaticdata); +XS(XS__reloadzonestaticdata) +{ + dXSARGS; + + quest_manager.ReloadZoneStaticData(); + + XSRETURN_EMPTY; +} + XS(XS__qs_send_query); XS(XS__qs_send_query) { @@ -3686,6 +3696,7 @@ EXTERN_C XS(boot_quest) newXS(strcpy(buf, "qs_send_query"), XS__qs_send_query, file); newXS(strcpy(buf, "rain"), XS__rain, file); newXS(strcpy(buf, "rebind"), XS__rebind, file); + newXS(strcpy(buf, "reloadzonestaticdata"), XS__reloadzonestaticdata, file); newXS(strcpy(buf, "removetitle"), XS__removetitle, file); newXS(strcpy(buf, "repopzone"), XS__repopzone, file); newXS(strcpy(buf, "resettaskactivity"), XS__resettaskactivity, file); diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index 50afdb6e9..59a5d3740 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -1242,6 +1242,10 @@ void lua_clear_npctype_cache(int npctype_id) { quest_manager.ClearNPCTypeCache(npctype_id); } +void lua_reloadzonestaticdata() { + quest_manager.ReloadZoneStaticData(); +} + double lua_clock() { timeval read_time; gettimeofday(&read_time, nullptr); @@ -1592,6 +1596,7 @@ luabind::scope lua_register_general() { luabind::def("enable_recipe", &lua_enable_recipe), luabind::def("disable_recipe", &lua_disable_recipe), luabind::def("clear_npctype_cache", &lua_clear_npctype_cache), + luabind::def("reloadzonestaticdata", &lua_reloadzonestaticdata), luabind::def("clock", &lua_clock), luabind::def("create_npc", &lua_create_npc), luabind::def("debug", (void(*)(std::string))&lua_debug), diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 97992e0bc..47d92b68e 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -2927,6 +2927,13 @@ void QuestManager::ClearNPCTypeCache(int npctype_id) { } } +void QuestManager::ReloadZoneStaticData() +{ + if (zone) { + zone->ReloadStaticData(); + } +} + Client *QuestManager::GetInitiator() const { if(!quests_running_.empty()) { running_quest e = quests_running_.top(); diff --git a/zone/questmgr.h b/zone/questmgr.h index 7051bbb2b..d2f018b8c 100644 --- a/zone/questmgr.h +++ b/zone/questmgr.h @@ -249,6 +249,7 @@ public: bool EnableRecipe(uint32 recipe_id); bool DisableRecipe(uint32 recipe_id); void ClearNPCTypeCache(int npctype_id); + void ReloadZoneStaticData(); Client *GetInitiator() const; NPC *GetNPC() const;