Exported ReloadZoneStaticData to perl and lua.

Usage:
(perl) quest::reloadzonestaticdata();
(lua) eq.reloadzonestaticdata();
This commit is contained in:
JJ 2015-03-18 02:49:00 -04:00
parent cd82aae183
commit 3b9f62f0a1
4 changed files with 24 additions and 0 deletions

View File

@ -3429,6 +3429,16 @@ XS(XS__clear_npctype_cache)
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }
XS(XS__reloadzonestaticdata);
XS(XS__reloadzonestaticdata)
{
dXSARGS;
quest_manager.ReloadZoneStaticData();
XSRETURN_EMPTY;
}
XS(XS__qs_send_query); XS(XS__qs_send_query);
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, "qs_send_query"), XS__qs_send_query, file);
newXS(strcpy(buf, "rain"), XS__rain, file); newXS(strcpy(buf, "rain"), XS__rain, file);
newXS(strcpy(buf, "rebind"), XS__rebind, 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, "removetitle"), XS__removetitle, file);
newXS(strcpy(buf, "repopzone"), XS__repopzone, file); newXS(strcpy(buf, "repopzone"), XS__repopzone, file);
newXS(strcpy(buf, "resettaskactivity"), XS__resettaskactivity, file); newXS(strcpy(buf, "resettaskactivity"), XS__resettaskactivity, file);

View File

@ -1242,6 +1242,10 @@ void lua_clear_npctype_cache(int npctype_id) {
quest_manager.ClearNPCTypeCache(npctype_id); quest_manager.ClearNPCTypeCache(npctype_id);
} }
void lua_reloadzonestaticdata() {
quest_manager.ReloadZoneStaticData();
}
double lua_clock() { double lua_clock() {
timeval read_time; timeval read_time;
gettimeofday(&read_time, nullptr); gettimeofday(&read_time, nullptr);
@ -1592,6 +1596,7 @@ luabind::scope lua_register_general() {
luabind::def("enable_recipe", &lua_enable_recipe), luabind::def("enable_recipe", &lua_enable_recipe),
luabind::def("disable_recipe", &lua_disable_recipe), luabind::def("disable_recipe", &lua_disable_recipe),
luabind::def("clear_npctype_cache", &lua_clear_npctype_cache), luabind::def("clear_npctype_cache", &lua_clear_npctype_cache),
luabind::def("reloadzonestaticdata", &lua_reloadzonestaticdata),
luabind::def("clock", &lua_clock), luabind::def("clock", &lua_clock),
luabind::def("create_npc", &lua_create_npc), luabind::def("create_npc", &lua_create_npc),
luabind::def("debug", (void(*)(std::string))&lua_debug), luabind::def("debug", (void(*)(std::string))&lua_debug),

View File

@ -2927,6 +2927,13 @@ void QuestManager::ClearNPCTypeCache(int npctype_id) {
} }
} }
void QuestManager::ReloadZoneStaticData()
{
if (zone) {
zone->ReloadStaticData();
}
}
Client *QuestManager::GetInitiator() const { Client *QuestManager::GetInitiator() const {
if(!quests_running_.empty()) { if(!quests_running_.empty()) {
running_quest e = quests_running_.top(); running_quest e = quests_running_.top();

View File

@ -249,6 +249,7 @@ public:
bool EnableRecipe(uint32 recipe_id); bool EnableRecipe(uint32 recipe_id);
bool DisableRecipe(uint32 recipe_id); bool DisableRecipe(uint32 recipe_id);
void ClearNPCTypeCache(int npctype_id); void ClearNPCTypeCache(int npctype_id);
void ReloadZoneStaticData();
Client *GetInitiator() const; Client *GetInitiator() const;
NPC *GetNPC() const; NPC *GetNPC() const;