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

#include <BattlegroundQueue.h>

Public Member Functions

 BGQueueInviteEvent (ObjectGuid pl_guid, uint32 BgInstanceGUID, BattlegroundTypeId BgTypeId, uint8 arenaType, uint32 removeTime)
 
virtual ~BGQueueInviteEvent ()
 
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
 
BattlegroundTypeId m_BgTypeId
 
uint8 m_ArenaType
 
uint32 m_RemoveTime
 

Additional Inherited Members

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

Constructor & Destructor Documentation

BGQueueInviteEvent::BGQueueInviteEvent ( ObjectGuid  pl_guid,
uint32  BgInstanceGUID,
BattlegroundTypeId  BgTypeId,
uint8  arenaType,
uint32  removeTime 
)
inline
148  :
149  m_PlayerGuid(pl_guid), m_BgInstanceGUID(BgInstanceGUID), m_BgTypeId(BgTypeId), m_ArenaType(arenaType), m_RemoveTime(removeTime)
150  { }
BattlegroundTypeId m_BgTypeId
Definition: BattlegroundQueue.h:158
uint32 m_BgInstanceGUID
Definition: BattlegroundQueue.h:157
ObjectGuid m_PlayerGuid
Definition: BattlegroundQueue.h:156
uint8 m_ArenaType
Definition: BattlegroundQueue.h:159
uint32 m_RemoveTime
Definition: BattlegroundQueue.h:160
virtual BGQueueInviteEvent::~BGQueueInviteEvent ( )
inlinevirtual
151 { }

Member Function Documentation

void BGQueueInviteEvent::Abort ( uint64  e_time)
overridevirtual

Reimplemented from BasicEvent.

1039 {
1040  //do nothing
1041 }
bool BGQueueInviteEvent::Execute ( uint64  e_time,
uint32  p_time 
)
overridevirtual

Reimplemented from BasicEvent.

1011 {
1013  // player logged off (we should do nothing, he is correctly removed from queue in another procedure)
1014  if (!player)
1015  return true;
1016 
1017  Battleground* bg = sBattlegroundMgr->GetBattleground(m_BgInstanceGUID, m_BgTypeId);
1018  //if battleground ended and its instance deleted - do nothing
1019  if (!bg)
1020  return true;
1021 
1023  uint32 queueSlot = player->GetBattlegroundQueueIndex(bgQueueTypeId);
1024  if (queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES) // player is in queue or in battleground
1025  {
1026  // check if player is invited to this bg
1027  BattlegroundQueue &bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId);
1029  {
1031  sBattlegroundMgr->BuildBattlegroundStatusNeedConfirmation(&battlefieldStatus, bg, player, queueSlot, player->GetBattlegroundQueueJoinTime(bgQueueTypeId), INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, m_ArenaType);
1032  player->SendDirectMessage(battlefieldStatus.Write());
1033  }
1034  }
1035  return true; //event will be deleted
1036 }
BattlegroundTypeId m_BgTypeId
Definition: BattlegroundQueue.h:158
Definition: Battleground.h:125
uint32 m_BgInstanceGUID
Definition: BattlegroundQueue.h:157
#define PLAYER_MAX_BATTLEGROUND_QUEUES
Definition: SharedDefines.h:209
WorldPacket const * Write() override
Definition: BattlegroundPackets.cpp:156
static BattlegroundQueueTypeId BGQueueTypeId(BattlegroundTypeId bgTypeId, uint8 arenaType)
Definition: BattlegroundMgr.cpp:623
bool IsPlayerInvited(ObjectGuid pl_guid, const uint32 bgInstanceGuid, const uint32 removeTime)
Definition: BattlegroundQueue.cpp:406
uint8 GetArenaType() const
Definition: Battleground.h:281
ObjectGuid m_PlayerGuid
Definition: BattlegroundQueue.h:156
uint32_t uint32
Definition: Define.h:150
uint8 m_ArenaType
Definition: BattlegroundQueue.h:159
Definition: BattlegroundQueue.h:75
BattlegroundQueueTypeId
Definition: SharedDefines.h:4732
Definition: Battleground.h:124
#define sBattlegroundMgr
Definition: BattlegroundMgr.h:181
BattlegroundTypeId GetTypeID(bool GetRandom=false) const
Definition: Battleground.h:263
Definition: Battleground.h:235
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:215
uint32 m_RemoveTime
Definition: BattlegroundQueue.h:160

+ Here is the call graph for this function:

Member Data Documentation

uint8 BGQueueInviteEvent::m_ArenaType
private
uint32 BGQueueInviteEvent::m_BgInstanceGUID
private
BattlegroundTypeId BGQueueInviteEvent::m_BgTypeId
private
ObjectGuid BGQueueInviteEvent::m_PlayerGuid
private
uint32 BGQueueInviteEvent::m_RemoveTime
private

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