mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +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:
@@ -28,7 +28,6 @@ Database database;
|
||||
std::string WorldShortName;
|
||||
const queryservconfig *Config;
|
||||
WorldServer *worldserver = 0;
|
||||
ZSList zs_list;
|
||||
uint32 numzones = 0;
|
||||
|
||||
void CatchSignal(int sig_num)
|
||||
@@ -122,7 +121,7 @@ int main()
|
||||
server_connection->OnConnectionIdentified(
|
||||
"Zone", [&console](std::shared_ptr<EQ::Net::ServertalkServerConnection> connection) {
|
||||
numzones++;
|
||||
zs_list.Add(new ZoneServer(connection, console.get()));
|
||||
ZSList::Instance()->Add(new ZoneServer(connection, console.get()));
|
||||
|
||||
LogInfo(
|
||||
"New Zone Server connection from [{}] at [{}:{}] zone_count [{}]",
|
||||
@@ -137,7 +136,7 @@ int main()
|
||||
server_connection->OnConnectionRemoved(
|
||||
"Zone", [](std::shared_ptr<EQ::Net::ServertalkServerConnection> connection) {
|
||||
numzones--;
|
||||
zs_list.Remove(connection->GetUUID());
|
||||
ZSList::Instance()->Remove(connection->GetUUID());
|
||||
|
||||
LogInfo(
|
||||
"Removed Zone Server connection from [{}] total zone_count [{}]",
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
extern WorldServer worldserver;
|
||||
extern const queryservconfig *Config;
|
||||
extern QSDatabase qs_database;
|
||||
extern ZSList zs_list;
|
||||
|
||||
WorldServer::WorldServer()
|
||||
{
|
||||
@@ -80,7 +79,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
if (o->type == ServerReload::Type::Logs) {
|
||||
EQEmuLogSys::Instance()->LoadLogDatabaseSettings();
|
||||
PlayerEventLogs::Instance()->ReloadSettings();
|
||||
zs_list.SendPlayerEventLogSettings();
|
||||
ZSList::Instance()->SendPlayerEventLogSettings();
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <list>
|
||||
#include "zoneserver.h"
|
||||
|
||||
class WorldTCPConnection;
|
||||
class ZoneServer;
|
||||
|
||||
class ZSList {
|
||||
public:
|
||||
@@ -17,6 +17,12 @@ public:
|
||||
void Remove(const std::string& uuid);
|
||||
void SendPlayerEventLogSettings();
|
||||
|
||||
static ZSList* Instance()
|
||||
{
|
||||
static ZSList instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
private:
|
||||
std::list<std::unique_ptr<ZoneServer>> zone_server_list;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user