aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Battlegrounds/BattlegroundQueue.cpp
diff options
context:
space:
mode:
authorccrs <ccrs@users.noreply.github.com>2018-10-24 16:45:26 +0200
committerShauren <shauren.trinity@gmail.com>2021-11-15 18:52:02 +0100
commitdf2f6ad219a18576617e4fc3f4cd60b530ac9d9a (patch)
treea2c05b13e32fafd3c801722b5a2b73b16f5fd426 /src/server/game/Battlegrounds/BattlegroundQueue.cpp
parentfea450d9dec7a24e68f823795361cb18c0f4e35c (diff)
Core/Shared: add BattlefieldBattleId definitions
Also rename BG_TEAMS_COUNT and BattlegroundTeamId (cherry picked from commit 7417cbc655bf9c519b11c4821d8f0619851ea9f7)
Diffstat (limited to 'src/server/game/Battlegrounds/BattlegroundQueue.cpp')
-rw-r--r--src/server/game/Battlegrounds/BattlegroundQueue.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
index 90764ae7d43..f25f78e2a36 100644
--- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
@@ -36,7 +36,7 @@
BattlegroundQueue::BattlegroundQueue(BattlegroundQueueTypeId queueId) : m_queueId(queueId)
{
- for (uint32 i = 0; i < BG_TEAMS_COUNT; ++i)
+ for (uint32 i = 0; i < PVP_TEAMS_COUNT; ++i)
{
for (uint32 j = 0; j < MAX_BATTLEGROUND_BRACKETS; ++j)
{
@@ -151,7 +151,7 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* grp, PVPDiffi
//compute index (if group is premade or joined a rated match) to queues
uint32 index = 0;
if (!m_queueId.Rated && !isPremade)
- index += BG_TEAMS_COUNT;
+ index += PVP_TEAMS_COUNT;
if (ginfo->Team == HORDE)
index++;
TC_LOG_DEBUG("bg.battleground", "Adding Group to BattlegroundQueue bgTypeId : %u, bracket_id : %u, index : %u", m_queueId.BattlemasterListId, bracketId, index);
@@ -309,7 +309,7 @@ void BattlegroundQueue::RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount)
{
//we must check premade and normal team's queue - because when players from premade are joining bg,
//they leave groupinfo so we can't use its players size to find out index
- for (uint32 j = index; j < BG_QUEUE_GROUP_TYPES_COUNT; j += BG_TEAMS_COUNT)
+ for (uint32 j = index; j < BG_QUEUE_GROUP_TYPES_COUNT; j += PVP_TEAMS_COUNT)
{
GroupsQueueType::iterator k = m_QueuedGroups[bracket_id_tmp][j].begin();
for (; k != m_QueuedGroups[bracket_id_tmp][j].end(); ++k)
@@ -618,7 +618,7 @@ bool BattlegroundQueue::CheckPremadeMatch(BattlegroundBracketId bracket_id, uint
//add groups/players from normal queue to size of bigger group
uint32 maxPlayers = std::min(m_SelectionPools[TEAM_ALLIANCE].GetPlayerCount(), m_SelectionPools[TEAM_HORDE].GetPlayerCount());
GroupsQueueType::const_iterator itr;
- for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
+ for (uint32 i = 0; i < PVP_TEAMS_COUNT; i++)
{
for (itr = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + i].begin(); itr != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + i].end(); ++itr)
{
@@ -636,7 +636,7 @@ bool BattlegroundQueue::CheckPremadeMatch(BattlegroundBracketId bracket_id, uint
// if first is invited to BG and seconds timer expired, but we can ignore it, because players have only 80 seconds to click to enter bg
// and when they click or after 80 seconds the queue info is removed from queue
uint32 time_before = GameTime::GetGameTimeMS() - sWorld->getIntConfig(CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH);
- for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
+ for (uint32 i = 0; i < PVP_TEAMS_COUNT; i++)
{
if (!m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE + i].empty())
{
@@ -656,8 +656,8 @@ bool BattlegroundQueue::CheckPremadeMatch(BattlegroundBracketId bracket_id, uint
// this method tries to create battleground or arena with MinPlayersPerTeam against MinPlayersPerTeam
bool BattlegroundQueue::CheckNormalMatch(Battleground* /*bg_template*/, BattlegroundBracketId bracket_id, uint32 minPlayers, uint32 maxPlayers)
{
- GroupsQueueType::const_iterator itr_team[BG_TEAMS_COUNT];
- for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
+ GroupsQueueType::const_iterator itr_team[PVP_TEAMS_COUNT];
+ for (uint32 i = 0; i < PVP_TEAMS_COUNT; i++)
{
itr_team[i] = m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + i].begin();
for (; itr_team[i] != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + i].end(); ++(itr_team[i]))
@@ -682,7 +682,7 @@ bool BattlegroundQueue::CheckNormalMatch(Battleground* /*bg_template*/, Battlegr
for (; itr_team[j] != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + j].end(); ++(itr_team[j]))
{
if (!(*(itr_team[j]))->IsInvitedToBGInstanceGUID)
- if (!m_SelectionPools[j].AddGroup(*(itr_team[j]), m_SelectionPools[(j + 1) % BG_TEAMS_COUNT].GetPlayerCount()))
+ if (!m_SelectionPools[j].AddGroup(*(itr_team[j]), m_SelectionPools[(j + 1) % PVP_TEAMS_COUNT].GetPlayerCount()))
break;
}
// do not allow to start bg with more than 2 players more on 1 faction
@@ -846,7 +846,7 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 /*diff*/, BattlegroundBra
return;
}
// invite those selection pools
- for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
+ for (uint32 i = 0; i < PVP_TEAMS_COUNT; i++)
for (GroupsQueueType::const_iterator citr = m_SelectionPools[TEAM_ALLIANCE + i].SelectedGroups.begin(); citr != m_SelectionPools[TEAM_ALLIANCE + i].SelectedGroups.end(); ++citr)
InviteGroupToBG((*citr), bg2, (*citr)->Team);
@@ -873,7 +873,7 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 /*diff*/, BattlegroundBra
}
// invite those selection pools
- for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
+ for (uint32 i = 0; i < PVP_TEAMS_COUNT; i++)
for (GroupsQueueType::const_iterator citr = m_SelectionPools[TEAM_ALLIANCE + i].SelectedGroups.begin(); citr != m_SelectionPools[TEAM_ALLIANCE + i].SelectedGroups.end(); ++citr)
InviteGroupToBG((*citr), bg2, (*citr)->Team);
// start bg
@@ -919,7 +919,7 @@ void BattlegroundQueue::BattlegroundQueueUpdate(uint32 /*diff*/, BattlegroundBra
int32 discardTime = GameTime::GetGameTimeMS() - sBattlegroundMgr->GetRatingDiscardTimer();
// we need to find 2 teams which will play next game
- GroupsQueueType::iterator itr_teams[BG_TEAMS_COUNT];
+ GroupsQueueType::iterator itr_teams[PVP_TEAMS_COUNT];
uint8 found = 0;
uint8 team = 0;