mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Code] WorldEventScheduler and ZoneEventScheduler Global to Singleton Cleanup (#4932)
This commit is contained in:
+3
-5
@@ -88,7 +88,6 @@ extern volatile bool is_zone_loaded;
|
||||
#include "../common/path_manager.h"
|
||||
#include "../common/database/database_update.h"
|
||||
#include "../common/skill_caps.h"
|
||||
#include "zone_event_scheduler.h"
|
||||
#include "zone_cli.h"
|
||||
|
||||
EntityList entity_list;
|
||||
@@ -102,7 +101,6 @@ TitleManager title_manager;
|
||||
QueryServ *QServ = 0;
|
||||
NpcScaleManager *npc_scale_manager;
|
||||
QuestParserCollection *parse = 0;
|
||||
ZoneEventScheduler event_scheduler;
|
||||
WorldContentService content_service;
|
||||
PlayerEventLogs player_event_logs;
|
||||
|
||||
@@ -416,7 +414,7 @@ int main(int argc, char **argv)
|
||||
->SetExpansionContext()
|
||||
->ReloadContentFlags();
|
||||
|
||||
event_scheduler.SetDatabase(&database)->LoadScheduledEvents();
|
||||
ZoneEventScheduler::Instance()->SetDatabase(&database)->LoadScheduledEvents();
|
||||
|
||||
EQ::SayLinkEngine::LoadCachedSaylinks();
|
||||
|
||||
@@ -482,7 +480,7 @@ int main(int argc, char **argv)
|
||||
QServ->CheckForConnectState();
|
||||
|
||||
worldserver.Connect();
|
||||
worldserver.SetScheduler(&event_scheduler);
|
||||
worldserver.SetScheduler(ZoneEventScheduler::Instance());
|
||||
|
||||
// sidecar command handler
|
||||
if (ZoneCLI::RanConsoleCommand(argc, argv)
|
||||
@@ -626,7 +624,7 @@ int main(int argc, char **argv)
|
||||
entity_list.MobProcess();
|
||||
entity_list.BeaconProcess();
|
||||
entity_list.EncounterProcess();
|
||||
event_scheduler.Process(zone, &content_service);
|
||||
ZoneEventScheduler::Instance()->Process(zone, &content_service);
|
||||
|
||||
if (zone) {
|
||||
if (!zone->Process()) {
|
||||
|
||||
@@ -9,6 +9,12 @@ class ZoneEventScheduler : public ServerEventScheduler {
|
||||
public:
|
||||
void Process(Zone *zone, WorldContentService *content_service);
|
||||
void SyncEventDataWithActiveEvents();
|
||||
|
||||
static ZoneEventScheduler* Instance()
|
||||
{
|
||||
static ZoneEventScheduler instance;
|
||||
return &instance;
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_ZONE_EVENT_SCHEDULER_H
|
||||
|
||||
Reference in New Issue
Block a user