AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "BattlegroundQueue.h"
Classes | |
class | SelectionPool |
Public Types | |
typedef std::map< ObjectGuid, GroupQueueInfo * > | QueuedPlayersMap |
typedef std::list< GroupQueueInfo * > | GroupsQueueType |
Public Attributes | |
QueuedPlayersMap | m_QueuedPlayers |
GroupsQueueType | m_QueuedGroups [MAX_BATTLEGROUND_BRACKETS][BG_QUEUE_MAX] |
SelectionPool | m_SelectionPools [PVP_TEAMS_COUNT] |
typedef std::list<GroupQueueInfo*> BattlegroundQueue::GroupsQueueType |
typedef std::map<ObjectGuid, GroupQueueInfo*> BattlegroundQueue::QueuedPlayersMap |
BattlegroundQueue::BattlegroundQueue | ( | ) |
References _queueAnnouncementCrossfactioned, _queueAnnouncementTimer, COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME, m_WaitTimeLastIndex, m_WaitTimes, MAX_BATTLEGROUND_BRACKETS, and PVP_TEAMS_COUNT.
BattlegroundQueue::~BattlegroundQueue | ( | ) |
References EventProcessor::KillAllEvents(), m_events, m_QueuedGroups, and m_QueuedPlayers.
void BattlegroundQueue::AddEvent | ( | BasicEvent * | Event, |
uint64 | e_time | ||
) |
References EventProcessor::AddEvent(), EventProcessor::CalculateTime(), and m_events.
Referenced by InviteGroupToBG().
GroupQueueInfo * BattlegroundQueue::AddGroup | ( | Player * | leader, |
Group * | group, | ||
BattlegroundTypeId | bgTypeId, | ||
PvPDifficultyEntry const * | bracketEntry, | ||
uint8 | arenaType, | ||
bool | isRated, | ||
bool | isPremade, | ||
uint32 | arenaRating, | ||
uint32 | matchmakerRating, | ||
uint32 | arenaTeamId = 0 , |
||
uint32 | opponentsArenaTeamId = 0 |
||
) |
References ASSERT, GroupQueueInfo::BgTypeId, CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE, Group::DoForAllMembers(), PvPDifficultyEntry::GetBracketId(), GameTime::GetGameTimeMS(), Object::GetGUID(), Player::GetTeamId(), LOG_DEBUG, m_QueuedGroups, m_QueuedPlayers, PVP_TEAMS_COUNT, sBattlegroundMgr, SendJoinMessageArenaQueue(), SendMessageBGQueue(), sScriptMgr, sWorld, and TEAM_HORDE.
Referenced by CheckNormalMatch(), WorldSession::HandleBattlemasterJoinArena(), and WorldSession::HandleBattlemasterJoinOpcode().
void BattlegroundQueue::BattlegroundQueueAnnouncerUpdate | ( | uint32 | diff, |
BattlegroundQueueTypeId | bgQueueTypeId, | ||
BattlegroundBracketId | bracket_id | ||
) |
References _queueAnnouncementCrossfactioned, _queueAnnouncementTimer, ANNOUNCER_FLAG_DISABLE_BG_QUEUE, BG_QUEUE_CFBG, BG_QUEUE_NORMAL_ALLIANCE, BG_QUEUE_NORMAL_HORDE, BattlegroundMgr::BGTemplateId(), CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_TIMED, GetBattlegroundBracketById(), Battleground::GetMapId(), GetMinPlayersPerTeam(), Battleground::GetName(), GetPlayersCountInGroupsQueue(), LANG_BG_QUEUE_ANNOUNCE_WORLD, PvPDifficultyEntry::maxLevel, PvPDifficultyEntry::minLevel, sBattlegroundMgr, ChatHandler::SendWorldTextOptional(), and sWorld.
Referenced by BattlegroundMgr::Update().
void BattlegroundQueue::BattlegroundQueueUpdate | ( | uint32 | diff, |
BattlegroundTypeId | bgTypeId, | ||
BattlegroundBracketId | bracket_id, | ||
uint8 | arenaType, | ||
bool | isRated, | ||
uint32 | arenaRating | ||
) |
References GroupQueueInfo::ArenaMatchmakerRating, GroupQueueInfo::ArenaTeamId, GroupQueueInfo::ArenaTeamRating, BATTLEGROUND_RB, BG_QUEUE_NORMAL_ALLIANCE, BG_QUEUE_PREMADE_ALLIANCE, BG_QUEUE_PREMADE_HORDE, CheckNormalMatch(), CheckPremadeMatch(), CheckSkirmishForSameFaction(), CONFIG_ARENA_PREV_OPPONENTS_DISCARD_TIMER, FillPlayersToBG(), GetBattlegroundBracketById(), Battleground::GetBgTypeID(), Battleground::GetBracketId(), GameTime::GetGameTimeMS(), Battleground::GetMapId(), Battleground::GetMaxPlayersPerTeam(), GetMinPlayersPerTeam(), Battleground::GetStatus(), GroupQueueInfo::GroupType, Battleground::HasFreeSlots(), BattlegroundQueue::SelectionPool::Init(), InviteGroupToBG(), IsAllQueuesEmpty(), Battleground::isArena(), Battleground::isBattleground(), Battleground::isRated(), GroupQueueInfo::JoinTime, LOG_DEBUG, LOG_ERROR, m_QueuedGroups, m_SelectionPools, GroupQueueInfo::OpponentsMatchmakerRating, GroupQueueInfo::OpponentsTeamRating, PVP_TEAMS_COUNT, Battleground::RemoveFromBGFreeSlotQueue(), sBattlegroundMgr, Battleground::SetArenaMatchmakerRating(), sScriptMgr, Battleground::StartBattleground(), STATUS_WAIT_LEAVE, STATUS_WAIT_QUEUE, sWorld, TEAM_ALLIANCE, TEAM_HORDE, and GroupQueueInfo::teamId.
Referenced by BattlegroundMgr::Update().
bool BattlegroundQueue::CheckNormalMatch | ( | Battleground * | bgTemplate, |
BattlegroundBracketId | bracket_id, | ||
uint32 | minPlayers, | ||
uint32 | maxPlayers | ||
) |
References BattlegroundQueue::SelectionPool::AddGroup(), AddGroup(), BG_QUEUE_INVITATION_TYPE_NO_BALANCE, BG_QUEUE_NORMAL_ALLIANCE, CONFIG_BATTLEGROUND_INVITATION_TYPE, BattlegroundQueue::SelectionPool::GetPlayerCount(), Battleground::isBattleground(), m_QueuedGroups, m_SelectionPools, PVP_TEAMS_COUNT, sBattlegroundMgr, sScriptMgr, sWorld, TEAM_ALLIANCE, and TEAM_HORDE.
Referenced by BattlegroundQueueUpdate().
bool BattlegroundQueue::CheckPremadeMatch | ( | BattlegroundBracketId | bracket_id, |
uint32 | MinPlayersPerTeam, | ||
uint32 | MaxPlayersPerTeam | ||
) |
References BattlegroundQueue::SelectionPool::AddGroup(), BG_QUEUE_NORMAL_ALLIANCE, BG_QUEUE_PREMADE_ALLIANCE, BG_QUEUE_PREMADE_HORDE, CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH, GameTime::GetGameTimeMS(), m_QueuedGroups, m_SelectionPools, PVP_TEAMS_COUNT, sWorld, TEAM_ALLIANCE, and TEAM_HORDE.
Referenced by BattlegroundQueueUpdate().
bool BattlegroundQueue::CheckSkirmishForSameFaction | ( | BattlegroundBracketId | bracket_id, |
uint32 | minPlayersPerTeam | ||
) |
References BattlegroundQueue::SelectionPool::AddGroup(), BG_QUEUE_NORMAL_ALLIANCE, BattlegroundQueue::SelectionPool::Init(), m_QueuedGroups, m_SelectionPools, BattlegroundQueue::SelectionPool::SelectedGroups, TEAM_ALLIANCE, and TEAM_HORDE.
Referenced by BattlegroundQueueUpdate().
void BattlegroundQueue::FillPlayersToBG | ( | Battleground * | bg, |
BattlegroundBracketId | bracket_id | ||
) |
References BattlegroundQueue::SelectionPool::AddGroup(), BG_QUEUE_INVITATION_TYPE_EVEN, BG_QUEUE_INVITATION_TYPE_NO_BALANCE, BG_QUEUE_NORMAL_ALLIANCE, BG_QUEUE_NORMAL_HORDE, CONFIG_BATTLEGROUND_INVITATION_TYPE, Battleground::GetFreeSlotsForTeam(), BattlegroundQueue::SelectionPool::KickGroup(), m_QueuedGroups, m_SelectionPools, sScriptMgr, sWorld, TEAM_ALLIANCE, and TEAM_HORDE.
Referenced by BattlegroundQueueUpdate().
uint32 BattlegroundQueue::GetAverageQueueWaitTime | ( | GroupQueueInfo * | ginfo | ) | const |
References GroupQueueInfo::ArenaType, GroupQueueInfo::BracketId, COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME, GroupQueueInfo::IsRated, m_WaitTimes, TEAM_ALLIANCE, TEAM_HORDE, TEAM_NEUTRAL, and GroupQueueInfo::teamId.
Referenced by WorldSession::HandleBattlefieldStatusOpcode(), WorldSession::HandleBattlemasterJoinArena(), and WorldSession::HandleBattlemasterJoinOpcode().
bool BattlegroundQueue::GetPlayerGroupInfoData | ( | ObjectGuid | guid, |
GroupQueueInfo * | ginfo | ||
) |
References m_QueuedPlayers.
Referenced by Group::CanJoinBattlegroundQueue(), ArenaTeam::DelMember(), WorldSession::HandleArenaTeamDisbandOpcode(), WorldSession::HandleArenaTeamLeaveOpcode(), WorldSession::HandleArenaTeamRemoveOpcode(), WorldSession::HandleBattleFieldPortOpcode(), and WorldSession::HandleBattlefieldStatusOpcode().
uint32 BattlegroundQueue::GetPlayersCountInGroupsQueue | ( | BattlegroundBracketId | bracketId, |
BattlegroundQueueGroupTypes | bgqueue | ||
) |
References m_QueuedGroups.
Referenced by BattlegroundQueueAnnouncerUpdate(), SendJoinMessageArenaQueue(), and SendMessageBGQueue().
References _queueAnnouncementTimer.
void BattlegroundQueue::InviteGroupToBG | ( | GroupQueueInfo * | ginfo, |
Battleground * | bg, | ||
TeamId | teamId | ||
) |
References AddEvent(), Battleground::ArenaLogEntries, GroupQueueInfo::ArenaTeamId, GroupQueueInfo::ArenaType, ASSERT, BattlegroundMgr::BGQueueTypeId(), GroupQueueInfo::BgTypeId, ObjectAccessor::FindConnectedPlayer(), WorldSession::GetAccountId(), Player::GetBattlegroundQueueIndex(), Battleground::GetBgTypeID(), ObjectGuid::GetCounter(), GameTime::GetGameTimeMS(), Object::GetGUID(), Battleground::GetInstanceID(), WorldObject::GetName(), WorldSession::GetRemoteAddress(), Player::GetSession(), Battleground::IncreaseInvitedCount(), INVITATION_REMIND_TIME, INVITE_ACCEPT_WAIT_TIME, Battleground::isArena(), GroupQueueInfo::IsInvitedToBGInstanceGUID, Battleground::isRated(), LOG_DEBUG, PLAYER_MAX_BATTLEGROUND_QUEUES, PlayerInvitedToBGUpdateAverageWaitTime(), GroupQueueInfo::Players, GroupQueueInfo::RemoveInviteTime, sBattlegroundMgr, WorldSession::SendPacket(), Battleground::SetArenaTeamIdForTeam(), Player::SetInviteForBattlegroundQueueType(), STATUS_WAIT_JOIN, TEAM_NEUTRAL, GroupQueueInfo::teamId, and ObjectGuid::ToString().
Referenced by BattlegroundQueueUpdate().
bool BattlegroundQueue::IsAllQueuesEmpty | ( | BattlegroundBracketId | bracket_id | ) |
References BG_QUEUE_MAX, and m_QueuedGroups.
Referenced by BattlegroundQueueUpdate().
bool BattlegroundQueue::IsPlayerInvited | ( | ObjectGuid | pl_guid, |
uint32 | bgInstanceGuid, | ||
uint32 | removeTime | ||
) |
References m_QueuedPlayers.
Referenced by BGQueueInviteEvent::Execute(), and BGQueueRemoveEvent::Execute().
bool BattlegroundQueue::IsPlayerInvitedToRatedArena | ( | ObjectGuid | pl_guid | ) |
References m_QueuedPlayers.
Referenced by WorldSession::HandleBattlemasterJoinArena().
void BattlegroundQueue::PlayerInvitedToBGUpdateAverageWaitTime | ( | GroupQueueInfo * | ginfo | ) |
References GroupQueueInfo::ArenaType, GroupQueueInfo::BracketId, COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME, GameTime::GetGameTimeMS(), getMSTimeDiff(), GroupQueueInfo::IsRated, GroupQueueInfo::JoinTime, m_WaitTimeLastIndex, m_WaitTimes, TEAM_ALLIANCE, TEAM_HORDE, TEAM_NEUTRAL, and GroupQueueInfo::teamId.
Referenced by InviteGroupToBG().
void BattlegroundQueue::RemovePlayer | ( | ObjectGuid | guid, |
bool | decreaseInvitedCount | ||
) |
References GroupQueueInfo::ArenaTeamId, GroupQueueInfo::ArenaType, ASSERT, BattlegroundMgr::BGQueueTypeId(), GroupQueueInfo::BgTypeId, GroupQueueInfo::BracketId, ObjectAccessor::FindConnectedPlayer(), ObjectAccessor::FindPlayer(), GroupQueueInfo::GroupType, GroupQueueInfo::IsInvitedToBGInstanceGUID, GroupQueueInfo::IsRated, LOG_DEBUG, LOG_ERROR, m_QueuedGroups, m_QueuedPlayers, GroupQueueInfo::OpponentsMatchmakerRating, GroupQueueInfo::OpponentsTeamRating, GroupQueueInfo::Players, RemovePlayer(), sArenaTeamMgr, sBattlegroundMgr, SendExitMessageArenaQueue(), STATUS_NONE, TEAM_NEUTRAL, GroupQueueInfo::teamId, and ObjectGuid::ToString().
Referenced by ArenaTeam::DelMember(), BGQueueRemoveEvent::Execute(), WorldSession::HandleBattleFieldPortOpcode(), and RemovePlayer().
void BattlegroundQueue::SendExitMessageArenaQueue | ( | GroupQueueInfo * | ginfo | ) |
References ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, GroupQueueInfo::ArenaTeamId, GroupQueueInfo::ArenaTeamRating, GroupQueueInfo::ArenaType, CONFIG_ARENA_QUEUE_ANNOUNCER_DETAIL, CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE, ArenaTeam::GetName(), GroupQueueInfo::IsRated, LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT_NAME, LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT_NAME_RATING, LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT_RATING, GroupQueueInfo::Players, sArenaTeamMgr, ChatHandler::SendWorldTextOptional(), sScriptMgr, and sWorld.
Referenced by RemovePlayer().
void BattlegroundQueue::SendJoinMessageArenaQueue | ( | Player * | leader, |
GroupQueueInfo * | ginfo, | ||
PvPDifficultyEntry const * | bracketEntry, | ||
bool | isRated | ||
) |
References ANNOUNCER_FLAG_DISABLE_ARENA_QUEUE, GroupQueueInfo::ArenaTeamId, GroupQueueInfo::ArenaTeamRating, GroupQueueInfo::ArenaType, BG_QUEUE_NORMAL_ALLIANCE, BG_QUEUE_NORMAL_HORDE, GroupQueueInfo::BgTypeId, CONFIG_ARENA_QUEUE_ANNOUNCER_DETAIL, CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE, CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY, PvPDifficultyEntry::GetBracketId(), ArenaTeam::GetName(), Battleground::GetName(), GetPlayersCountInGroupsQueue(), ArenaTeam::GetReqPlayersForType(), Player::GetSession(), Battleground::isArena(), GroupQueueInfo::IsRated, LANG_ARENA_QUEUE_ANNOUNCE_SELF, LANG_ARENA_QUEUE_ANNOUNCE_WORLD, LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN_NAME, LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN_NAME_RATING, LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN_RATING, LOG_DEBUG, LOG_ERROR, PvPDifficultyEntry::maxLevel, PvPDifficultyEntry::minLevel, ChatHandler::PSendSysMessage(), sArenaTeamMgr, sBattlegroundMgr, sBGSpam, ChatHandler::SendWorldTextOptional(), sScriptMgr, Acore::StringFormat(), and sWorld.
Referenced by AddGroup().
void BattlegroundQueue::SendMessageBGQueue | ( | Player * | leader, |
Battleground * | bg, | ||
PvPDifficultyEntry const * | bracketEntry | ||
) |
References _queueAnnouncementTimer, ANNOUNCER_FLAG_DISABLE_BG_QUEUE, BG_QUEUE_NORMAL_ALLIANCE, BG_QUEUE_NORMAL_HORDE, CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY, CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_TIMED, CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_TIMER, PvPDifficultyEntry::GetBracketId(), GetMinPlayersPerTeam(), Battleground::GetName(), GetPlayersCountInGroupsQueue(), Player::GetSession(), Battleground::isArena(), LANG_BG_QUEUE_ANNOUNCE_SELF, LANG_BG_QUEUE_ANNOUNCE_WORLD, LOG_DEBUG, PvPDifficultyEntry::maxLevel, PvPDifficultyEntry::minLevel, ChatHandler::PSendSysMessage(), sBGSpam, ChatHandler::SendWorldTextOptional(), sScriptMgr, and sWorld.
Referenced by AddGroup().
void BattlegroundQueue::SetQueueAnnouncementTimer | ( | uint32 | bracketId, |
int32 | timer, | ||
bool | isCrossFactionBG = true |
||
) |
References _queueAnnouncementCrossfactioned, and _queueAnnouncementTimer.
void BattlegroundQueue::UpdateEvents | ( | uint32 | diff | ) |
References m_events, and EventProcessor::Update().
|
private |
Referenced by BattlegroundQueue(), BattlegroundQueueAnnouncerUpdate(), and SetQueueAnnouncementTimer().
|
private |
|
private |
Referenced by AddEvent(), UpdateEvents(), and ~BattlegroundQueue().
GroupsQueueType BattlegroundQueue::m_QueuedGroups[MAX_BATTLEGROUND_BRACKETS][BG_QUEUE_MAX] |
QueuedPlayersMap BattlegroundQueue::m_QueuedPlayers |
Referenced by AddGroup(), GetPlayerGroupInfoData(), IsPlayerInvited(), IsPlayerInvitedToRatedArena(), RemovePlayer(), and ~BattlegroundQueue().
SelectionPool BattlegroundQueue::m_SelectionPools[PVP_TEAMS_COUNT] |
Referenced by BattlegroundQueueUpdate(), CheckNormalMatch(), CheckPremadeMatch(), CheckSkirmishForSameFaction(), and FillPlayersToBG().
|
private |
Referenced by BattlegroundQueue(), and PlayerInvitedToBGUpdateAverageWaitTime().
|
private |
Referenced by BattlegroundQueue(), GetAverageQueueWaitTime(), and PlayerInvitedToBGUpdateAverageWaitTime().