mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 17:26:30 +00:00
[Code] ZSList Global to Singleton Cleanup (#4940)
* [Code] ZSList Global to Singleton Cleanup * Final * Post merge fixes --------- Co-authored-by: Chris Miles <akkadius1@gmail.com>
This commit is contained in:
+14
-15
@@ -93,7 +93,6 @@
|
||||
|
||||
ClientList client_list;
|
||||
GroupLFPList LFPGroupList;
|
||||
ZSList zoneserver_list;
|
||||
LauncherList launcher_list;
|
||||
volatile bool RunLoops = true;
|
||||
uint32 numclients = 0;
|
||||
@@ -173,7 +172,7 @@ int main(int argc, char **argv)
|
||||
// global loads
|
||||
LogInfo("Loading launcher list");
|
||||
launcher_list.LoadList();
|
||||
zoneserver_list.Init();
|
||||
ZSList::Instance()->Init();
|
||||
|
||||
if (IpUtil::IsPortInUse(Config->WorldIP, Config->WorldTCPPort)) {
|
||||
LogError("World port [{}] already in use", Config->WorldTCPPort);
|
||||
@@ -207,7 +206,7 @@ int main(int argc, char **argv)
|
||||
server_connection->OnConnectionIdentified(
|
||||
"Zone", [&console](std::shared_ptr<EQ::Net::ServertalkServerConnection> connection) {
|
||||
numzones++;
|
||||
zoneserver_list.Add(new ZoneServer(connection, console.get()));
|
||||
ZSList::Instance()->Add(new ZoneServer(connection, console.get()));
|
||||
|
||||
LogInfo(
|
||||
"New Zone Server connection from [{}] at [{}:{}] zone_count [{}]",
|
||||
@@ -222,7 +221,7 @@ int main(int argc, char **argv)
|
||||
server_connection->OnConnectionRemoved(
|
||||
"Zone", [](std::shared_ptr<EQ::Net::ServertalkServerConnection> connection) {
|
||||
numzones--;
|
||||
zoneserver_list.Remove(connection->GetUUID());
|
||||
ZSList::Instance()->Remove(connection->GetUUID());
|
||||
|
||||
LogInfo(
|
||||
"Removed Zone Server connection from [{}] total zone_count [{}]",
|
||||
@@ -290,7 +289,7 @@ int main(int argc, char **argv)
|
||||
|
||||
UCSConnection::Instance()->SetConnection(connection);
|
||||
|
||||
zoneserver_list.UpdateUCSServerAvailable();
|
||||
ZSList::Instance()->UpdateUCSServerAvailable();
|
||||
}
|
||||
);
|
||||
|
||||
@@ -303,7 +302,7 @@ int main(int argc, char **argv)
|
||||
if (ucs_connection->GetUUID() == connection->GetUUID()) {
|
||||
LogInfo("Removing currently active UCS connection");
|
||||
UCSConnection::Instance()->SetConnection(nullptr);
|
||||
zoneserver_list.UpdateUCSServerAvailable(false);
|
||||
ZSList::Instance()->UpdateUCSServerAvailable(false);
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -346,10 +345,10 @@ int main(int argc, char **argv)
|
||||
//register all the patches we have avaliable with the stream identifier.
|
||||
EQStreamIdentifier stream_identifier;
|
||||
RegisterAllPatches(stream_identifier);
|
||||
zoneserver_list.shutdowntimer = new Timer(60000);
|
||||
zoneserver_list.shutdowntimer->Disable();
|
||||
zoneserver_list.reminder = new Timer(20000);
|
||||
zoneserver_list.reminder->Disable();
|
||||
ZSList::Instance()->shutdowntimer = new Timer(60000);
|
||||
ZSList::Instance()->shutdowntimer->Disable();
|
||||
ZSList::Instance()->reminder = new Timer(20000);
|
||||
ZSList::Instance()->reminder->Disable();
|
||||
Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect
|
||||
InterserverTimer.Trigger();
|
||||
uint8 ReconnectCounter = 100;
|
||||
@@ -414,7 +413,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
WorldEventScheduler::Instance()->Process(&zoneserver_list);
|
||||
WorldEventScheduler::Instance()->Process(ZSList::Instance());
|
||||
|
||||
client_list.Process();
|
||||
guild_mgr.Process();
|
||||
@@ -427,7 +426,7 @@ int main(int argc, char **argv)
|
||||
);
|
||||
|
||||
auto out = std::make_unique<ServerPacket>(ServerOP_ParcelPrune);
|
||||
zoneserver_list.SendPacketToBootedZones(out.get());
|
||||
ZSList::Instance()->SendPacketToBootedZones(out.get());
|
||||
|
||||
database.PurgeCharacterParcels();
|
||||
}
|
||||
@@ -442,7 +441,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (EQTimeTimer.Check()) {
|
||||
TimeOfDay_Struct tod{};
|
||||
zoneserver_list.worldclock.GetCurrentEQTimeOfDay(time(nullptr), &tod);
|
||||
ZSList::Instance()->worldclock.GetCurrentEQTimeOfDay(time(nullptr), &tod);
|
||||
if (!database.SaveTime(tod.minute, tod.hour, tod.day, tod.month, tod.year)) {
|
||||
LogEqTime("Failed to save eqtime");
|
||||
}
|
||||
@@ -457,7 +456,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
zoneserver_list.Process();
|
||||
ZSList::Instance()->Process();
|
||||
launcher_list.Process();
|
||||
LFPGroupList.Process();
|
||||
AdventureManager::Instance()->Process();
|
||||
@@ -491,7 +490,7 @@ int main(int argc, char **argv)
|
||||
|
||||
LogInfo("World main loop completed");
|
||||
LogInfo("Shutting down zone connections (if any)");
|
||||
zoneserver_list.KillAll();
|
||||
ZSList::Instance()->KillAll();
|
||||
LogInfo("Zone (TCP) listener stopped");
|
||||
LogInfo("Signaling HTTP service to stop");
|
||||
EQEmuLogSys::Instance()->CloseFileLogs();
|
||||
|
||||
Reference in New Issue
Block a user