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
This commit is contained in:
Liberate
2010-08-27 18:18:26 +02:00
parent e2dc4c3a66
commit 9bd804dece
17 changed files with 256 additions and 128 deletions
@@ -131,12 +131,12 @@ void BattlegroundMgr::Update(uint32 diff)
for (uint8 i = 0; i < scheduled.size(); i++)
{
uint32 arenaRating = scheduled[i] >> 32;
uint32 arenaMMRating = scheduled[i] >> 32;
uint8 arenaType = scheduled[i] >> 24 & 255;
BattlegroundQueueTypeId bgQueueTypeId = BattlegroundQueueTypeId(scheduled[i] >> 16 & 255);
BattlegroundTypeId bgTypeId = BattlegroundTypeId((scheduled[i] >> 8) & 255);
BattlegroundBracketId bracket_id = BattlegroundBracketId(scheduled[i] & 255);
m_BattlegroundQueues[bgQueueTypeId].Update(bgTypeId, bracket_id, arenaType, arenaRating > 0, arenaRating);
m_BattlegroundQueues[bgQueueTypeId].Update(bgTypeId, bracket_id, arenaType, arenaMMRating > 0, arenaMMRating);
}
}
@@ -243,10 +243,11 @@ void BattlegroundMgr::BuildPvpLogDataPacket(WorldPacket *data, Battleground *bg)
{
uint32 pointsLost = bg->m_ArenaTeamRatingChanges[i] < 0 ? abs(bg->m_ArenaTeamRatingChanges[i]) : 0;
uint32 pointsGained = bg->m_ArenaTeamRatingChanges[i] > 0 ? bg->m_ArenaTeamRatingChanges[i] : 0;
uint32 MatchmakerRating = bg->m_ArenaTeamMMR[i];
*data << uint32(pointsLost); // Rating Lost
*data << uint32(pointsGained); // Rating gained
*data << uint32(0); // Matchmaking Value
*data << uint32(MatchmakerRating); // Matchmaking Value
sLog.outDebug("rating change: %d", bg->m_ArenaTeamRatingChanges[i]);
}
for (int i = 1; i >= 0; --i)
@@ -1058,11 +1059,11 @@ void BattlegroundMgr::SetHolidayWeekends(uint32 mask)
}
}
void BattlegroundMgr::ScheduleQueueUpdate(uint32 arenaRating, uint8 arenaType, BattlegroundQueueTypeId bgQueueTypeId, BattlegroundTypeId bgTypeId, BattlegroundBracketId bracket_id)
void BattlegroundMgr::ScheduleQueueUpdate(uint32 arenaMatchmakerRating, uint8 arenaType, BattlegroundQueueTypeId bgQueueTypeId, BattlegroundTypeId bgTypeId, BattlegroundBracketId bracket_id)
{
//This method must be atomic, TODO add mutex
//we will use only 1 number created of bgTypeId and bracket_id
uint64 schedule_id = ((uint64)arenaRating << 32) | (arenaType << 24) | (bgQueueTypeId << 16) | (bgTypeId << 8) | bracket_id;
uint64 schedule_id = ((uint64)arenaMatchmakerRating << 32) | (arenaType << 24) | (bgQueueTypeId << 16) | (bgTypeId << 8) | bracket_id;
bool found = false;
for (uint8 i = 0; i < m_QueueUpdateScheduler.size(); i++)
{