[Crash] Fix Repop Race Condition Crash (#4814)

* [Crash] Fix Repop Race Condition Crash

* True fix
This commit is contained in:
Chris Miles 2025-03-29 17:39:40 -05:00 committed by GitHub
parent 5b9f7ff4c9
commit fe08961d25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View File

@ -501,6 +501,7 @@ int main(int argc, char **argv)
Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect
Timer UpdateWhoTimer(RuleI(Zone, UpdateWhoTimer) * 1000); // updates who list every 2 minutes Timer UpdateWhoTimer(RuleI(Zone, UpdateWhoTimer) * 1000); // updates who list every 2 minutes
Timer WorldserverProcess(1000);
#ifdef EQPROFILE #ifdef EQPROFILE
#ifdef PROFILE_DUMP_TIME #ifdef PROFILE_DUMP_TIME
@ -617,6 +618,10 @@ int main(int argc, char **argv)
} }
} }
if (WorldserverProcess.Check()) {
worldserver.Process();
}
if (is_zone_loaded) { if (is_zone_loaded) {
{ {
entity_list.GroupProcess(); entity_list.GroupProcess();

View File

@ -81,7 +81,6 @@ WorldServer::WorldServer()
cur_groupid = 0; cur_groupid = 0;
last_groupid = 0; last_groupid = 0;
oocmuted = false; oocmuted = false;
m_process_timer = std::make_unique<EQ::Timer>(1000, true, std::bind(&WorldServer::Process, this));
} }
WorldServer::~WorldServer() { WorldServer::~WorldServer() {
@ -95,6 +94,7 @@ void WorldServer::Process()
if (it->second.reload_at_unix < std::time(nullptr)) { if (it->second.reload_at_unix < std::time(nullptr)) {
ProcessReload(it->second); ProcessReload(it->second);
it = m_reload_queue.erase(it); it = m_reload_queue.erase(it);
break;
} else { } else {
++it; ++it;
} }

View File

@ -81,7 +81,6 @@ private:
ZoneEventScheduler *m_zone_scheduler; ZoneEventScheduler *m_zone_scheduler;
// server reload queue // server reload queue
std::unique_ptr<EQ::Timer> m_process_timer;
std::mutex m_reload_mutex = {}; std::mutex m_reload_mutex = {};
std::map<int, ServerReload::Request> m_reload_queue = {}; std::map<int, ServerReload::Request> m_reload_queue = {};
public: public: