aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/GameEventMgr.cpp18
-rw-r--r--src/game/GameEventMgr.h1
-rw-r--r--src/game/World.cpp3
3 files changed, 22 insertions, 0 deletions
diff --git a/src/game/GameEventMgr.cpp b/src/game/GameEventMgr.cpp
index e66c1a6e27d..965651ae2f6 100644
--- a/src/game/GameEventMgr.cpp
+++ b/src/game/GameEventMgr.cpp
@@ -1068,6 +1068,24 @@ uint32 GameEventMgr::Initialize() // return the next e
return delay;
}
+void GameEventMgr::StartArenaSeason()
+{
+ QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT event FROM season_linked_event WHERE season = '%i'",sWorld.getConfig(CONFIG_ARENA_SEASON_ID));
+
+ if (!result)
+ {
+ sLog.outError("ArenaSeason (%i) must be an existant Arena Season",sWorld.getConfig(CONFIG_ARENA_SEASON_ID));
+ return;
+ }
+
+ Field *fields = result->Fetch();
+
+ uint16 eventId = fields[0].GetUInt16();
+
+ StartEvent(eventId,true);
+ sLog.outString("Arena Season %i started...",sWorld.getConfig(CONFIG_ARENA_SEASON_ID));
+}
+
uint32 GameEventMgr::Update() // return the next event delay in ms
{
time_t currenttime = time(NULL);
diff --git a/src/game/GameEventMgr.h b/src/game/GameEventMgr.h
index a1b65596ecd..7c673c92e66 100644
--- a/src/game/GameEventMgr.h
+++ b/src/game/GameEventMgr.h
@@ -105,6 +105,7 @@ class GameEventMgr
uint32 Update();
bool IsActiveEvent(uint16 event_id) { return (m_ActiveEvents.find(event_id) != m_ActiveEvents.end()); }
uint32 Initialize();
+ void StartArenaSeason();
void StartInternalEvent(uint16 event_id);
bool StartEvent(uint16 event_id, bool overwrite = false);
void StopEvent(uint16 event_id, bool overwrite = false);
diff --git a/src/game/World.cpp b/src/game/World.cpp
index b231558d62a..aa290b7e061 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -1656,6 +1656,9 @@ void World::SetInitialWorldSettings()
uint32 nextGameEvent = gameeventmgr.Initialize();
m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event
+ sLog.outString("Starting Arena Season...");
+ gameeventmgr.StartArenaSeason();
+
sLog.outString("Loading World States..."); // must be loaded before battleground and outdoor PvP
LoadWorldStates();