AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
BGQueueInviteEvent Class Reference

#include "BattlegroundQueue.h"

Inheritance diagram for BGQueueInviteEvent:
BasicEvent

Public Member Functions

 BGQueueInviteEvent (ObjectGuid pl_guid, uint32 BgInstanceGUID, BattlegroundTypeId BgTypeId, uint8 arenaType, uint32 removeTime)
 
 ~BGQueueInviteEvent () override=default
 
bool Execute (uint64 e_time, uint32 p_time) override
 
void Abort (uint64 e_time) override
 
- Public Member Functions inherited from BasicEvent
 BasicEvent ()=default
 
virtual ~BasicEvent ()=default
 
virtual bool Execute (uint64, uint32)
 
virtual bool IsDeletable () const
 
virtual void Abort (uint64)
 
void ScheduleAbort ()
 

Private Attributes

ObjectGuid m_PlayerGuid
 
uint32 m_BgInstanceGUID
 
BattlegroundTypeId m_BgTypeId
 
uint8 m_ArenaType
 
uint32 m_RemoveTime
 

Detailed Description

Constructor & Destructor Documentation

◆ BGQueueInviteEvent()

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

◆ ~BGQueueInviteEvent()

BGQueueInviteEvent::~BGQueueInviteEvent ( )
overridedefault

Member Function Documentation

◆ Abort()

void BGQueueInviteEvent::Abort ( uint64  e_time)
overridevirtual

Reimplemented from BasicEvent.

1324{
1325 //do nothing
1326}

◆ Execute()

bool BGQueueInviteEvent::Execute ( uint64  e_time,
uint32  p_time 
)
overridevirtual

Reimplemented from BasicEvent.

1291{
1293
1294 // player logged off, so he is no longer in queue
1295 if (!player)
1296 return true;
1297
1299
1300 // if battleground ended, do nothing
1301 if (!bg)
1302 return true;
1303
1304 // check if still in queue for this battleground
1306 uint32 queueSlot = player->GetBattlegroundQueueIndex(bgQueueTypeId);
1307 if (queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES)
1308 {
1309 // confirm the player is invited to this instance id (he didn't requeue in the meanwhile)
1310 BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId);
1312 {
1313 // send remaining time in queue
1314 WorldPacket data;
1315 sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, 0, m_ArenaType, TEAM_NEUTRAL, bg->isRated(), m_BgTypeId);
1316 player->GetSession()->SendPacket(&data);
1317 }
1318 }
1319
1320 return true;
1321}
std::uint32_t uint32
Definition: Define.h:107
BattlegroundQueueTypeId
Definition: SharedDefines.h:3619
@ TEAM_NEUTRAL
Definition: SharedDefines.h:762
#define PLAYER_MAX_BATTLEGROUND_QUEUES
Definition: SharedDefines.h:176
@ INVITE_ACCEPT_WAIT_TIME
Definition: Battleground.h:165
@ INVITATION_REMIND_TIME
Definition: Battleground.h:164
@ STATUS_WAIT_JOIN
Definition: Battleground.h:201
#define sBattlegroundMgr
Definition: BattlegroundMgr.h:186
Player * FindConnectedPlayer(ObjectGuid const guid)
Definition: ObjectAccessor.cpp:257
Definition: Battleground.h:303
bool isRated() const
Definition: Battleground.h:415
static BattlegroundQueueTypeId BGQueueTypeId(BattlegroundTypeId bgTypeId, uint8 arenaType)
Definition: BattlegroundMgr.cpp:672
Definition: BattlegroundQueue.h:64
bool IsPlayerInvited(ObjectGuid pl_guid, uint32 bgInstanceGuid, uint32 removeTime)
Definition: BattlegroundQueue.cpp:379
Definition: Player.h:1081
WorldSession * GetSession() const
Definition: Player.h:1998
uint32 GetBattlegroundQueueIndex(BattlegroundQueueTypeId bgQueueTypeId) const
Definition: Player.cpp:12253
Definition: WorldPacket.h:26
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
Definition: WorldSession.cpp:214

References BattlegroundMgr::BGQueueTypeId(), ObjectAccessor::FindConnectedPlayer(), Player::GetBattlegroundQueueIndex(), Player::GetSession(), INVITATION_REMIND_TIME, INVITE_ACCEPT_WAIT_TIME, BattlegroundQueue::IsPlayerInvited(), Battleground::isRated(), PLAYER_MAX_BATTLEGROUND_QUEUES, sBattlegroundMgr, WorldSession::SendPacket(), STATUS_WAIT_JOIN, and TEAM_NEUTRAL.

Member Data Documentation

◆ m_ArenaType

uint8 BGQueueInviteEvent::m_ArenaType
private

◆ m_BgInstanceGUID

uint32 BGQueueInviteEvent::m_BgInstanceGUID
private

◆ m_BgTypeId

BattlegroundTypeId BGQueueInviteEvent::m_BgTypeId
private

◆ m_PlayerGuid

ObjectGuid BGQueueInviteEvent::m_PlayerGuid
private

◆ m_RemoveTime

uint32 BGQueueInviteEvent::m_RemoveTime
private