From 158d8a011f4c7c8bb92935c9b36c148623a2c529 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 31 Jan 2020 20:25:06 -0600 Subject: [PATCH 1/4] Beginning of hot reload work --- common/eqemu_logsys.cpp | 2 ++ common/eqemu_logsys.h | 2 ++ common/eqemu_logsys_log_aliases.h | 16 ++++++++++++ common/servertalk.h | 14 ++++++++--- world/console.cpp | 41 ++++++++++++++++++++++++++----- zone/CMakeLists.txt | 4 ++- zone/worldserver.cpp | 30 ++++++++++++++++++++-- zone/zone.cpp | 32 +++++++++++++++++++++++- zone/zone.h | 7 ++++++ zone/zone_reload.cpp | 35 ++++++++++++++++++++++++++ zone/zone_reload.h | 31 +++++++++++++++++++++++ 11 files changed, 201 insertions(+), 13 deletions(-) create mode 100644 zone/zone_reload.cpp create mode 100644 zone/zone_reload.h diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index f5d58a5fd..dca47dfb8 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -124,6 +124,8 @@ void EQEmuLogSys::LoadLogSettingsDefaults() log_settings[Logs::Loginserver].log_to_console = static_cast(Logs::General); log_settings[Logs::HeadlessClient].log_to_console = static_cast(Logs::General); log_settings[Logs::NPCScaling].log_to_gmsay = static_cast(Logs::General); + log_settings[Logs::HotReload].log_to_gmsay = static_cast(Logs::General); + log_settings[Logs::HotReload].log_to_console = static_cast(Logs::General); /** * RFC 5424 diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 9fa164d98..cb880e038 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -114,6 +114,7 @@ namespace Logs { EntityManagement, Flee, Aura, + HotReload, MaxCategoryID /* Don't Remove this */ }; @@ -187,6 +188,7 @@ namespace Logs { "Entity Management", "Flee", "Aura", + "HotReload", }; } diff --git a/common/eqemu_logsys_log_aliases.h b/common/eqemu_logsys_log_aliases.h index ccfc54f3a..2ca5127b6 100644 --- a/common/eqemu_logsys_log_aliases.h +++ b/common/eqemu_logsys_log_aliases.h @@ -561,6 +561,16 @@ OutF(LogSys, Logs::Detail, Logs::Aura, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ } while (0) +#define LogHotReload(message, ...) do {\ + if (LogSys.log_settings[Logs::HotReload].is_category_enabled == 1)\ + OutF(LogSys, Logs::General, Logs::HotReload, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ +} while (0) + +#define LogHotReloadDetail(message, ...) do {\ + if (LogSys.log_settings[Logs::HotReload].is_category_enabled == 1)\ + OutF(LogSys, Logs::Detail, Logs::HotReload, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ +} while (0) + #define Log(debug_level, log_category, message, ...) do {\ if (LogSys.log_settings[log_category].is_category_enabled == 1)\ LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ @@ -894,6 +904,12 @@ #define LogAuraDetail(message, ...) do {\ } while (0) +#define LogHotReload(message, ...) do {\ +} while (0) + +#define LogHotReloadDetail(message, ...) do {\ +} while (0) + #define Log(debug_level, log_category, message, ...) do {\ } while (0) diff --git a/common/servertalk.h b/common/servertalk.h index b9cb6202e..c361004f6 100644 --- a/common/servertalk.h +++ b/common/servertalk.h @@ -197,7 +197,11 @@ #define ServerOP_CZSetEntityVariableByClientName 0x4012 #define ServerOP_UCSServerStatusRequest 0x4013 #define ServerOP_UCSServerStatusReply 0x4014 -/* Query Server OP Codes */ +#define ServerOP_HotReloadQuests 0x4015 + +/** + * QueryServer + */ #define ServerOP_QSPlayerLogTrades 0x5010 #define ServerOP_QSPlayerLogHandins 0x5011 #define ServerOP_QSPlayerLogNPCKills 0x5012 @@ -1349,12 +1353,16 @@ struct CZSetEntVarByClientName_Struct { char m_var[256]; }; -struct ReloadWorld_Struct{ +struct ReloadWorld_Struct { uint32 Option; }; +struct HotReloadQuestsStruct { + char zone_short_name[200]; +}; + struct ServerRequestTellQueue_Struct { - char name[64]; + char name[64]; }; struct UCSServerStatus_Struct { diff --git a/world/console.cpp b/world/console.cpp index 90e5f7c71..26d42e4b4 100644 --- a/world/console.cpp +++ b/world/console.cpp @@ -802,9 +802,9 @@ void ConsoleIpLookup( const std::vector &args ) { - if (args.size() > 0) { + if (!args.empty()) { WorldConsoleTCPConnection console_connection(connection); - client_list.SendCLEList(connection->Admin(), 0, &console_connection, args[0].c_str()); + client_list.SendCLEList(connection->Admin(), nullptr, &console_connection, args[0].c_str()); } } @@ -855,6 +855,34 @@ void ConsoleReloadWorld( safe_delete(pack); } +/** + * @param connection + * @param command + * @param args + */ +void ConsoleReloadZoneQuests( + EQ::Net::ConsoleServerConnection *connection, + const std::string &command, + const std::vector &args +) +{ + if (args.empty()) { + connection->SendLine("[zone_short_name] required as argument"); + return; + } + + std::string zone_short_name = args[0]; + + connection->SendLine(fmt::format("Reloading Zone [{}]...", zone_short_name)); + + auto pack = new ServerPacket(ServerOP_HotReloadQuests, sizeof(HotReloadQuestsStruct)); + auto *hot_reload_quests = (HotReloadQuestsStruct *) pack->pBuffer; + strn0cpy(hot_reload_quests->zone_short_name, (char *) zone_short_name.c_str(), 200); + + zoneserver_list.SendPacket(pack); + safe_delete(pack); +} + /** * @param connection * @param command @@ -892,7 +920,8 @@ void RegisterConsoleFunctions(std::unique_ptr& console) console->RegisterCall("md5", 50, "md5", std::bind(ConsoleMd5, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("ooc", 50, "ooc [message]", std::bind(ConsoleOOC, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("reloadworld", 200, "reloadworld", std::bind(ConsoleReloadWorld, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); - console->RegisterCall("setpass", 200, "setpass [accountname] [newpass]", std::bind(ConsoleSetPass, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + console->RegisterCall("reloadzonequests", 200, "reloadzonequests [zone_short_name]", std::bind(ConsoleReloadZoneQuests, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + console->RegisterCall("setpass", 200, "setpass [account_name] [new_password]", std::bind(ConsoleSetPass, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("signalcharbyname", 50, "signalcharbyname charname ID", std::bind(ConsoleSignalCharByName, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("tell", 50, "tell [name] [message]", std::bind(ConsoleTell, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("unlock", 150, "unlock", std::bind(ConsoleUnlock, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); @@ -901,9 +930,9 @@ void RegisterConsoleFunctions(std::unique_ptr& console) console->RegisterCall("who", 50, "who", std::bind(ConsoleWho, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("whoami", 50, "whoami", std::bind(ConsoleWhoami, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("worldshutdown", 200, "worldshutdown", std::bind(ConsoleWorldShutdown, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); - console->RegisterCall("zonebootup", 150, "zonebootup [ZoneServerID] [zonename]", std::bind(ConsoleZoneBootup, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); - console->RegisterCall("zonelock", 150, "zonelock [list|lock|unlock] [zonename]", std::bind(ConsoleZoneLock, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); - console->RegisterCall("zoneshutdown", 150, "zoneshutdown [zonename or ZoneServerID]", std::bind(ConsoleZoneShutdown, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + console->RegisterCall("zonebootup", 150, "zonebootup [zone_server_id] [zone_short_name]", std::bind(ConsoleZoneBootup, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + console->RegisterCall("zonelock", 150, "zonelock [list|lock|unlock] [zone_short_name]", std::bind(ConsoleZoneLock, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + console->RegisterCall("zoneshutdown", 150, "zoneshutdown [zone_short_name or zone_server_id]", std::bind(ConsoleZoneShutdown, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("zonestatus", 50, "zonestatus", std::bind(ConsoleZoneStatus, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));console->RegisterCall("ping", 50, "ping", std::bind(ConsoleNull, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("quit", 50, "quit", std::bind(ConsoleQuit, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("exit", 50, "exit", std::bind(ConsoleQuit, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); diff --git a/zone/CMakeLists.txt b/zone/CMakeLists.txt index f75e963f9..80415f6ff 100644 --- a/zone/CMakeLists.txt +++ b/zone/CMakeLists.txt @@ -141,6 +141,7 @@ SET(zone_sources zone.cpp zone_config.cpp zonedb.cpp + zone_reload.cpp zoning.cpp ) @@ -247,7 +248,8 @@ SET(zone_headers zone.h zone_config.h zonedb.h - zonedump.h) + zonedump.h + zone_reload.h ) ADD_EXECUTABLE(zone ${zone_sources} ${zone_headers}) diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index a5180963d..95a732995 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -51,6 +51,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include "worldserver.h" #include "zone.h" #include "zone_config.h" +#include "zone_reload.h" extern EntityList entity_list; @@ -1930,15 +1931,40 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) iter++; } } + case ServerOP_ReloadWorld: { - ReloadWorld_Struct* RW = (ReloadWorld_Struct*)pack->pBuffer; + auto* reload_world = (ReloadWorld_Struct*)pack->pBuffer; if (zone) { - zone->ReloadWorld(RW->Option); + zone->ReloadWorld(reload_world->Option); } break; } + case ServerOP_HotReloadQuests: + { + if (!zone) { + break; + } + + auto *hot_reload_quests = (HotReloadQuestsStruct *) pack->pBuffer; + + LogHotReloadDetail( + "Receiving request [HotReloadQuests] | request_zone [{}] current_zone [{}]", + hot_reload_quests->zone_short_name, + zone->GetShortName() + ); + + std::string request_zone_short_name = hot_reload_quests->zone_short_name; + std::string local_zone_short_name = zone->GetShortName(); + + if (request_zone_short_name == local_zone_short_name || request_zone_short_name == "all"){ + zone->SetQuestHotReloadQueued(true); + } + + break; + } + case ServerOP_ChangeSharedMem: { std::string hotfix_name = std::string((char*)pack->pBuffer); diff --git a/zone/zone.cpp b/zone/zone.cpp index b88ddd071..90d624848 100755 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -55,6 +55,7 @@ #include "mob_movement_manager.h" #include "npc_scale_manager.h" #include "../common/data_verification.h" +#include "zone_reload.h" #include #include @@ -771,6 +772,7 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) autoshutdown_timer((RuleI(Zone, AutoShutdownDelay))), clientauth_timer(AUTHENTICATION_TIMEOUT * 1000), spawn2_timer(1000), + hot_reload_timer(1000), qglobal_purge_timer(30000), hotzone_timer(120000), m_SafePoint(0.0f,0.0f,0.0f), @@ -874,6 +876,7 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) mMovementManager = &MobMovementManager::Get(); SetNpcPositionUpdateDistance(0); + SetQuestHotReloadQueued(false); } Zone::~Zone() { @@ -1231,6 +1234,24 @@ bool Zone::Process() { } } + if (hot_reload_timer.Check() && IsQuestHotReloadQueued()) { + + LogHotReloadDetail("Hot reload timer check..."); + + bool perform_reload = true; + for (auto &it : entity_list.GetClientList()) { + auto client = it.second; + if (client->GetAggroCount() > 0) { + perform_reload = false; + break; + } + } + + if (perform_reload) { + ZoneReload::HotReloadQuests(); + } + } + if(initgrids_timer.Check()) { //delayed grid loading stuff. initgrids_timer.Disable(); @@ -1540,7 +1561,6 @@ void Zone::RepopClose(const glm::vec4& client_position, uint32 repop_distance) void Zone::Repop(uint32 delay) { - if (!Depop()) { return; } @@ -2422,3 +2442,13 @@ void Zone::CalculateNpcUpdateDistanceSpread() combined_spread ); } + +bool Zone::IsQuestHotReloadQueued() const +{ + return quest_hot_reload_queued; +} + +void Zone::SetQuestHotReloadQueued(bool in_quest_hot_reload_queued) +{ + quest_hot_reload_queued = in_quest_hot_reload_queued; +} diff --git a/zone/zone.h b/zone/zone.h index 4ed017627..1243e18c2 100755 --- a/zone/zone.h +++ b/zone/zone.h @@ -204,6 +204,7 @@ public: time_t weather_timer; Timer spawn2_timer; + Timer hot_reload_timer; uint8 weather_intensity; uint8 zone_weather; @@ -270,6 +271,9 @@ public: void UpdateQGlobal(uint32 qid, QGlobal newGlobal); void weatherSend(Client *client = nullptr); + bool IsQuestHotReloadQueued() const; + void SetQuestHotReloadQueued(bool in_quest_hot_reload_queued); + WaterMap *watermap; ZonePoint *GetClosestZonePoint(const glm::vec3 &location, uint32 to, Client *client, float max_distance = 40000.0f); ZonePoint *GetClosestZonePointWithoutZone(float x, float y, float z, Client *client, float max_distance = 40000.0f); @@ -340,6 +344,9 @@ private: bool m_ucss_available; bool staticzone; bool zone_has_current_time; + bool quest_hot_reload_queued; + +private: double max_movement_update_range; char *long_name; char *map_name; diff --git a/zone/zone_reload.cpp b/zone/zone_reload.cpp new file mode 100644 index 000000000..914a67ebc --- /dev/null +++ b/zone/zone_reload.cpp @@ -0,0 +1,35 @@ +/** + * EQEmulator: Everquest Server Emulator + * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY except by those people which sell it, which + * are required to give you total support for your newly bought product; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include "zone_reload.h" +#include "quest_parser_collection.h" + +void ZoneReload::HotReloadQuests() +{ + BenchTimer timer; + timer.reset(); + + entity_list.ClearAreas(); + parse->ReloadQuests(); + zone->Repop(0); + zone->SetQuestHotReloadQueued(false); + + LogHotReload("[Quests] Reloading scripts in zone [{}] Time [{:.2f}]", zone->GetShortName(), timer.elapsed()); +} diff --git a/zone/zone_reload.h b/zone/zone_reload.h new file mode 100644 index 000000000..1e4f95826 --- /dev/null +++ b/zone/zone_reload.h @@ -0,0 +1,31 @@ +/** + * EQEmulator: Everquest Server Emulator + * Copyright (C) 2001-2020 EQEmulator Development Team (https://github.com/EQEmu/Server) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY except by those people which sell it, which + * are required to give you total support for your newly bought product; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR + * A PARTICULAR PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef EQEMU_ZONE_RELOAD_H +#define EQEMU_ZONE_RELOAD_H + + +class ZoneReload { +public: + static void HotReloadQuests(); +}; + + +#endif //EQEMU_ZONE_RELOAD_H From c8e6d031cf5e5b73eb13369ffa25a8dbc2da1207 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 31 Jan 2020 21:51:05 -0600 Subject: [PATCH 2/4] Add more rule-driven behavior --- common/ruletypes.h | 6 ++++++ world/console.cpp | 2 +- zone/zone.cpp | 13 ++++++++----- zone/zone_reload.cpp | 17 ++++++++++++++--- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index dab1d02e1..6a2ca7b57 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -762,6 +762,12 @@ RULE_CATEGORY(Logging) RULE_BOOL(Logging, PrintFileFunctionAndLine, false, "Ex: [World Server] [net.cpp::main:309] Loading variables...") RULE_CATEGORY_END() +RULE_CATEGORY(HotReload) +RULE_BOOL(HotReload, QuestsRepopWithReload, true, "When a hot reload is triggered, the zone will repop") +RULE_BOOL(HotReload, QuestsRepopWhenPlayersNotInCombat, true, "When a hot reload is triggered, the zone will repop when no clients are in combat") +RULE_BOOL(HotReload, QuestsResetTimersWithReload, true, "When a hot reload is triggered, the zone will repop") +RULE_CATEGORY_END() + #undef RULE_CATEGORY #undef RULE_INT #undef RULE_REAL diff --git a/world/console.cpp b/world/console.cpp index 26d42e4b4..b3f36c923 100644 --- a/world/console.cpp +++ b/world/console.cpp @@ -925,7 +925,7 @@ void RegisterConsoleFunctions(std::unique_ptr& console) console->RegisterCall("signalcharbyname", 50, "signalcharbyname charname ID", std::bind(ConsoleSignalCharByName, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("tell", 50, "tell [name] [message]", std::bind(ConsoleTell, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("unlock", 150, "unlock", std::bind(ConsoleUnlock, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); - console->RegisterCall("uptime", 50, "uptime [zoneID#]", std::bind(ConsoleUptime, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); + console->RegisterCall("uptime", 50, "uptime [zone_server_id]", std::bind(ConsoleUptime, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("version", 50, "version", std::bind(ConsoleVersion, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("who", 50, "who", std::bind(ConsoleWho, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); console->RegisterCall("whoami", 50, "whoami", std::bind(ConsoleWhoami, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3)); diff --git a/zone/zone.cpp b/zone/zone.cpp index 90d624848..16cdc0af8 100755 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -1239,11 +1239,14 @@ bool Zone::Process() { LogHotReloadDetail("Hot reload timer check..."); bool perform_reload = true; - for (auto &it : entity_list.GetClientList()) { - auto client = it.second; - if (client->GetAggroCount() > 0) { - perform_reload = false; - break; + + if (RuleB(HotReload, QuestsRepopWhenPlayersNotInCombat)) { + for (auto &it : entity_list.GetClientList()) { + auto client = it.second; + if (client->GetAggroCount() > 0) { + perform_reload = false; + break; + } } } diff --git a/zone/zone_reload.cpp b/zone/zone_reload.cpp index 914a67ebc..5a9aeda99 100644 --- a/zone/zone_reload.cpp +++ b/zone/zone_reload.cpp @@ -27,9 +27,20 @@ void ZoneReload::HotReloadQuests() timer.reset(); entity_list.ClearAreas(); - parse->ReloadQuests(); - zone->Repop(0); + + parse->ReloadQuests(RuleB(HotReload, QuestsResetTimersWithReload)); + + if (RuleB(HotReload, QuestsRepopWithReload)) { + zone->Repop(0); + } zone->SetQuestHotReloadQueued(false); - LogHotReload("[Quests] Reloading scripts in zone [{}] Time [{:.2f}]", zone->GetShortName(), timer.elapsed()); + LogHotReload( + "[Quests] Reloading scripts in zone [{}] repop_with_reload [{}] reset_timers [{}] when_not_in_combat [{}] Time [{:.4f}]", + zone->GetShortName(), + (RuleB(HotReload, QuestsRepopWithReload) ? "true" : "false"), + (RuleB(HotReload, QuestsResetTimersWithReload) ? "true" : "false"), + (RuleB(HotReload, QuestsRepopWhenPlayersNotInCombat) ? "true" : "false"), + timer.elapsed() + ); } From 929e4c131744a08e4c52f173d27f35e7260bd150 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 4 Feb 2020 23:52:18 -0600 Subject: [PATCH 3/4] Adjust verbiage [skip ci] --- zone/zone_reload.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/zone_reload.cpp b/zone/zone_reload.cpp index 5a9aeda99..42424dae2 100644 --- a/zone/zone_reload.cpp +++ b/zone/zone_reload.cpp @@ -36,7 +36,7 @@ void ZoneReload::HotReloadQuests() zone->SetQuestHotReloadQueued(false); LogHotReload( - "[Quests] Reloading scripts in zone [{}] repop_with_reload [{}] reset_timers [{}] when_not_in_combat [{}] Time [{:.4f}]", + "[Quests] Reloading [{}] repop [{}] reset_timers [{}] repop_when_not_in_combat [{}] Time [{:.4f}]", zone->GetShortName(), (RuleB(HotReload, QuestsRepopWithReload) ? "true" : "false"), (RuleB(HotReload, QuestsResetTimersWithReload) ? "true" : "false"), From 8376ed5d3f7d2941430c7d0542b312bd74727562 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 22 Feb 2020 16:17:18 -0600 Subject: [PATCH 4/4] PR adjustments --- common/ruletypes.h | 2 +- zone/zone_reload.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index 3e2c56c03..c584f37a7 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -766,7 +766,7 @@ RULE_CATEGORY_END() RULE_CATEGORY(HotReload) RULE_BOOL(HotReload, QuestsRepopWithReload, true, "When a hot reload is triggered, the zone will repop") RULE_BOOL(HotReload, QuestsRepopWhenPlayersNotInCombat, true, "When a hot reload is triggered, the zone will repop when no clients are in combat") -RULE_BOOL(HotReload, QuestsResetTimersWithReload, true, "When a hot reload is triggered, the zone will repop") +RULE_BOOL(HotReload, QuestsResetTimersWithReload, true, "When a hot reload is triggered, quest timers will be reset") RULE_CATEGORY_END() #undef RULE_CATEGORY diff --git a/zone/zone_reload.cpp b/zone/zone_reload.cpp index 42424dae2..3dca89d71 100644 --- a/zone/zone_reload.cpp +++ b/zone/zone_reload.cpp @@ -24,7 +24,6 @@ void ZoneReload::HotReloadQuests() { BenchTimer timer; - timer.reset(); entity_list.ClearAreas(); @@ -33,6 +32,7 @@ void ZoneReload::HotReloadQuests() if (RuleB(HotReload, QuestsRepopWithReload)) { zone->Repop(0); } + zone->SetQuestHotReloadQueued(false); LogHotReload(