TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
BGQueueRemoveEvent Class Reference

#include <BattlegroundQueue.h>

Public Member Functions

 BGQueueRemoveEvent (ObjectGuid pl_guid, uint32 bgInstanceGUID, BattlegroundTypeId BgTypeId, uint8 arenaType, BattlegroundQueueTypeId bgQueueTypeId, uint32 removeTime)
 
virtual ~BGQueueRemoveEvent ()
 
virtual bool Execute (uint64 e_time, uint32 p_time) override
 
virtual void Abort (uint64 e_time) override
 
- Public Member Functions inherited from BasicEvent
 BasicEvent ()
 
virtual ~BasicEvent ()
 
virtual bool IsDeletable () const
 

Private Attributes

ObjectGuid m_PlayerGuid
 
uint32 m_BgInstanceGUID
 
uint8 m_ArenaType
 
uint32 m_RemoveTime
 
BattlegroundTypeId m_BgTypeId
 
BattlegroundQueueTypeId m_BgQueueTypeId
 

Additional Inherited Members

- Public Attributes inherited from BasicEvent
bool to_Abort
 
uint64 m_addTime
 
uint64 m_execTime
 

Constructor & Destructor Documentation

BGQueueRemoveEvent::BGQueueRemoveEvent ( ObjectGuid  pl_guid,
uint32  bgInstanceGUID,
BattlegroundTypeId  BgTypeId,
uint8  arenaType,
BattlegroundQueueTypeId  bgQueueTypeId,
uint32  removeTime 
)
inline
172  : m_PlayerGuid(pl_guid), m_BgInstanceGUID(bgInstanceGUID), m_ArenaType(arenaType), m_RemoveTime(removeTime), m_BgTypeId(BgTypeId), m_BgQueueTypeId(bgQueueTypeId)
173  { }
uint32 m_BgInstanceGUID
Definition: BattlegroundQueue.h:181
uint32 m_RemoveTime
Definition: BattlegroundQueue.h:183
ObjectGuid m_PlayerGuid
Definition: BattlegroundQueue.h:180
uint8 m_ArenaType
Definition: BattlegroundQueue.h:182
BattlegroundQueueTypeId m_BgQueueTypeId
Definition: BattlegroundQueue.h:185
BattlegroundTypeId m_BgTypeId
Definition: BattlegroundQueue.h:184
virtual BGQueueRemoveEvent::~BGQueueRemoveEvent ( )
inlinevirtual
175 { }

Member Function Documentation

void BGQueueRemoveEvent::Abort ( uint64  e_time)
overridevirtual

Reimplemented from BasicEvent.

1089 {
1090  //do nothing
1091 }
bool BGQueueRemoveEvent::Execute ( uint64  e_time,
uint32  p_time 
)
overridevirtual

Reimplemented from BasicEvent.

1053 {
1055  if (!player)
1056  // player logged off (we should do nothing, he is correctly removed from queue in another procedure)
1057  return true;
1058 
1059  Battleground* bg = sBattlegroundMgr->GetBattleground(m_BgInstanceGUID, m_BgTypeId);
1060  //battleground can be deleted already when we are removing queue info
1061  //bg pointer can be NULL! so use it carefully!
1062 
1063  uint32 queueSlot = player->GetBattlegroundQueueIndex(m_BgQueueTypeId);
1064  if (queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES) // player is in queue, or in Battleground
1065  {
1066  // check if player is in queue for this BG and if we are removing his invite event
1067  BattlegroundQueue &bgQueue = sBattlegroundMgr->GetBattlegroundQueue(m_BgQueueTypeId);
1069  {
1070  TC_LOG_DEBUG("bg.battleground", "Battleground: removing %s from bg queue for instance %u because of not pressing enter battle in time.", player->GetGUID().ToString().c_str(), m_BgInstanceGUID);
1071 
1072  player->RemoveBattlegroundQueueId(m_BgQueueTypeId);
1073  bgQueue.RemovePlayer(m_PlayerGuid, true);
1074  //update queues if battleground isn't ended
1075  if (bg && bg->isBattleground() && bg->GetStatus() != STATUS_WAIT_LEAVE)
1076  sBattlegroundMgr->ScheduleQueueUpdate(0, 0, m_BgQueueTypeId, m_BgTypeId, bg->GetBracketId());
1077 
1079  sBattlegroundMgr->BuildBattlegroundStatusNone(&battlefieldStatus, player, queueSlot, player->GetBattlegroundQueueJoinTime(m_BgQueueTypeId), m_ArenaType);
1080  player->SendDirectMessage(battlefieldStatus.Write());
1081  }
1082  }
1083 
1084  //event will be deleted
1085  return true;
1086 }
Definition: BattlegroundPackets.h:147
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:150
uint32 m_BgInstanceGUID
Definition: BattlegroundQueue.h:181
BattlegroundStatus GetStatus() const
Definition: Battleground.h:266
#define PLAYER_MAX_BATTLEGROUND_QUEUES
Definition: SharedDefines.h:209
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
bool IsPlayerInvited(ObjectGuid pl_guid, const uint32 bgInstanceGuid, const uint32 removeTime)
Definition: BattlegroundQueue.cpp:406
uint32 m_RemoveTime
Definition: BattlegroundQueue.h:183
void RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount)
Definition: BattlegroundQueue.cpp:283
uint32_t uint32
Definition: Define.h:150
bool isBattleground() const
Definition: Battleground.h:327
ObjectGuid m_PlayerGuid
Definition: BattlegroundQueue.h:180
BattlegroundBracketId GetBracketId() const
Definition: Battleground.h:264
uint8 m_ArenaType
Definition: BattlegroundQueue.h:182
Definition: BattlegroundQueue.h:75
BattlegroundQueueTypeId m_BgQueueTypeId
Definition: BattlegroundQueue.h:185
Definition: Battleground.h:160
#define sBattlegroundMgr
Definition: BattlegroundMgr.h:181
BattlegroundTypeId m_BgTypeId
Definition: BattlegroundQueue.h:184
Definition: Battleground.h:235
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:215

+ Here is the call graph for this function:

Member Data Documentation

uint8 BGQueueRemoveEvent::m_ArenaType
private
uint32 BGQueueRemoveEvent::m_BgInstanceGUID
private
BattlegroundQueueTypeId BGQueueRemoveEvent::m_BgQueueTypeId
private
BattlegroundTypeId BGQueueRemoveEvent::m_BgTypeId
private
ObjectGuid BGQueueRemoveEvent::m_PlayerGuid
private
uint32 BGQueueRemoveEvent::m_RemoveTime
private

The documentation for this class was generated from the following files: