138 uint32 loserTeamRating = 0;
139 uint32 loserMatchmakerRating = 0;
140 int32 loserChange = 0;
141 int32 loserMatchmakerChange = 0;
142 uint32 winnerTeamRating = 0;
143 uint32 winnerMatchmakerRating = 0;
144 int32 winnerChange = 0;
145 int32 winnerMatchmakerChange = 0;
146 bool guildAwarded =
false;
151 if (winnerArenaTeam && loserArenaTeam && winnerArenaTeam != loserArenaTeam)
153 loserTeamRating = loserArenaTeam->
GetRating();
155 winnerTeamRating = winnerArenaTeam->
GetRating();
160 winnerMatchmakerChange = winnerArenaTeam->
WonAgainst(winnerMatchmakerRating, loserMatchmakerRating, winnerChange);
161 loserMatchmakerChange = loserArenaTeam->
LostAgainst(loserMatchmakerRating, winnerMatchmakerRating, loserChange);
163 TC_LOG_DEBUG(
"bg.arena",
"match Type: %u --- Winner: old rating: %u, rating gain: %d, old MMR: %u, MMR gain: %d --- Loser: old rating: %u, rating loss: %d, old MMR: %u, MMR loss: %d ---",
164 GetArenaType(), winnerTeamRating, winnerChange, winnerMatchmakerRating, winnerMatchmakerChange,
165 loserTeamRating, loserChange, loserMatchmakerRating, loserMatchmakerChange);
175 _arenaTeamScores[winnerTeam].
Assign(winnerTeamRating, winnerTeamRating + winnerChange, winnerMatchmakerRating);
176 _arenaTeamScores[loserTeam].
Assign(loserTeamRating, loserTeamRating + loserChange, loserMatchmakerRating);
178 TC_LOG_DEBUG(
"bg.arena",
"Arena match Type: %u for Team1Id: %u - Team2Id: %u ended. WinnerTeamId: %u. Winner rating: +%d, Loser rating: %d",
185 TC_LOG_DEBUG(
"bg.arena",
"Statistics match Type: %u for %s (%s, Team: %d, IP: %s): %s",
187 player->GetSession()->GetRemoteAddress().c_str(), score.second->ToString().c_str());
204 uint32 team = i.second.Team;
206 if (i.second.OfflineRemoveTime)
210 winnerArenaTeam->
OfflineMemberLost(i.first, loserMatchmakerRating, winnerMatchmakerChange);
212 loserArenaTeam->
OfflineMemberLost(i.first, winnerMatchmakerRating, loserMatchmakerChange);
216 Player* player =
_GetPlayer(i.first, i.second.OfflineRemoveTime != 0,
"Arena::EndBattleground");
224 uint32 rating = player->GetArenaPersonalRating(winnerArenaTeam->
GetSlot());
241 winnerArenaTeam->
MemberWon(player, loserMatchmakerRating, winnerMatchmakerChange);
245 loserArenaTeam->
MemberLost(player, winnerMatchmakerRating, loserMatchmakerChange);
Definition: Battleground.h:183
Definition: DBCEnums.h:229
Definition: DBCEnums.h:109
int32 LostAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int32 &rating_change)
Definition: ArenaTeam.cpp:637
uint32 GetOtherTeam(uint32 teamId) const
Definition: Battleground.cpp:1829
#define sGuildMgr
Definition: GuildMgr.h:61
void SetArenaMatchmakerRating(uint32 Team, uint32 MMR)
Definition: Battleground.h:416
arena_t NULL
Definition: jemalloc_internal.h:624
BattlegroundMap * GetBgMap() const
Definition: Battleground.h:356
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: DBCEnums.h:762
BattlegroundPlayerMap const & GetPlayers() const
Definition: Battleground.h:331
#define sWorld
Definition: World.h:887
uint64 LowType
Definition: ObjectGuid.h:199
uint32 GetAlivePlayersCountByTeam(uint32 Team) const
Definition: Battleground.cpp:1860
Definition: DBCEnums.h:224
ArenaTeamScore _arenaTeamScores[BG_TEAMS_COUNT]
Definition: Battleground.h:564
Definition: SharedDefines.h:1000
bool isRated() const
Definition: Battleground.h:328
uint32 GetRating() const
Definition: ArenaTeam.h:133
#define ARENA_TIMELIMIT_POINTS_LOSS
Definition: Battleground.h:212
void MemberLost(Player *player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange=-12)
Definition: ArenaTeam.cpp:653
void FinishGame(int32 mod)
Definition: ArenaTeam.cpp:588
int32 WonAgainst(uint32 Own_MMRating, uint32 Opponent_MMRating, int32 &rating_change)
Definition: ArenaTeam.cpp:617
uint8 GetArenaType() const
Definition: Battleground.h:281
void NotifyStatsChanged()
Definition: ArenaTeam.cpp:402
void Assign(int32 oldRating, int32 newRating, uint32 matchMakerRating)
Definition: ArenaScore.h:63
uint32 GetId() const
Definition: ArenaTeam.h:124
uint32 GetArenaTeamIdForTeam(uint32 Team) const
Definition: Battleground.h:414
int32_t int32
Definition: Define.h:146
uint32_t uint32
Definition: Define.h:150
uint32 GetArenaTeamIdByIndex(uint32 index) const
Definition: Battleground.h:415
Definition: SharedDefines.h:992
void SaveToDB()
Definition: ArenaTeam.cpp:728
Definition: SharedDefines.h:4551
Definition: ArenaTeam.h:112
Player * _GetPlayer(ObjectGuid guid, bool offlineRemove, const char *context) const
Definition: Battleground.cpp:617
uint8 GetSlot() const
Definition: ArenaTeam.h:126
uint8_t uint8
Definition: Define.h:152
uint32 GetArenaMatchmakerRating(uint32 Team) const
Definition: Battleground.h:417
uint32 GetMapId() const
Definition: Battleground.h:352
Definition: SharedDefines.h:4550
#define sArenaTeamMgr
Definition: ArenaTeamMgr.h:53
virtual void EndBattleground(uint32 winner)
Definition: Battleground.cpp:744
Definition: SharedDefines.h:993
void OfflineMemberLost(ObjectGuid guid, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange=-12)
Definition: ArenaTeam.cpp:679
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:215
void MemberWon(Player *player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange)
Definition: ArenaTeam.cpp:701
BattlegroundScoreMap PlayerScores
Definition: Battleground.h:543