From fe08961d25773d0112fb505aedd4e6bd63d0abb3 Mon Sep 17 00:00:00 2001 From: Chris Miles Date: Sat, 29 Mar 2025 17:39:40 -0500 Subject: [PATCH] [Crash] Fix Repop Race Condition Crash (#4814) * [Crash] Fix Repop Race Condition Crash * True fix --- zone/main.cpp | 5 +++++ zone/worldserver.cpp | 2 +- zone/worldserver.h | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/zone/main.cpp b/zone/main.cpp index 0474951c8..1697a342f 100644 --- a/zone/main.cpp +++ b/zone/main.cpp @@ -501,6 +501,7 @@ int main(int argc, char **argv) Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect Timer UpdateWhoTimer(RuleI(Zone, UpdateWhoTimer) * 1000); // updates who list every 2 minutes + Timer WorldserverProcess(1000); #ifdef EQPROFILE #ifdef PROFILE_DUMP_TIME @@ -617,6 +618,10 @@ int main(int argc, char **argv) } } + if (WorldserverProcess.Check()) { + worldserver.Process(); + } + if (is_zone_loaded) { { entity_list.GroupProcess(); diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index ec83fa556..8ea559857 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -81,7 +81,6 @@ WorldServer::WorldServer() cur_groupid = 0; last_groupid = 0; oocmuted = false; - m_process_timer = std::make_unique(1000, true, std::bind(&WorldServer::Process, this)); } WorldServer::~WorldServer() { @@ -95,6 +94,7 @@ void WorldServer::Process() if (it->second.reload_at_unix < std::time(nullptr)) { ProcessReload(it->second); it = m_reload_queue.erase(it); + break; } else { ++it; } diff --git a/zone/worldserver.h b/zone/worldserver.h index d54731758..2e92169a5 100644 --- a/zone/worldserver.h +++ b/zone/worldserver.h @@ -81,7 +81,6 @@ private: ZoneEventScheduler *m_zone_scheduler; // server reload queue - std::unique_ptr m_process_timer; std::mutex m_reload_mutex = {}; std::map m_reload_queue = {}; public: