feat(Core/Battlegrounds): Implemented new timed config for queue anno… (#8053)

* feat(Core/Battlegrounds): Implemented new timed config for queue announce system.

Closes #6637.

* Update.

* typo.

* Update.
This commit is contained in:
UltraNix
2021-09-28 19:18:23 +02:00
committed by GitHub
parent b2f08934bc
commit a7f52e9019
6 changed files with 79 additions and 10 deletions

View File

@@ -105,25 +105,25 @@ void BattlegroundMgr::Update(uint32 diff)
uint32 arenaRatedTeamId = scheduled[i] >> 32;
BattlegroundQueueTypeId bgQueueTypeId = BattlegroundQueueTypeId(scheduled[i] >> 16 & 255);
BattlegroundBracketId bracket_id = BattlegroundBracketId(scheduled[i] & 255);
m_BattlegroundQueues[bgQueueTypeId].BattlegroundQueueUpdate(bracket_id, true, arenaRatedTeamId); // pussywizard: looking for opponents only for this team
m_BattlegroundQueues[bgQueueTypeId].BattlegroundQueueUpdate(diff, bracket_id, true, arenaRatedTeamId); // pussywizard: looking for opponents only for this team
}
}
// periodic queue update
if (m_NextPeriodicQueueUpdateTime < diff)
{
m_NextPeriodicQueueUpdateTime = 5 * IN_MILLISECONDS;
// for rated arenas
for (uint32 qtype = BATTLEGROUND_QUEUE_2v2; qtype < MAX_BATTLEGROUND_QUEUE_TYPES; ++qtype)
for (uint32 bracket = BG_BRACKET_ID_FIRST; bracket < MAX_BATTLEGROUND_BRACKETS; ++bracket)
m_BattlegroundQueues[qtype].BattlegroundQueueUpdate(BattlegroundBracketId(bracket), true, 0); // pussywizard: 0 for rated means looking for opponents for every team
m_BattlegroundQueues[qtype].BattlegroundQueueUpdate(m_NextPeriodicQueueUpdateTime, BattlegroundBracketId(bracket), true, 0); // pussywizard: 0 for rated means looking for opponents for every team
// for battlegrounds and not rated arenas
// in first loop try to fill already running battlegrounds, then in a second loop try to create new battlegrounds
for (uint32 qtype = BATTLEGROUND_QUEUE_AV; qtype < MAX_BATTLEGROUND_QUEUE_TYPES; ++qtype)
for (uint32 bracket = BG_BRACKET_ID_FIRST; bracket < MAX_BATTLEGROUND_BRACKETS; ++bracket)
m_BattlegroundQueues[qtype].BattlegroundQueueUpdate(BattlegroundBracketId(bracket), false, 0);
m_NextPeriodicQueueUpdateTime = 5 * IN_MILLISECONDS;
m_BattlegroundQueues[qtype].BattlegroundQueueUpdate(m_NextPeriodicQueueUpdateTime, BattlegroundBracketId(bracket), false, 0);
}
else
m_NextPeriodicQueueUpdateTime -= diff;