AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "ArenaTeam.h"
Public Types | |
typedef std::list< ArenaTeamMember > | MemberList |
Public Member Functions | |
ArenaTeam () | |
~ArenaTeam () | |
bool | Create (ObjectGuid captainGuid, uint8 type, std::string const &teamName, uint32 backgroundColor, uint8 emblemStyle, uint32 emblemColor, uint8 borderStyle, uint32 borderColor) |
void | Disband (WorldSession *session) |
void | Disband () |
uint32 | GetId () const |
uint32 | GetType () const |
uint8 | GetSlot () const |
ObjectGuid | GetCaptain () const |
std::string const & | GetName () const |
const ArenaTeamStats & | GetStats () const |
void | SetArenaTeamStats (ArenaTeamStats &stats) |
uint32 | GetRating () const |
uint32 | GetAverageMMR (Group *group) const |
void | SetCaptain (ObjectGuid guid) |
bool | SetName (std::string const &name) |
bool | AddMember (ObjectGuid playerGuid) |
void | DelMember (ObjectGuid guid, bool cleanDb) |
size_t | GetMembersSize () const |
bool | Empty () const |
MemberList::iterator | m_membersBegin () |
MemberList::iterator | m_membersEnd () |
MemberList & | GetMembers () |
bool | IsMember (ObjectGuid guid) const |
ArenaTeamMember * | GetMember (ObjectGuid guid) |
ArenaTeamMember * | GetMember (std::string const &name) |
bool | IsFighting () const |
bool | LoadArenaTeamFromDB (QueryResult arenaTeamDataResult) |
bool | LoadMembersFromDB (QueryResult arenaTeamMembersResult) |
void | LoadStatsFromDB (uint32 ArenaTeamId) |
void | SaveToDB (bool forceMemberSave=false) |
void | BroadcastPacket (WorldPacket *packet) |
void | BroadcastEvent (ArenaTeamEvents event, ObjectGuid guid, uint8 strCount, std::string const &str1, std::string const &str2, std::string const &str3) |
void | NotifyStatsChanged () |
void | MassInviteToEvent (WorldSession *session) |
void | Roster (WorldSession *session) |
void | Query (WorldSession *session) |
void | SendStats (WorldSession *session) |
void | Inspect (WorldSession *session, ObjectGuid guid) |
uint32 | GetPoints (uint32 MemberRating) |
int32 | GetMatchmakerRatingMod (uint32 ownRating, uint32 opponentRating, bool won) |
int32 | GetRatingMod (uint32 ownRating, uint32 opponentRating, bool won) |
float | GetChanceAgainst (uint32 ownRating, uint32 opponentRating) |
int32 | WonAgainst (uint32 Own_MMRating, uint32 Opponent_MMRating, int32 &rating_change, const Map *bgMap) |
void | MemberWon (Player *player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange) |
int32 | LostAgainst (uint32 Own_MMRating, uint32 Opponent_MMRating, int32 &rating_change, const Map *bgMap) |
void | MemberLost (Player *player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange=-12) |
void | UpdateArenaPointsHelper (std::map< ObjectGuid, uint32 > &PlayerPoints) |
bool | FinishWeek () |
void | FinishGame (int32 mod, const Map *bgMap) |
void | SetPreviousOpponents (uint32 arenaTeamId) |
uint32 | GetPreviousOpponents () |
void | CreateTempArenaTeam (std::vector< Player * > playerList, uint8 type, std::string const &teamName) |
Static Public Member Functions | |
static uint8 | GetSlotByType (uint32 type) |
static uint8 | GetReqPlayersForType (uint32 type) |
Static Public Attributes | |
static std::unordered_map< uint32, uint8 > | ArenaSlotByType |
static std::unordered_map< uint8, uint8 > | ArenaReqPlayersForType |
Protected Attributes | |
uint32 | TeamId |
uint8 | Type |
std::string | TeamName |
ObjectGuid | CaptainGuid |
uint32 | BackgroundColor |
uint8 | EmblemStyle |
uint32 | EmblemColor |
uint8 | BorderStyle |
uint32 | BorderColor |
MemberList | Members |
ArenaTeamStats | Stats |
uint32 | PreviousOpponents = 0 |
typedef std::list<ArenaTeamMember> ArenaTeam::MemberList |
ArenaTeam::ArenaTeam | ( | ) |
ArenaTeam::~ArenaTeam | ( | ) |
bool ArenaTeam::AddMember | ( | ObjectGuid | playerGuid | ) |
References ARENA_TEAM_MEMBER, CaptainGuid, CHAR_INS_ARENA_TEAM_MEMBER, CHAR_SEL_MATCH_MAKER_RATING, CharacterDatabase, ArenaTeamMember::Class, CharacterCacheEntry::Class, CONFIG_ARENA_START_MATCHMAKER_RATING, CONFIG_ARENA_START_PERSONAL_RATING, ObjectAccessor::FindConnectedPlayer(), Player::GetArenaTeamId(), Unit::getClass(), ObjectGuid::GetCounter(), GetId(), GetMembersSize(), WorldObject::GetName(), GetRating(), GetSlot(), GetType(), ArenaTeamMember::Guid, LOG_ERROR, ArenaTeamMember::MatchMakerRating, Max, ArenaTeamMember::MaxMMR, Members, CharacterCacheEntry::Name, ArenaTeamMember::PersonalRating, Player::RemovePetitionsAndSigns(), sCharacterCache, ArenaTeamMember::SeasonGames, ArenaTeamMember::SeasonWins, Player::SetArenaTeamIdInvited(), Player::SetArenaTeamInfoField(), PreparedStatementBase::SetData(), Player::SetInArenaTeam(), sScriptMgr, sWorld, ObjectGuid::ToString(), ArenaTeamMember::WeekGames, and ArenaTeamMember::WeekWins.
Referenced by Create(), WorldSession::HandleArenaTeamAcceptOpcode(), and WorldSession::HandleTurnInPetitionOpcode().
void ArenaTeam::BroadcastEvent | ( | ArenaTeamEvents | event, |
ObjectGuid | guid, | ||
uint8 | strCount, | ||
std::string const & | str1, | ||
std::string const & | str2, | ||
std::string const & | str3 | ||
) |
References BroadcastPacket(), LOG_DEBUG, LOG_ERROR, and SMSG_ARENA_TEAM_EVENT.
Referenced by Disband(), WorldSession::HandleArenaTeamAcceptOpcode(), WorldSession::HandleArenaTeamLeaderOpcode(), WorldSession::HandleArenaTeamLeaveOpcode(), and WorldSession::HandleArenaTeamRemoveOpcode().
void ArenaTeam::BroadcastPacket | ( | WorldPacket * | packet | ) |
References ObjectAccessor::FindConnectedPlayer(), and Members.
Referenced by BroadcastEvent().
bool ArenaTeam::Create | ( | ObjectGuid | captainGuid, |
uint8 | type, | ||
std::string const & | teamName, | ||
uint32 | backgroundColor, | ||
uint8 | emblemStyle, | ||
uint32 | emblemColor, | ||
uint8 | borderStyle, | ||
uint32 | borderColor | ||
) |
References AddMember(), BackgroundColor, BorderColor, BorderStyle, CaptainGuid, CHAR_INS_ARENA_TEAM, CharacterDatabase, EmblemColor, EmblemStyle, ObjectAccessor::FindConnectedPlayer(), ObjectGuid::GetCounter(), sArenaTeamMgr, PreparedStatementBase::SetData(), TeamName, and Type.
Referenced by arena_commandscript::HandleArenaCreateCommand(), and WorldSession::HandleTurnInPetitionOpcode().
void ArenaTeam::CreateTempArenaTeam | ( | std::vector< Player * > | playerList, |
uint8 | type, | ||
std::string const & | teamName | ||
) |
References ASSERT, BackgroundColor, BorderColor, BorderStyle, CaptainGuid, EmblemColor, EmblemStyle, GetRating(), GetReqPlayersForType(), GetSlotByType(), Members, sArenaTeamMgr, ArenaTeamStats::SeasonGames, ArenaTeamStats::SeasonWins, Stats, TeamName, Type, ArenaTeamMember::WeekGames, ArenaTeamStats::WeekGames, and ArenaTeamStats::WeekWins.
void ArenaTeam::DelMember | ( | ObjectGuid | guid, |
bool | cleanDb | ||
) |
References ARENA_TEAM_END, BATTLEGROUND_AA, BattlegroundMgr::BGQueueTypeId(), CHAR_DEL_ARENA_TEAM_MEMBER, CharacterDatabase, ERR_ARENA_TEAM_QUIT_S, ObjectAccessor::FindConnectedPlayer(), ObjectGuid::GetCounter(), Player::GetGroup(), Group::GetGUID(), GetId(), GetName(), BattlegroundQueue::GetPlayerGroupInfoData(), Player::GetSession(), GetSlot(), GetType(), GroupQueueInfo::IsInvitedToBGInstanceGUID, Members, BattlegroundQueue::RemovePlayer(), sBattlegroundMgr, sCharacterCache, WorldSession::SendArenaTeamCommandResult(), Player::SetArenaTeamInfoField(), PreparedStatementBase::SetData(), STATUS_NONE, and TEAM_NEUTRAL.
Referenced by Disband(), WorldSession::HandleArenaTeamLeaveOpcode(), WorldSession::HandleArenaTeamRemoveOpcode(), Player::LeaveAllArenaTeams(), and LoadMembersFromDB().
void ArenaTeam::Disband | ( | ) |
References CHAR_DEL_ARENA_TEAM, CHAR_DEL_ARENA_TEAM_MEMBERS, CharacterDatabase, DelMember(), Members, sArenaTeamMgr, and PreparedStatementBase::SetData().
void ArenaTeam::Disband | ( | WorldSession * | session | ) |
References BroadcastEvent(), CHAR_DEL_ARENA_TEAM, CHAR_DEL_ARENA_TEAM_MEMBERS, CharacterDatabase, DelMember(), ObjectGuid::Empty, ERR_ARENA_TEAM_DISBANDED_S, GetName(), WorldSession::GetPlayerName(), Members, sArenaTeamMgr, and PreparedStatementBase::SetData().
Referenced by arena_commandscript::HandleArenaDisbandCommand(), WorldSession::HandleArenaTeamLeaveOpcode(), and ArenaTeamMgr::LoadArenaTeams().
|
inline |
References ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING, ObjectAccessor::FindConnectedPlayer(), Members, sArenaTeamMgr, and Type.
Referenced by Arena::EndBattleground(), LostAgainst(), and WonAgainst().
bool ArenaTeam::FinishWeek | ( | ) |
References ObjectAccessor::FindConnectedPlayer(), Group::IsMember(), and Members.
Referenced by WorldSession::HandleBattlemasterJoinArena().
|
inline |
References CaptainGuid.
Referenced by Player::_LoadArenaTeamInfo(), arena_commandscript::HandleArenaCaptainCommand(), arena_commandscript::HandleArenaCreateCommand(), arena_commandscript::HandleArenaInfoCommand(), WorldSession::HandleArenaTeamAcceptOpcode(), WorldSession::HandleArenaTeamLeaderOpcode(), WorldSession::HandleArenaTeamLeaveOpcode(), WorldSession::HandleArenaTeamRemoveOpcode(), LoadMembersFromDB(), Roster(), and SetCaptain().
Referenced by GetMatchmakerRatingMod(), and GetRatingMod().
|
inline |
References TeamId.
Referenced by ArenaTeamMgr::AddArenaTeam(), AddMember(), DelMember(), Arena::EndBattleground(), arena_commandscript::HandleArenaCaptainCommand(), arena_commandscript::HandleArenaCreateCommand(), arena_commandscript::HandleArenaInfoCommand(), arena_commandscript::HandleArenaRenameCommand(), WorldSession::HandleArenaTeamInviteOpcode(), WorldSession::HandleTurnInPetitionOpcode(), Inspect(), LoadMembersFromDB(), Query(), Roster(), SaveToDB(), SendStats(), SetCaptain(), and SetName().
References CONFIG_ARENA_MATCHMAKER_RATING_MODIFIER, GetChanceAgainst(), and sWorld.
Referenced by LostAgainst(), and WonAgainst().
ArenaTeamMember * ArenaTeam::GetMember | ( | ObjectGuid | guid | ) |
References Members.
Referenced by Player::_LoadArenaTeamInfo(), GetMember(), WorldSession::HandleArenaTeamLeaderOpcode(), WorldSession::HandleArenaTeamRemoveOpcode(), Inspect(), and AchievementMgr::UpdateAchievementCriteria().
ArenaTeamMember * ArenaTeam::GetMember | ( | std::string const & | name | ) |
References GetMember(), and sCharacterCache.
|
inline |
|
inline |
References Members.
Referenced by AddMember(), WorldSession::HandleArenaTeamInviteOpcode(), WorldSession::HandleArenaTeamLeaveOpcode(), and Roster().
|
inline |
References TeamName.
Referenced by DelMember(), Disband(), Arena::EndBattleground(), arena_commandscript::HandleArenaCaptainCommand(), arena_commandscript::HandleArenaCreateCommand(), arena_commandscript::HandleArenaDisbandCommand(), arena_commandscript::HandleArenaInfoCommand(), WorldSession::HandleArenaTeamAcceptOpcode(), WorldSession::HandleArenaTeamInviteOpcode(), WorldSession::HandleArenaTeamLeaderOpcode(), WorldSession::HandleArenaTeamLeaveOpcode(), WorldSession::HandleArenaTeamRemoveOpcode(), Query(), BattlegroundQueue::SendExitMessageArenaQueue(), and BattlegroundQueue::SendJoinMessageArenaQueue().
References ARENA_TEAM_2v2, ARENA_TEAM_3v3, CONFIG_ARENA_SEASON_ID, CONFIG_LEGACY_ARENA_POINTS_CALC, RATE_ARENA_POINTS, sScriptMgr, sWorld, and Type.
Referenced by UpdateArenaPointsHelper().
|
inline |
|
inline |
References CONFIG_ARENA_LOSE_RATING_MODIFIER, CONFIG_ARENA_WIN_RATING_MODIFIER_1, CONFIG_ARENA_WIN_RATING_MODIFIER_2, GetChanceAgainst(), and sWorld.
Referenced by LostAgainst(), MemberLost(), MemberWon(), and WonAgainst().
References ArenaReqPlayersForType, and LOG_ERROR.
Referenced by BattlegroundMgr::CreateNewBattleground(), CreateTempArenaTeam(), Battleground::ReadyMarkerClicked(), and BattlegroundQueue::SendJoinMessageArenaQueue().
|
inline |
References GetSlotByType(), and GetType().
Referenced by AddMember(), DelMember(), Arena::EndBattleground(), WorldSession::HandleArenaTeamAcceptOpcode(), WorldSession::HandleArenaTeamInviteOpcode(), Inspect(), LoadMembersFromDB(), MemberLost(), MemberWon(), SaveToDB(), and SetCaptain().
References ArenaSlotByType, LOG_ERROR, and sScriptMgr.
Referenced by CreateTempArenaTeam(), GetSlot(), WorldSession::HandleOfferPetitionOpcode(), WorldSession::HandlePetitionSignOpcode(), WorldSession::HandleTurnInPetitionOpcode(), ArenaTeamMember::ModifyPersonalRating(), and AchievementMgr::UpdateAchievementCriteria().
|
inline |
|
inline |
References Type.
Referenced by Player::_LoadArenaTeamInfo(), AddMember(), DelMember(), GetSlot(), arena_commandscript::HandleArenaCreateCommand(), arena_commandscript::HandleArenaInfoCommand(), WorldSession::HandleArenaTeamInviteOpcode(), WorldSession::HandleArenaTeamLeaveOpcode(), WorldSession::HandleArenaTeamRemoveOpcode(), MemberLost(), MemberWon(), Query(), Roster(), and AchievementMgr::UpdateAchievementCriteria().
void ArenaTeam::Inspect | ( | WorldSession * | session, |
ObjectGuid | guid | ||
) |
References GetId(), GetMember(), GetSlot(), MAX_ARENA_SLOT, MSG_INSPECT_ARENA_TEAMS, ArenaTeamMember::PersonalRating, ArenaTeamMember::SeasonGames, and WorldSession::SendPacket().
bool ArenaTeam::IsFighting | ( | ) | const |
References ObjectAccessor::FindPlayer(), and Members.
Referenced by arena_commandscript::HandleArenaCaptainCommand(), arena_commandscript::HandleArenaDisbandCommand(), arena_commandscript::HandleArenaRenameCommand(), WorldSession::HandleArenaTeamLeaveOpcode(), and WorldSession::HandleArenaTeamRemoveOpcode().
bool ArenaTeam::IsMember | ( | ObjectGuid | guid | ) | const |
References Members.
Referenced by arena_commandscript::HandleArenaCaptainCommand().
bool ArenaTeam::LoadArenaTeamFromDB | ( | QueryResult | arenaTeamDataResult | ) |
References BackgroundColor, BorderColor, BorderStyle, CaptainGuid, EmblemColor, EmblemStyle, Field::Get(), TeamName, and Type.
Referenced by ArenaTeamMgr::LoadArenaTeams().
bool ArenaTeam::LoadMembersFromDB | ( | QueryResult | arenaTeamMembersResult | ) |
References ArenaTeamMember::Class, CONFIG_ARENA_START_MATCHMAKER_RATING, DelMember(), Empty(), Field::Get(), GetCaptain(), GetId(), GetSlot(), ArenaTeamMember::Guid, LOG_DEBUG, LOG_ERROR, ArenaTeamMember::MatchMakerRating, ArenaTeamMember::MaxMMR, Members, ArenaTeamMember::PersonalRating, sCharacterCache, ArenaTeamMember::SeasonGames, ArenaTeamMember::SeasonWins, sWorld, ObjectGuid::ToString(), ArenaTeamMember::WeekGames, and ArenaTeamMember::WeekWins.
Referenced by ArenaTeamMgr::LoadArenaTeams().
void ArenaTeam::LoadStatsFromDB | ( | uint32 | ArenaTeamId | ) |
int32 ArenaTeam::LostAgainst | ( | uint32 | Own_MMRating, |
uint32 | Opponent_MMRating, | ||
int32 & | rating_change, | ||
const Map * | bgMap | ||
) |
References FinishGame(), GetMatchmakerRatingMod(), and GetRatingMod().
Referenced by Arena::EndBattleground().
|
inline |
|
inline |
void ArenaTeam::MassInviteToEvent | ( | WorldSession * | session | ) |
References Object::GetGUID(), WorldSession::GetPlayer(), Members, WorldSession::SendPacket(), and SMSG_CALENDAR_ARENA_TEAM.
void ArenaTeam::MemberLost | ( | Player * | player, |
uint32 | againstMatchmakerRating, | ||
int32 | MatchmakerRatingChange = -12 |
||
) |
References ARENA_TEAM_GAMES_SEASON, ARENA_TEAM_GAMES_WEEK, Object::GetGUID(), GetRatingMod(), GetSlot(), GetType(), Members, and Player::SetArenaTeamInfoField().
Referenced by Arena::EndBattleground(), and Arena::RemovePlayerAtLeave().
void ArenaTeam::MemberWon | ( | Player * | player, |
uint32 | againstMatchmakerRating, | ||
int32 | MatchmakerRatingChange | ||
) |
References ARENA_TEAM_GAMES_SEASON, ARENA_TEAM_GAMES_WEEK, Object::GetGUID(), GetRatingMod(), GetSlot(), GetType(), Members, Player::SetArenaTeamInfoField(), and sScriptMgr.
Referenced by Arena::EndBattleground().
void ArenaTeam::NotifyStatsChanged | ( | ) |
References ObjectAccessor::FindConnectedPlayer(), Members, and SendStats().
Referenced by Arena::EndBattleground().
void ArenaTeam::Query | ( | WorldSession * | session | ) |
References BackgroundColor, BorderColor, BorderStyle, EmblemColor, EmblemStyle, GetId(), GetName(), GetType(), LOG_DEBUG, WorldSession::SendPacket(), and SMSG_ARENA_TEAM_QUERY_RESPONSE.
void ArenaTeam::Roster | ( | WorldSession * | session | ) |
References ObjectAccessor::FindConnectedPlayer(), GetCaptain(), GetId(), Unit::GetLevel(), GetMembersSize(), GetType(), LOG_DEBUG, Members, sCharacterCache, WorldSession::SendPacket(), and SMSG_ARENA_TEAM_ROSTER.
void ArenaTeam::SaveToDB | ( | bool | forceMemberSave = false | ) |
References CHAR_REP_CHARACTER_ARENA_STATS, CHAR_UPD_ARENA_TEAM_MEMBER, CHAR_UPD_ARENA_TEAM_STATS, CharacterDatabase, GetId(), GetSlot(), Members, PreparedStatementBase::SetData(), and sScriptMgr.
Referenced by Arena::EndBattleground().
void ArenaTeam::SendStats | ( | WorldSession * | session | ) |
References GetId(), WorldSession::SendPacket(), and SMSG_ARENA_TEAM_STATS.
Referenced by NotifyStatsChanged().
|
inline |
void ArenaTeam::SetCaptain | ( | ObjectGuid | guid | ) |
References ARENA_TEAM_MEMBER, CaptainGuid, CHAR_UPD_ARENA_TEAM_CAPTAIN, CharacterDatabase, ObjectAccessor::FindConnectedPlayer(), GetCaptain(), ObjectGuid::GetCounter(), GetId(), GetSlot(), Player::SetArenaTeamInfoField(), and PreparedStatementBase::SetData().
Referenced by arena_commandscript::HandleArenaCaptainCommand(), and WorldSession::HandleArenaTeamLeaderOpcode().
bool ArenaTeam::SetName | ( | std::string const & | name | ) |
References CHAR_UPD_ARENA_TEAM_NAME, CharacterDatabase, GetId(), ObjectMgr::IsValidCharterName(), PreparedStatementBase::SetData(), sObjectMgr, and TeamName.
Referenced by arena_commandscript::HandleArenaRenameCommand().
|
inline |
References PreviousOpponents.
Referenced by Arena::EndBattleground().
void ArenaTeam::UpdateArenaPointsHelper | ( | std::map< ObjectGuid, uint32 > & | PlayerPoints | ) |
References CONFIG_ARENA_GAMES_REQUIRED, GetPoints(), Members, and sWorld.
int32 ArenaTeam::WonAgainst | ( | uint32 | Own_MMRating, |
uint32 | Opponent_MMRating, | ||
int32 & | rating_change, | ||
const Map * | bgMap | ||
) |
References FinishGame(), GetMatchmakerRatingMod(), and GetRatingMod().
Referenced by Arena::EndBattleground().
Referenced by GetReqPlayersForType().
Referenced by Player::_LoadArenaTeamInfo(), and GetSlotByType().
|
protected |
Referenced by Create(), CreateTempArenaTeam(), LoadArenaTeamFromDB(), and Query().
|
protected |
Referenced by Create(), CreateTempArenaTeam(), LoadArenaTeamFromDB(), and Query().
|
protected |
Referenced by Create(), CreateTempArenaTeam(), LoadArenaTeamFromDB(), and Query().
|
protected |
Referenced by AddMember(), Create(), CreateTempArenaTeam(), GetCaptain(), LoadArenaTeamFromDB(), and SetCaptain().
|
protected |
Referenced by Create(), CreateTempArenaTeam(), LoadArenaTeamFromDB(), and Query().
|
protected |
Referenced by Create(), CreateTempArenaTeam(), LoadArenaTeamFromDB(), and Query().
|
protected |
Referenced by AddMember(), BroadcastPacket(), CreateTempArenaTeam(), DelMember(), Disband(), Empty(), FinishGame(), FinishWeek(), GetAverageMMR(), GetMember(), GetMembers(), GetMembersSize(), IsFighting(), IsMember(), LoadMembersFromDB(), m_membersBegin(), m_membersEnd(), MassInviteToEvent(), MemberLost(), MemberWon(), NotifyStatsChanged(), Roster(), SaveToDB(), and UpdateArenaPointsHelper().
|
protected |
Referenced by GetPreviousOpponents(), and SetPreviousOpponents().
|
protected |
Referenced by CreateTempArenaTeam(), and GetStats().
|
protected |
Referenced by Create(), CreateTempArenaTeam(), GetName(), LoadArenaTeamFromDB(), and SetName().
|
protected |
Referenced by Create(), CreateTempArenaTeam(), FinishGame(), GetPoints(), GetType(), and LoadArenaTeamFromDB().