mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-06 04:42:28 +00:00
[Code] LFGuildManager Global to Singleton Cleanup
This commit is contained in:
parent
1be7e56b86
commit
2fb73c50df
@ -44,6 +44,11 @@ public:
|
||||
bool LoadDatabase();
|
||||
void HandlePacket(ServerPacket *pack);
|
||||
void ExpireEntries();
|
||||
|
||||
static LFGuildManager* Instance() {
|
||||
static LFGuildManager instance;
|
||||
return &instance;
|
||||
}
|
||||
private:
|
||||
void SendPlayerMatches(uint32 FromZoneID, uint32 FromInstanceID, char *From, uint32 FromLevel, uint32 ToLevel, uint32 MinAA, uint32 TimeZone, uint32 Classes);
|
||||
void SendGuildMatches(uint32 FromZoneID, uint32 FromInstanceID, char *From, uint32 Level, uint32 AAPoints, uint32 TimeZone, uint32 Class);
|
||||
|
||||
@ -26,7 +26,6 @@ volatile bool RunLoops = true;
|
||||
|
||||
QSDatabase qs_database;
|
||||
Database database;
|
||||
LFGuildManager lfguildmanager;
|
||||
std::string WorldShortName;
|
||||
const queryservconfig *Config;
|
||||
WorldServer *worldserver = 0;
|
||||
@ -159,7 +158,7 @@ int main()
|
||||
worldserver->Connect();
|
||||
|
||||
/* Load Looking For Guild Manager */
|
||||
lfguildmanager.LoadDatabase();
|
||||
LFGuildManager::Instance()->LoadDatabase();
|
||||
|
||||
Timer player_event_process_timer(1000);
|
||||
player_event_logs.SetDatabase(&qs_database)->Init();
|
||||
@ -173,7 +172,7 @@ int main()
|
||||
}
|
||||
|
||||
if (LFGuildExpireTimer.Check()) {
|
||||
lfguildmanager.ExpireEntries();
|
||||
LFGuildManager::Instance()->ExpireEntries();
|
||||
}
|
||||
|
||||
if (player_event_process_timer.Check()) {
|
||||
|
||||
@ -24,7 +24,6 @@
|
||||
extern WorldServer worldserver;
|
||||
extern const queryservconfig *Config;
|
||||
extern QSDatabase qs_database;
|
||||
extern LFGuildManager lfguildmanager;
|
||||
|
||||
WorldServer::WorldServer()
|
||||
{
|
||||
@ -112,7 +111,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
pack.pBuffer = (uchar *) p.Data();
|
||||
pack.opcode = opcode;
|
||||
pack.size = (uint32) p.Length();
|
||||
lfguildmanager.HandlePacket(&pack);
|
||||
LFGuildManager::Instance()->HandlePacket(&pack);
|
||||
pack.pBuffer = nullptr;
|
||||
break;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user