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.

1322{
1323 //do nothing
1324}

◆ Execute()

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

Reimplemented from BasicEvent.

1289{
1291
1292 // player logged off, so he is no longer in queue
1293 if (!player)
1294 return true;
1295
1297
1298 // if battleground ended, do nothing
1299 if (!bg)
1300 return true;
1301
1302 // check if still in queue for this battleground
1304 uint32 queueSlot = player->GetBattlegroundQueueIndex(bgQueueTypeId);
1305 if (queueSlot < PLAYER_MAX_BATTLEGROUND_QUEUES)
1306 {
1307 // confirm the player is invited to this instance id (he didn't requeue in the meanwhile)
1308 BattlegroundQueue& bgQueue = sBattlegroundMgr->GetBattlegroundQueue(bgQueueTypeId);
1310 {
1311 // send remaining time in queue
1312 WorldPacket data;
1313 sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME - INVITATION_REMIND_TIME, 0, m_ArenaType, TEAM_NEUTRAL, bg->isRated(), m_BgTypeId);
1314 player->GetSession()->SendPacket(&data);
1315 }
1316 }
1317
1318 return true;
1319}
std::uint32_t uint32
Definition: Define.h:107
@ INVITE_ACCEPT_WAIT_TIME
Definition: Battleground.h:160
@ INVITATION_REMIND_TIME
Definition: Battleground.h:159
@ STATUS_WAIT_JOIN
Definition: Battleground.h:196
#define sBattlegroundMgr
Definition: BattlegroundMgr.h:188
BattlegroundQueueTypeId
Definition: SharedDefines.h:3619
@ TEAM_NEUTRAL
Definition: SharedDefines.h:762
#define PLAYER_MAX_BATTLEGROUND_QUEUES
Definition: SharedDefines.h:176
Player * FindConnectedPlayer(ObjectGuid const guid)
Definition: ObjectAccessor.cpp:260
Definition: Battleground.h:298
bool isRated() const
Definition: Battleground.h:398
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:377
Definition: Player.h:1064
WorldSession * GetSession() const
Definition: Player.h:1978
uint32 GetBattlegroundQueueIndex(BattlegroundQueueTypeId bgQueueTypeId) const
Definition: Player.cpp:12217
Definition: WorldPacket.h:27
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