aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Battlegrounds/BattlegroundQueue.cpp
diff options
context:
space:
mode:
authorLiberate <tbaart@gmail.com>2010-08-27 18:18:26 +0200
committerLiberate <tbaart@gmail.com>2010-08-27 18:18:26 +0200
commit9bd804deced7dff9e170d19fc7744afb9afb8062 (patch)
tree8b8bad6c163f992b1ff1ec9250f10d986948916b /src/server/game/Battlegrounds/BattlegroundQueue.cpp
parente2dc4c3a66a53109616bff726bb4f4e198af580b (diff)
Updates the arena rating system to use Matchmaker Rating.
The arena_team_stats sql in this commit sets all ratings to 0. You start with 0 Team Rating and 1500 Matchmaker Rating. Personal rating is moved to character_arena_stats, and will not reset when disbanding an arena team. This new system is based on all the info I could get, but Blizzard didn't leak much info about the new system. At least this system is really close to the official system. Any issues found should be reported in an issue. Huge thanks go to Aokromes for the intensive testing he has done with me. Also thanks to Parzival for hearing me out and giving his ideas. Fixes issue #3189 --HG-- branch : trunk
Diffstat (limited to 'src/server/game/Battlegrounds/BattlegroundQueue.cpp')
-rw-r--r--src/server/game/Battlegrounds/BattlegroundQueue.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
index a40180ea476..6fc4ede2277 100644
--- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp
@@ -125,7 +125,7 @@ bool BattlegroundQueue::SelectionPool::AddGroup(GroupQueueInfo *ginfo, uint32 de
/*********************************************************/
// add group or player (grp == NULL) to bg queue with the given leader and bg specifications
-GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, BattlegroundTypeId BgTypeId, PvPDifficultyEntry const* backetEntry, uint8 ArenaType, bool isRated, bool isPremade, uint32 arenaRating, uint32 arenateamid)
+GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, BattlegroundTypeId BgTypeId, PvPDifficultyEntry const* backetEntry, uint8 ArenaType, bool isRated, bool isPremade, uint32 ArenaRating, uint32 MatchmakerRating, uint32 arenateamid)
{
BattlegroundBracketId bracketId = backetEntry->GetBracketId();
@@ -139,8 +139,10 @@ GroupQueueInfo * BattlegroundQueue::AddGroup(Player *leader, Group* grp, Battleg
ginfo->JoinTime = getMSTime();
ginfo->RemoveInviteTime = 0;
ginfo->Team = leader->GetTeam();
- ginfo->ArenaTeamRating = arenaRating;
+ ginfo->ArenaTeamRating = ArenaRating;
+ ginfo->ArenaMatchmakerRating = MatchmakerRating;
ginfo->OpponentsTeamRating = 0;
+ ginfo->OpponentsMatchmakerRating = 0;
ginfo->Players.clear();
@@ -366,9 +368,9 @@ void BattlegroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
sLog.outDebug("UPDATING memberLost's personal arena rating for %u by opponents rating: %u", GUID_LOPART(guid), group->OpponentsTeamRating);
Player *plr = sObjectMgr.GetPlayer(guid);
if (plr)
- at->MemberLost(plr, group->OpponentsTeamRating);
+ at->MemberLost(plr, group->OpponentsMatchmakerRating);
else
- at->OfflineMemberLost(guid, group->OpponentsTeamRating);
+ at->OfflineMemberLost(guid, group->OpponentsMatchmakerRating);
at->SaveToDB();
}
}
@@ -886,17 +888,17 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI
if (!m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].empty())
{
front1 = m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].front();
- arenaRating = front1->ArenaTeamRating;
+ arenaRating = front1->ArenaMatchmakerRating;
}
if (!m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_HORDE].empty())
{
front2 = m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_HORDE].front();
- arenaRating = front2->ArenaTeamRating;
+ arenaRating = front2->ArenaMatchmakerRating;
}
if (front1 && front2)
{
if (front1->JoinTime < front2->JoinTime)
- arenaRating = front1->ArenaTeamRating;
+ arenaRating = front1->ArenaMatchmakerRating;
}
else if (!front1 && !front2)
return; //queues are empty
@@ -925,7 +927,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI
{
// if group match conditions, then add it to pool
if (!(*itr_team[i])->IsInvitedToBGInstanceGUID
- && (((*itr_team[i])->ArenaTeamRating >= arenaMinRating && (*itr_team[i])->ArenaTeamRating <= arenaMaxRating)
+ && (((*itr_team[i])->ArenaMatchmakerRating >= arenaMinRating && (*itr_team[i])->ArenaMatchmakerRating <= arenaMaxRating)
|| (*itr_team[i])->JoinTime < discardTime))
{
m_SelectionPools[i].AddGroup((*itr_team[i]), MaxPlayersPerTeam);
@@ -945,7 +947,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI
for (; itr_team[BG_TEAM_ALLIANCE] != m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_HORDE].end(); ++(itr_team[BG_TEAM_ALLIANCE]))
{
if (!(*itr_team[BG_TEAM_ALLIANCE])->IsInvitedToBGInstanceGUID
- && (((*itr_team[BG_TEAM_ALLIANCE])->ArenaTeamRating >= arenaMinRating && (*itr_team[BG_TEAM_ALLIANCE])->ArenaTeamRating <= arenaMaxRating)
+ && (((*itr_team[BG_TEAM_ALLIANCE])->ArenaMatchmakerRating >= arenaMinRating && (*itr_team[BG_TEAM_ALLIANCE])->ArenaMatchmakerRating <= arenaMaxRating)
|| (*itr_team[BG_TEAM_ALLIANCE])->JoinTime < discardTime))
{
m_SelectionPools[BG_TEAM_ALLIANCE].AddGroup((*itr_team[BG_TEAM_ALLIANCE]), MaxPlayersPerTeam);
@@ -961,7 +963,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI
for (; itr_team[BG_TEAM_HORDE] != m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].end(); ++(itr_team[BG_TEAM_HORDE]))
{
if (!(*itr_team[BG_TEAM_HORDE])->IsInvitedToBGInstanceGUID
- && (((*itr_team[BG_TEAM_HORDE])->ArenaTeamRating >= arenaMinRating && (*itr_team[BG_TEAM_HORDE])->ArenaTeamRating <= arenaMaxRating)
+ && (((*itr_team[BG_TEAM_HORDE])->ArenaMatchmakerRating >= arenaMinRating && (*itr_team[BG_TEAM_HORDE])->ArenaMatchmakerRating <= arenaMaxRating)
|| (*itr_team[BG_TEAM_HORDE])->JoinTime < discardTime))
{
m_SelectionPools[BG_TEAM_HORDE].AddGroup((*itr_team[BG_TEAM_HORDE]), MaxPlayersPerTeam);
@@ -981,8 +983,10 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI
}
(*(itr_team[BG_TEAM_ALLIANCE]))->OpponentsTeamRating = (*(itr_team[BG_TEAM_HORDE]))->ArenaTeamRating;
+ (*(itr_team[BG_TEAM_ALLIANCE]))->OpponentsMatchmakerRating = (*(itr_team[BG_TEAM_HORDE]))->ArenaMatchmakerRating;
sLog.outDebug("setting oposite teamrating for team %u to %u", (*(itr_team[BG_TEAM_ALLIANCE]))->ArenaTeamId, (*(itr_team[BG_TEAM_ALLIANCE]))->OpponentsTeamRating);
(*(itr_team[BG_TEAM_HORDE]))->OpponentsTeamRating = (*(itr_team[BG_TEAM_ALLIANCE]))->ArenaTeamRating;
+ (*(itr_team[BG_TEAM_HORDE]))->OpponentsMatchmakerRating = (*(itr_team[BG_TEAM_ALLIANCE]))->ArenaMatchmakerRating;
sLog.outDebug("setting oposite teamrating for team %u to %u", (*(itr_team[BG_TEAM_HORDE]))->ArenaTeamId, (*(itr_team[BG_TEAM_HORDE]))->OpponentsTeamRating);
// now we must move team if we changed its faction to another faction queue, because then we will spam log by errors in Queue::RemovePlayer
if ((*(itr_team[BG_TEAM_ALLIANCE]))->Team != ALLIANCE)