mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
[7393] Implement access to client side holiday ids. Author: VladimirMangos
* src/game/GameEvent.* renamed to src/game/GameEventMgr.* for consistence
* `game_event` now have new `holiday` field for store client side holiday id associated with game event
* Added new enum HolidayIds with existed at this moment holiday ids.
* New function "bool IsHolidayActive(HolidayIds id)" added accessabel from scripts for active holidays check.
--HG--
branch : trunk
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
#include "MapManager.h"
|
||||
#include "Language.h"
|
||||
#include "World.h"
|
||||
#include "GameEvent.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "PoolHandler.h"
|
||||
#include "AccountMgr.h"
|
||||
@@ -164,7 +164,7 @@ bool ChatHandler::HandleTargetObjectCommand(const char* args)
|
||||
{
|
||||
Player* pl = m_session->GetPlayer();
|
||||
QueryResult *result;
|
||||
GameEvent::ActiveEvents const& activeEventsList = gameeventmgr.GetActiveEventList();
|
||||
GameEventMgr::ActiveEvents const& activeEventsList = gameeventmgr.GetActiveEventList();
|
||||
if(*args)
|
||||
{
|
||||
int32 id = atoi((char*)args);
|
||||
@@ -187,7 +187,7 @@ bool ChatHandler::HandleTargetObjectCommand(const char* args)
|
||||
eventFilter << " AND (event IS NULL ";
|
||||
bool initString = true;
|
||||
|
||||
for (GameEvent::ActiveEvents::const_iterator itr = activeEventsList.begin(); itr != activeEventsList.end(); ++itr)
|
||||
for (GameEventMgr::ActiveEvents::const_iterator itr = activeEventsList.begin(); itr != activeEventsList.end(); ++itr)
|
||||
{
|
||||
if (initString)
|
||||
{
|
||||
@@ -3509,8 +3509,8 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
|
||||
|
||||
uint32 counter = 0;
|
||||
|
||||
GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
GameEvent::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
|
||||
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
|
||||
|
||||
for(uint32 id = 0; id < events.size(); ++id )
|
||||
{
|
||||
@@ -3543,12 +3543,12 @@ bool ChatHandler::HandleEventActiveListCommand(const char* args)
|
||||
{
|
||||
uint32 counter = 0;
|
||||
|
||||
GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
GameEvent::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
|
||||
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
|
||||
|
||||
char const* active = GetTrinityString(LANG_ACTIVE);
|
||||
|
||||
for(GameEvent::ActiveEvents::const_iterator itr = activeEvents.begin(); itr != activeEvents.end(); ++itr )
|
||||
for(GameEventMgr::ActiveEvents::const_iterator itr = activeEvents.begin(); itr != activeEvents.end(); ++itr )
|
||||
{
|
||||
uint32 event_id = *itr;
|
||||
GameEventData const& eventData = events[event_id];
|
||||
@@ -3579,7 +3579,7 @@ bool ChatHandler::HandleEventInfoCommand(const char* args)
|
||||
|
||||
uint32 event_id = atoi(cId);
|
||||
|
||||
GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
|
||||
if(event_id >=events.size())
|
||||
{
|
||||
@@ -3596,7 +3596,7 @@ bool ChatHandler::HandleEventInfoCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
GameEvent::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
|
||||
bool active = activeEvents.find(event_id) != activeEvents.end();
|
||||
char const* activeStr = active ? GetTrinityString(LANG_ACTIVE) : "";
|
||||
|
||||
@@ -3628,7 +3628,7 @@ bool ChatHandler::HandleEventStartCommand(const char* args)
|
||||
|
||||
int32 event_id = atoi(cId);
|
||||
|
||||
GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
|
||||
if(event_id < 1 || event_id >=events.size())
|
||||
{
|
||||
@@ -3645,7 +3645,7 @@ bool ChatHandler::HandleEventStartCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
GameEvent::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
|
||||
if(activeEvents.find(event_id) != activeEvents.end())
|
||||
{
|
||||
PSendSysMessage(LANG_EVENT_ALREADY_ACTIVE,event_id);
|
||||
@@ -3669,7 +3669,7 @@ bool ChatHandler::HandleEventStopCommand(const char* args)
|
||||
|
||||
int32 event_id = atoi(cId);
|
||||
|
||||
GameEvent::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
|
||||
if(event_id < 1 || event_id >=events.size())
|
||||
{
|
||||
@@ -3686,7 +3686,7 @@ bool ChatHandler::HandleEventStopCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
GameEvent::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
|
||||
|
||||
if(activeEvents.find(event_id) == activeEvents.end())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user