feat(Scripts): Extend matchmaking hooks to cover arena matches

Extended the CanAddGroupToMatchingPool hook to arena matchmaking system,
providing comprehensive coverage for module-based MMR filtering:

- CheckPremadeMatch: Added hooks for rated arena team matching (2v2/3v3/5v5)
- CheckSkirmishForSameFaction: Added hook for unrated arena skirmish matching

These additions complement the existing 6 battleground hook integration points,
bringing total coverage to 9 matchmaking scenarios. Modules implementing
Glicko-2, Elo, or other rating systems can now apply MMR-based filtering
across all PvP content types.
This commit is contained in:
blinkysc 2025-11-04 14:15:29 -06:00
parent cf20fe23b9
commit 6fd52b5e54

View File

@ -571,6 +571,13 @@ bool BattlegroundQueue::CheckPremadeMatch(BattlegroundBracketId bracket_id, uint
// if found both groups
if (ali_group != m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].end() && horde_group != m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_HORDE].end())
{
// Allow modules to filter premade arena matches based on custom criteria (e.g., MMR)
if (!sScriptMgr->CanAddGroupToMatchingPool(this, (*ali_group), 0, nullptr, bracket_id))
return false;
if (!sScriptMgr->CanAddGroupToMatchingPool(this, (*horde_group), m_SelectionPools[TEAM_ALLIANCE].GetPlayerCount(), nullptr, bracket_id))
return false;
m_SelectionPools[TEAM_ALLIANCE].AddGroup((*ali_group), MaxPlayersPerTeam);
m_SelectionPools[TEAM_HORDE].AddGroup((*horde_group), MaxPlayersPerTeam);
@ -720,9 +727,15 @@ bool BattlegroundQueue::CheckSkirmishForSameFaction(BattlegroundBracketId bracke
//invite players to other selection pool
for (; itr_team2 != m_QueuedGroups[bracket_id][BG_QUEUE_NORMAL_ALLIANCE + static_cast<uint8>(teamIndex)].end(); ++itr_team2)
{
//if selection pool is full then break;
if (!(*itr_team2)->IsInvitedToBGInstanceGUID && !m_SelectionPools[otherTeam].AddGroup(*itr_team2, minPlayersPerTeam))
break;
// Allow modules to filter other arena matches based on custom criteria (e.g., MMR)
if (!(*itr_team2)->IsInvitedToBGInstanceGUID)
{
if (!sScriptMgr->CanAddGroupToMatchingPool(this, *itr_team2, m_SelectionPools[otherTeam].GetPlayerCount(), nullptr, bracket_id))
continue;
if (!m_SelectionPools[otherTeam].AddGroup(*itr_team2, minPlayersPerTeam))
break;
}
}
if (m_SelectionPools[otherTeam].GetPlayerCount() != minPlayersPerTeam)