mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[7393] Implement access to client side holiday ids.
* 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.
This commit is contained in:
parent
4523a47155
commit
be74937146
19 changed files with 162 additions and 62 deletions
|
|
@ -31,7 +31,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"
|
||||
|
|
@ -162,7 +162,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);
|
||||
|
|
@ -185,7 +185,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)
|
||||
{
|
||||
|
|
@ -3617,8 +3617,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 )
|
||||
{
|
||||
|
|
@ -3651,12 +3651,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 = GetMangosString(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];
|
||||
|
|
@ -3687,7 +3687,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())
|
||||
{
|
||||
|
|
@ -3704,7 +3704,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 ? GetMangosString(LANG_ACTIVE) : "";
|
||||
|
||||
|
|
@ -3736,7 +3736,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())
|
||||
{
|
||||
|
|
@ -3753,7 +3753,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);
|
||||
|
|
@ -3777,7 +3777,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())
|
||||
{
|
||||
|
|
@ -3794,7 +3794,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())
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue