69 bool isPremade =
false;
79 TC_LOG_ERROR(
"network",
"Battleground: invalid bg queue {{ BattlemasterListId: {}, Type: {}, Rated: {}, TeamSize: {} }} received. possible cheater? {}",
112 auto getQueueTeam = [&]() ->
Team
203 TC_LOG_DEBUG(
"bg.battleground",
"Battleground: player joined queue for bg queue {{ BattlemasterListId: {}, Type: {}, Rated: {}, TeamSize: {} }}, {}, NAME {}",
222 TC_LOG_DEBUG(
"bg.battleground",
"Battleground: the following players are joining as group:");
223 ginfo = bgQueue.
AddGroup(
_player, grp, getQueueTeam(), bracketEntry,
false, isPremade, 0);
229 Player* member = itr.GetSource();
244 TC_LOG_DEBUG(
"bg.battleground",
"Battleground: player joined queue for bg queue {{ BattlemasterListId: {}, Type: {}, Rated: {}, TeamSize: {} }}, {}, NAME {}",
248 TC_LOG_DEBUG(
"bg.battleground",
"Battleground: group end");
272 if (!battlemasterListEntry)
285 TC_LOG_DEBUG(
"bg.battleground",
"CMSG_BATTLEFIELD_PORT {} Slot: {}, Unk: {}, Time: {}, AcceptedInvite: {}. Player not in queue!",
293 TC_LOG_DEBUG(
"bg.battleground",
"CMSG_BATTLEFIELD_PORT {} Slot: {}, Unk: {}, Time: {}, AcceptedInvite: {}. Invalid queueSlot!",
304 TC_LOG_DEBUG(
"bg.battleground",
"CMSG_BATTLEFIELD_PORT {} Slot: {}, Unk: {}, Time: {}, AcceptedInvite: {}. Player not in queue (No player Group Info)!",
311 TC_LOG_DEBUG(
"bg.battleground",
"CMSG_BATTLEFIELD_PORT {} Slot: {}, Unk: {}, Time: {}, AcceptedInvite: {}. Player is not invited to any bg!",
320 TC_LOG_ERROR(
"network",
"BattlegroundHandle: BattlegroundTemplate not found for type id {}.", bgTypeId);
331 TC_LOG_DEBUG(
"bg.battleground",
"CMSG_BATTLEFIELD_PORT {} Slot: {}, Unk: {}, Time: {}, AcceptedInvite: {}. Cant find BG with id {}!",
338 TC_LOG_DEBUG(
"bg.battleground",
"CMSG_BATTLEFIELD_PORT {} Slot: {}, Unk: {}, Time: {}, AcceptedInvite: {}.",
362 TC_LOG_ERROR(
"network",
"Player {} {} has level ({}) higher than maxlevel ({}) of battleground ({})! Do not port him to battleground!",
409 TC_LOG_DEBUG(
"bg.battleground",
"Battleground: player {} ({}) joined battle for bg {}, bgtype {}, queue {{ BattlemasterListId: {}, Type: {}, Rated: {}, TeamSize: {} }}.",
437 TC_LOG_DEBUG(
"bg.battleground",
"Battleground: player {} ({}) left queue for bgtype {}, queue {{ BattlemasterListId: {}, Type: {}, Rated: {}, TeamSize: {} }}.",
468 if (bgPlayer && bgPlayer->
queueTypeId == bgQueueTypeId)
526 TC_LOG_ERROR(
"network",
"Battleground: template bg (all arenas) not found");
558 uint32 matchmakerRating = 1;
560 if (arenaRating <= 0)
583 Player* member = itr.GetSource();
607 TC_LOG_DEBUG(
"bg.battleground",
"Battleground: player joined queue for arena as group bg queue {{ BattlemasterListId: {}, Type: {}, Rated: {}, TeamSize: {} }}, {}, NAME {}",
@ SPELL_SPIRIT_HEAL_PLAYER_AURA
@ SPELL_MERCENARY_CONTRACT_ALLIANCE
@ SPELL_MERCENARY_CONTRACT_HORDE
@ SPELL_SPIRIT_HEAL_CHANNEL_SELF
DB2Storage< BattlemasterListEntry > sBattlemasterListStore("BattlemasterList.db2", &BattlemasterListLoadInfo::Instance)
DB2Storage< AreaTableEntry > sAreaTableStore("AreaTable.db2", &AreaTableLoadInfo::Instance)
@ AllowHearthAndRessurectFromArea
@ DISABLE_TYPE_BATTLEGROUND
@ LANG_YOUR_BG_LEVEL_REQ_ERROR
#define TC_LOG_DEBUG(filterType__, message__,...)
#define TC_LOG_ERROR(filterType__, message__,...)
#define TC_LOG_INFO(filterType__, message__,...)
float constexpr MAX_AREA_SPIRIT_HEALER_RANGE
GroupJoinBattlegroundResult
@ ERR_BATTLEGROUND_JOIN_TIMED_OUT
@ ERR_BATTLEGROUND_JOIN_FAILED
@ ERR_LFG_CANT_USE_BATTLEGROUND
@ ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS
@ ERR_BATTLEGROUND_TOO_MANY_QUEUES
constexpr BattlegroundQueueTypeId BATTLEGROUND_QUEUE_NONE
static constexpr uint8 PLAYER_MAX_BATTLEGROUND_QUEUES
@ BATTLEGROUND_RANDOM_EPIC
uint32 getMSTimeDiff(uint32 oldMSTime, uint32 newMSTime)
@ UNIT_NPC_FLAG_BATTLEMASTER
void SaveToDB(bool forceMemberSave=false)
void MemberLost(Player *player, uint32 againstMatchmakerRating, int32 MatchmakerRatingChange=-12)
static uint8 GetTypeBySlot(uint8 slot)
ObjectGuid const & GetGUID() const
static void BuildBattlegroundStatusNeedConfirmation(WorldPackets::Battleground::BattlefieldStatusNeedConfirmation *battlefieldStatus, Battleground const *bg, Player const *player, uint32 ticketId, uint32 joinTime, uint32 timeout, BattlegroundQueueTypeId queueId)
static void BuildBattlegroundStatusActive(WorldPackets::Battleground::BattlefieldStatusActive *battlefieldStatus, Battleground const *bg, Player const *player, uint32 ticketId, uint32 joinTime, BattlegroundQueueTypeId queueId)
static BattlegroundQueueTypeId BGQueueTypeId(uint16 battlemasterListId, BattlegroundQueueIdType type, bool rated, uint8 teamSize)
static void SendToBattleground(Player *player, Battleground const *battleground)
static bool IsValidQueueId(BattlegroundQueueTypeId bgQueueTypeId)
static bool IsRandomBattleground(uint32 battlemasterListId)
static void BuildBattlegroundStatusQueued(WorldPackets::Battleground::BattlefieldStatusQueued *battlefieldStatus, Player const *player, uint32 ticketId, uint32 joinTime, BattlegroundQueueTypeId queueId, uint32 avgWaitTime, bool asGroup)
static void BuildBattlegroundStatusFailed(WorldPackets::Battleground::BattlefieldStatusFailed *battlefieldStatus, BattlegroundQueueTypeId queueId, Player const *player, uint32 ticketId, GroupJoinBattlegroundResult result, ObjectGuid const *errorGuid=nullptr)
BattlegroundQueueTypeId GetQueueId() const
GroupQueueInfo * AddGroup(Player const *leader, Group const *group, Team team, PVPDifficultyEntry const *bracketEntry, bool isPremade, uint32 ArenaRating, uint32 MatchmakerRating)
uint32 GetAverageQueueWaitTime(GroupQueueInfo *ginfo, BattlegroundBracketId bracket_id) const
bool GetPlayerGroupInfoData(ObjectGuid guid, GroupQueueInfo *ginfo)
void RemovePlayer(ObjectGuid guid, bool decreaseInvitedCount)
BattlegroundTypeId GetTypeID() const
uint32 GetInstanceID() const
BattlegroundPlayer const * GetBattlegroundPlayerData(ObjectGuid const &playerGuid) const
uint32 GetMaxLevel() const
virtual void BuildPvPLogDataPacket(WorldPackets::Battleground::PVPMatchStatistics &pvpLogData) const
void PSendSysMessage(char const *fmt, Args &&... args)
void SetHomePosition(float x, float y, float z, float o)
CreatureMovementData const & GetMovementTemplate() const
static PVPDifficultyEntry const * GetBattlegroundBracketByLevel(uint32 mapid, uint32 level)
uint32 GetMembersCount() const
GroupRefManager & GetMembers()
bool Create(Player *leader)
ObjectGuid GetLeaderGUID() const
GroupJoinBattlegroundResult CanJoinBattlegroundQueue(BattlegroundTemplate const *bgOrTemplate, BattlegroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot, ObjectGuid &errorGuid) const
static ObjectGuid const Empty
std::string ToString() const
bool InBattlegroundQueueForBattlegroundQueueType(BattlegroundQueueTypeId bgQueueTypeId) const
void SetBGTeam(Team team)
Creature * GetNPCIfCanInteractWith(ObjectGuid const &guid, NPCFlags npcFlags, NPCFlags2 npcFlags2) const
void SetBattlegroundId(uint32 val, BattlegroundTypeId bgTypeId, BattlegroundQueueTypeId queueId)
void SendDirectMessage(WorldPacket const *data) const
bool IsInvitedForBattlegroundQueueType(BattlegroundQueueTypeId bgQueueTypeId) const
void SetBattlegroundEntryPoint()
bool InBattleground() const
void SpawnCorpseBones(bool triggerSave=true)
void LeaveBattleground(bool teleportToEntryPoint=true)
uint32 GetBattlegroundQueueJoinTime(BattlegroundQueueTypeId bgQueueTypeId) const
bool InBattlegroundQueue(bool ignoreArena=false) const
WorldSession * GetSession() const
void RemoveBattlegroundQueueId(BattlegroundQueueTypeId val)
void SendAreaSpiritHealerTime(Unit *spiritHealer) const
void SendPvpRewards() const
Send conquest currency points and their cap week/arena.
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, TeleportToOptions options=TELE_TO_NONE, Optional< uint32 > instanceId={}, uint32 teleportSpellId=0)
bool CanJoinToBattleground(BattlegroundTemplate const *bg) const
bool HasFreeBattlegroundQueueId() const
Battleground * GetBattleground() const
uint32 AddBattlegroundQueueId(BattlegroundQueueTypeId val)
uint32 GetBattlegroundQueueIndex(BattlegroundQueueTypeId bgQueueTypeId) const
void SetAreaSpiritHealer(Creature *creature)
Group * GetGroup(Optional< uint8 > partyIndex)
void ReportedAfkBy(Player *reporter)
This player has been blamed to be inactive in a battleground.
uint32 GetArenaTeamId(uint8) const
BattlegroundQueueTypeId GetBattlegroundQueueTypeId(uint32 index) const
bool GetBGAccessByLevel(BattlegroundTypeId bgTypeId) const
void ResurrectPlayer(float restore_percent, bool applySickness=false)
bool IsAreaSpiritHealer() const
bool IsAreaSpiritHealerIndividual() const
void PauseMovement(uint32 timer=0, uint8 slot=0, bool forced=true)
Aura * GetAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
bool HasAura(uint32 spellId, ObjectGuid casterGUID=ObjectGuid::Empty, ObjectGuid itemCasterGUID=ObjectGuid::Empty, uint32 reqEffMask=0) const
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
std::string const & GetName() const
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool incOwnRadius=true, bool incTargetRadius=true) const
WorldPackets::LFG::RideTicket Ticket
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPacket const * Write() override
WorldPackets::LFG::RideTicket Ticket
WorldPacket const * Write() override
WorldPacket const * Write() override
Array< uint64, 1 > QueueIDs
WorldPacket const * Write() override
bool WargameBattlegrounds
bool RatedBattlegroundBlitz
WorldPacket const * Write() override
WorldPacket const * Write() override
Underlying AsUnderlyingType() const
void HandleHearthAndResurrect(WorldPackets::Battleground::HearthAndResurrect &hearthAndResurrect)
void HandleBattlefieldLeaveOpcode(WorldPackets::Battleground::BattlefieldLeave &battlefieldLeave)
void HandleRequestBattlefieldStatusOpcode(WorldPackets::Battleground::RequestBattlefieldStatus &requestBattlefieldStatus)
void SendNotification(char const *format,...) ATTR_PRINTF(2
std::string GetPlayerInfo() const
void HandleGetPVPOptionsEnabled(WorldPackets::Battleground::GetPVPOptionsEnabled &getPvPOptionsEnabled)
Player * GetPlayer() const
void HandleRequestRatedPvpInfo(WorldPackets::Battleground::RequestRatedPvpInfo &packet)
void HandleBattleFieldPortOpcode(WorldPackets::Battleground::BattlefieldPort &battlefieldPort)
void HandleAreaSpiritHealerQueueOpcode(WorldPackets::Battleground::AreaSpiritHealerQueue &areaSpiritHealerQueue)
std::string const & GetRemoteAddress() const
void SendPacket(WorldPacket const *packet, bool forced=false)
Send a packet to the client.
void HandleBattlemasterJoinArena(WorldPackets::Battleground::BattlemasterJoinArena &packet)
void HandleBattlemasterJoinOpcode(WorldPackets::Battleground::BattlemasterJoin &battlemasterJoin)
void HandleRequestPvpReward(WorldPackets::Battleground::RequestPVPRewards &packet)
void HandleAreaSpiritHealerQueryOpcode(WorldPackets::Battleground::AreaSpiritHealerQuery &areaSpiritHealerQuery)
void HandlePVPLogDataOpcode(WorldPackets::Battleground::PVPLogDataRequest &pvpLogDataRequest)
void HandleReportPvPAFK(WorldPackets::Battleground::ReportPvPPlayerAFK &reportPvPPlayerAFK)
void HandleBattlefieldListOpcode(WorldPackets::Battleground::BattlefieldListRequest &battlefieldList)
void HandleBattlemasterHelloOpcode(WorldPackets::NPC::Hello &hello)
bool IsDisabledFor(DisableType type, uint32 entry, WorldObject const *ref, uint8 flags)
TC_GAME_API Player * FindPlayer(ObjectGuid const &)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
EnumFlag< AreaFlags > GetFlags() const
BattlegroundQueueTypeId queueTypeId
static constexpr BattlegroundQueueTypeId FromPacked(uint64 packedQueueId)
uint16 BattlemasterListId
uint16 GetMaxPlayersPerTeam() const
std::vector< int32 > MapIDs
uint16 GetMinPlayersPerTeam() const
EnumFlag< BattlemasterListFlags > GetFlags() const
uint32 GetInteractionPauseTimer() const
uint32 IsInvitedToBGInstanceGUID
std::map< ObjectGuid, PlayerQueueInfo * > Players
uint32 OpponentsMatchmakerRating
uint32 OpponentsTeamRating
uint32 ArenaMatchmakerRating
BattlegroundBracketId GetBracketId() const
constexpr void GetPosition(float &x, float &y) const