![]() |
TrinityCore
|
#include <BattlegroundQueue.h>
Classes | |
| class | SelectionPool |
Public Types | |
| typedef std::map< ObjectGuid, PlayerQueueInfo > | QueuedPlayersMap |
| typedef std::list< GroupQueueInfo * > | GroupsQueueType |
Public Attributes | |
| QueuedPlayersMap | m_QueuedPlayers |
| GroupsQueueType | m_QueuedGroups [MAX_BATTLEGROUND_BRACKETS][BG_QUEUE_GROUP_TYPES_COUNT] |
| SelectionPool | m_SelectionPools [PVP_TEAMS_COUNT] |
Private Member Functions | |
| bool | InviteGroupToBG (GroupQueueInfo *ginfo, Battleground *bg, Team side) |
Definition at line 68 of file BattlegroundQueue.h.
| typedef std::list<GroupQueueInfo*> BattlegroundQueue::GroupsQueueType |
Definition at line 92 of file BattlegroundQueue.h.
| typedef std::map<ObjectGuid, PlayerQueueInfo> BattlegroundQueue::QueuedPlayersMap |
Definition at line 88 of file BattlegroundQueue.h.
| BattlegroundQueue::BattlegroundQueue | ( | BattlegroundQueueTypeId | queueId | ) |
Definition at line 37 of file BattlegroundQueue.cpp.
References COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME, m_SumOfWaitTimes, m_WaitTimeLastPlayer, m_WaitTimes, MAX_BATTLEGROUND_BRACKETS, and PVP_TEAMS_COUNT.
| BattlegroundQueue::~BattlegroundQueue | ( | ) |
Definition at line 51 of file BattlegroundQueue.cpp.
References BG_QUEUE_GROUP_TYPES_COUNT, EventProcessor::KillAllEvents(), m_events, m_QueuedGroups, and MAX_BATTLEGROUND_BRACKETS.
| GroupQueueInfo * BattlegroundQueue::AddGroup | ( | Player const * | leader, |
| Group const * | group, | ||
| Team | team, | ||
| PVPDifficultyEntry const * | bracketEntry, | ||
| bool | isPremade, | ||
| uint32 | ArenaRating, | ||
| uint32 | MatchmakerRating | ||
| ) |
Definition at line 133 of file BattlegroundQueue.cpp.
References GroupQueueInfo::ArenaMatchmakerRating, GroupQueueInfo::ArenaTeamRating, BattlegroundQueueTypeId::BattlemasterListId, BG_QUEUE_NORMAL_ALLIANCE, BG_QUEUE_NORMAL_HORDE, CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE, CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE, CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY, PVPDifficultyEntry::GetBracketId(), GameTime::GetGameTimeMS(), BaseEntity::GetGUID(), Group::GetMembers(), ArenaTeam::GetName(), Player::GetSession(), ChatHandler::GetSessionDbcLocale(), PlayerQueueInfo::GroupInfo, HORDE, GroupQueueInfo::IsInvitedToBGInstanceGUID, GroupQueueInfo::JoinTime, LANG_ARENA_QUEUE_ANNOUNCE_WORLD_JOIN, LANG_BG_QUEUE_ANNOUNCE_SELF, LANG_BG_QUEUE_ANNOUNCE_WORLD, PlayerQueueInfo::LastOnlineTime, m_QueuedGroups, m_QueuedPlayers, m_queueId, PVPDifficultyEntry::MaxLevel, PVPDifficultyEntry::MinLevel, GroupQueueInfo::OpponentsMatchmakerRating, GroupQueueInfo::OpponentsTeamRating, GroupQueueInfo::Players, ChatHandler::PSendSysMessage(), PVP_TEAMS_COUNT, BattlegroundQueueTypeId::Rated, GroupQueueInfo::RemoveInviteTime, sArenaTeamMgr, sBattlegroundMgr, sWorld, TC_LOG_DEBUG, GroupQueueInfo::Team, and BattlegroundQueueTypeId::TeamSize.
Referenced by CheckNormalMatch(), WorldSession::HandleBattlemasterJoinArena(), and WorldSession::HandleBattlemasterJoinOpcode().
| void BattlegroundQueue::BattlegroundQueueUpdate | ( | uint32 | diff, |
| BattlegroundBracketId | bracket_id, | ||
| uint32 | minRating = 0 |
||
| ) |
Definition at line 761 of file BattlegroundQueue.cpp.
References ALLIANCE, GroupQueueInfo::ArenaMatchmakerRating, GroupQueueInfo::ArenaTeamRating, BattlegroundQueueTypeId::BattlemasterListId, BG_QUEUE_NORMAL_ALLIANCE, BG_QUEUE_NORMAL_HORDE, BG_QUEUE_PREMADE_ALLIANCE, BG_QUEUE_PREMADE_HORDE, CheckNormalMatch(), CheckPremadeMatch(), CheckSkirmishForSameFaction(), FillPlayersToBG(), Battleground::GetBracketId(), GameTime::GetGameTimeMS(), BattlegroundTemplate::GetMaxPlayersPerTeam(), BattlegroundTemplate::GetMinPlayersPerTeam(), Battleground::GetStatus(), Battleground::HasFreeSlots(), HORDE, BattlegroundQueue::SelectionPool::Init(), InviteGroupToBG(), BattlegroundTemplate::IsArena(), Battleground::isRated(), GroupQueueInfo::JoinTime, m_QueuedGroups, m_queueId, m_SelectionPools, BattlegroundTemplate::MapIDs, GroupQueueInfo::OpponentsMatchmakerRating, GroupQueueInfo::OpponentsTeamRating, PVP_TEAMS_COUNT, BattlegroundQueueTypeId::Rated, Battleground::RemoveFromBGFreeSlotQueue(), sBattlegroundMgr, BattlegroundQueue::SelectionPool::SelectedGroups, Battleground::SetArenaMatchmakerRating(), Battleground::StartBattleground(), STATUS_WAIT_LEAVE, STATUS_WAIT_QUEUE, TC_LOG_DEBUG, TC_LOG_ERROR, GroupQueueInfo::Team, TEAM_ALLIANCE, TEAM_HORDE, and BattlegroundQueueTypeId::TeamSize.
Referenced by BattlegroundMgr::Update().
| bool BattlegroundQueue::CheckNormalMatch | ( | BattlegroundBracketId | bracket_id, |
| uint32 | minPlayers, | ||
| uint32 | maxPlayers | ||
| ) |
Definition at line 650 of file BattlegroundQueue.cpp.
References BattlegroundQueue::SelectionPool::AddGroup(), AddGroup(), BG_QUEUE_INVITATION_TYPE_NO_BALANCE, BG_QUEUE_NORMAL_ALLIANCE, CONFIG_BATTLEGROUND_INVITATION_TYPE, BattlegroundQueue::SelectionPool::GetPlayerCount(), m_QueuedGroups, m_SelectionPools, PVP_TEAMS_COUNT, sBattlegroundMgr, sWorld, TEAM_ALLIANCE, and TEAM_HORDE.
Referenced by BattlegroundQueueUpdate().
| bool BattlegroundQueue::CheckPremadeMatch | ( | BattlegroundBracketId | bracket_id, |
| uint32 | MinPlayersPerTeam, | ||
| uint32 | MaxPlayersPerTeam | ||
| ) |
Definition at line 592 of file BattlegroundQueue.cpp.
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 | ||
| ) |
Definition at line 693 of file BattlegroundQueue.cpp.
References BattlegroundQueue::SelectionPool::AddGroup(), ALLIANCE, BG_QUEUE_NORMAL_ALLIANCE, HORDE, 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 | ||
| ) |
Definition at line 487 of file BattlegroundQueue.cpp.
References BattlegroundQueue::SelectionPool::AddGroup(), ALLIANCE, 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(), HORDE, BattlegroundQueue::SelectionPool::KickGroup(), m_QueuedGroups, m_SelectionPools, sWorld, TEAM_ALLIANCE, and TEAM_HORDE.
Referenced by BattlegroundQueueUpdate().
| uint32 BattlegroundQueue::GetAverageQueueWaitTime | ( | GroupQueueInfo * | ginfo, |
| BattlegroundBracketId | bracket_id | ||
| ) | const |
Definition at line 259 of file BattlegroundQueue.cpp.
References COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME, HORDE, m_queueId, m_SumOfWaitTimes, m_WaitTimes, BattlegroundQueueTypeId::Rated, GroupQueueInfo::Team, TEAM_ALLIANCE, TEAM_HORDE, and BattlegroundQueueTypeId::TeamSize.
Referenced by WorldSession::HandleBattlemasterJoinArena(), WorldSession::HandleBattlemasterJoinOpcode(), and WorldSession::HandleRequestBattlefieldStatusOpcode().
| bool BattlegroundQueue::GetPlayerGroupInfoData | ( | ObjectGuid | guid, |
| GroupQueueInfo * | ginfo | ||
| ) |
Definition at line 411 of file BattlegroundQueue.cpp.
References m_QueuedPlayers.
Referenced by WorldSession::HandleBattleFieldPortOpcode(), and WorldSession::HandleRequestBattlefieldStatusOpcode().
Definition at line 420 of file BattlegroundQueue.cpp.
References BattlegroundQueue::SelectionPool::GetPlayerCount(), and m_SelectionPools.
|
inline |
Definition at line 124 of file BattlegroundQueue.h.
Referenced by WorldSession::HandleBattleFieldPortOpcode().
|
private |
Definition at line 425 of file BattlegroundQueue.cpp.
References EventProcessor::AddEvent(), BattlegroundQueueTypeId::BattlemasterListId, BattlegroundMgr::BuildBattlegroundStatusNeedConfirmation(), EventProcessor::CalculateTime(), ObjectAccessor::FindConnectedPlayer(), Player::GetBattlegroundQueueIndex(), Player::GetBattlegroundQueueJoinTime(), Battleground::GetBracketId(), GameTime::GetGameTimeMS(), BaseEntity::GetGUID(), Battleground::GetInstanceID(), WorldObject::GetName(), Battleground::IncreaseInvitedCount(), INVITATION_REMIND_TIME, INVITE_ACCEPT_WAIT_TIME, GroupQueueInfo::IsInvitedToBGInstanceGUID, m_events, m_queueId, PlayerInvitedToBGUpdateAverageWaitTime(), GroupQueueInfo::Players, GroupQueueInfo::RemoveInviteTime, Player::SendDirectMessage(), Player::SetInviteForBattlegroundQueueType(), TC_LOG_DEBUG, GroupQueueInfo::Team, ObjectGuid::ToString(), and WorldPackets::Battleground::BattlefieldStatusNeedConfirmation::Write().
Referenced by BattlegroundQueueUpdate().
| bool BattlegroundQueue::IsPlayerInvited | ( | ObjectGuid | pl_guid, |
| const uint32 | bgInstanceGuid, | ||
| const uint32 | removeTime | ||
| ) |
Definition at line 403 of file BattlegroundQueue.cpp.
References m_QueuedPlayers.
Referenced by BGQueueInviteEvent::Execute(), and BGQueueRemoveEvent::Execute().
| void BattlegroundQueue::PlayerInvitedToBGUpdateAverageWaitTime | ( | GroupQueueInfo * | ginfo, |
| BattlegroundBracketId | bracket_id | ||
| ) |
Definition at line 231 of file BattlegroundQueue.cpp.
References COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME, GameTime::GetGameTimeMS(), getMSTimeDiff(), HORDE, GroupQueueInfo::JoinTime, m_queueId, m_SumOfWaitTimes, m_WaitTimeLastPlayer, m_WaitTimes, BattlegroundQueueTypeId::Rated, GroupQueueInfo::Team, TEAM_ALLIANCE, TEAM_HORDE, and BattlegroundQueueTypeId::TeamSize.
Referenced by InviteGroupToBG().
| void BattlegroundQueue::RemovePlayer | ( | ObjectGuid | guid, |
| bool | decreaseInvitedCount | ||
| ) |
Definition at line 281 of file BattlegroundQueue.cpp.
References GroupQueueInfo::ArenaTeamRating, BattlegroundQueueTypeId::BattlemasterListId, BG_QUEUE_GROUP_TYPES_COUNT, BG_QUEUE_PREMADE_ALLIANCE, BG_QUEUE_PREMADE_HORDE, BattlegroundMgr::BuildBattlegroundStatusNone(), CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE, ObjectAccessor::FindConnectedPlayer(), ObjectAccessor::FindPlayer(), HORDE, GroupQueueInfo::IsInvitedToBGInstanceGUID, LANG_ARENA_QUEUE_ANNOUNCE_WORLD_EXIT, m_QueuedGroups, m_QueuedPlayers, m_queueId, MAX_BATTLEGROUND_BRACKETS, GroupQueueInfo::OpponentsMatchmakerRating, GroupQueueInfo::OpponentsTeamRating, GroupQueueInfo::Players, PVP_TEAMS_COUNT, BattlegroundQueueTypeId::Rated, RemovePlayer(), sArenaTeamMgr, sBattlegroundMgr, sWorld, TC_LOG_DEBUG, TC_LOG_ERROR, GroupQueueInfo::Team, BattlegroundQueueTypeId::TeamSize, ObjectGuid::ToString(), and WorldPackets::Battleground::BattlefieldStatusNone::Write().
Referenced by BGQueueRemoveEvent::Execute(), WorldSession::HandleBattleFieldPortOpcode(), WorldSession::LogoutPlayer(), and RemovePlayer().
| void BattlegroundQueue::UpdateEvents | ( | uint32 | diff | ) |
Definition at line 751 of file BattlegroundQueue.cpp.
References m_events, and EventProcessor::Update().
|
private |
Definition at line 135 of file BattlegroundQueue.h.
Referenced by InviteGroupToBG(), UpdateEvents(), and ~BattlegroundQueue().
| GroupsQueueType BattlegroundQueue::m_QueuedGroups[MAX_BATTLEGROUND_BRACKETS][BG_QUEUE_GROUP_TYPES_COUNT] |
Definition at line 103 of file BattlegroundQueue.h.
Referenced by AddGroup(), BattlegroundQueueUpdate(), CheckNormalMatch(), CheckPremadeMatch(), CheckSkirmishForSameFaction(), FillPlayersToBG(), RemovePlayer(), and ~BattlegroundQueue().
| QueuedPlayersMap BattlegroundQueue::m_QueuedPlayers |
Definition at line 89 of file BattlegroundQueue.h.
Referenced by AddGroup(), GetPlayerGroupInfoData(), IsPlayerInvited(), and RemovePlayer().
|
private |
Definition at line 127 of file BattlegroundQueue.h.
Referenced by AddGroup(), BattlegroundQueueUpdate(), GetAverageQueueWaitTime(), InviteGroupToBG(), PlayerInvitedToBGUpdateAverageWaitTime(), and RemovePlayer().
| SelectionPool BattlegroundQueue::m_SelectionPools[PVP_TEAMS_COUNT] |
Definition at line 121 of file BattlegroundQueue.h.
Referenced by BattlegroundQueueUpdate(), CheckNormalMatch(), CheckPremadeMatch(), CheckSkirmishForSameFaction(), FillPlayersToBG(), and GetPlayersInQueue().
|
private |
Definition at line 132 of file BattlegroundQueue.h.
Referenced by BattlegroundQueue(), GetAverageQueueWaitTime(), and PlayerInvitedToBGUpdateAverageWaitTime().
|
private |
Definition at line 131 of file BattlegroundQueue.h.
Referenced by BattlegroundQueue(), and PlayerInvitedToBGUpdateAverageWaitTime().
|
private |
Definition at line 130 of file BattlegroundQueue.h.
Referenced by BattlegroundQueue(), GetAverageQueueWaitTime(), and PlayerInvitedToBGUpdateAverageWaitTime().