68 bool isPremade =
false;
78 TC_LOG_ERROR(
"network",
"Battleground: invalid bg queue {{ BattlemasterListId: {}, Type: {}, Rated: {}, TeamSize: {} }} received. possible cheater? {}",
111 auto getQueueTeam = [&]() ->
Team
202 TC_LOG_DEBUG(
"bg.battleground",
"Battleground: player joined queue for bg queue {{ BattlemasterListId: {}, Type: {}, Rated: {}, TeamSize: {} }}, {}, NAME {}",
221 TC_LOG_DEBUG(
"bg.battleground",
"Battleground: the following players are joining as group:");
222 ginfo = bgQueue.
AddGroup(
_player, grp, getQueueTeam(), bracketEntry,
false, isPremade, 0, 0);
228 Player* member = itr->GetSource();
235 sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bgQueueTypeId,
_player, 0, err, &errorGuid);
244 sBattlegroundMgr->BuildBattlegroundStatusQueued(&battlefieldStatus, member, queueSlot, ginfo->
JoinTime, bgQueueTypeId, avgTime,
true);
246 TC_LOG_DEBUG(
"bg.battleground",
"Battleground: player joined queue for bg queue {{ BattlemasterListId: {}, Type: {}, Rated: {}, TeamSize: {} }}, {}, NAME {}",
250 TC_LOG_DEBUG(
"bg.battleground",
"Battleground: group end");
274 if (!battlemasterListEntry)
287 TC_LOG_DEBUG(
"bg.battleground",
"CMSG_BATTLEFIELD_PORT {} Slot: {}, Unk: {}, Time: {}, AcceptedInvite: {}. Player not in queue!",
295 TC_LOG_DEBUG(
"bg.battleground",
"CMSG_BATTLEFIELD_PORT {} Slot: {}, Unk: {}, Time: {}, AcceptedInvite: {}. Invalid queueSlot!",
306 TC_LOG_DEBUG(
"bg.battleground",
"CMSG_BATTLEFIELD_PORT {} Slot: {}, Unk: {}, Time: {}, AcceptedInvite: {}. Player not in queue (No player Group Info)!",
313 TC_LOG_DEBUG(
"bg.battleground",
"CMSG_BATTLEFIELD_PORT {} Slot: {}, Unk: {}, Time: {}, AcceptedInvite: {}. Player is not invited to any bg!",
322 TC_LOG_ERROR(
"network",
"BattlegroundHandle: BattlegroundTemplate not found for type id {}.", bgTypeId);
333 TC_LOG_DEBUG(
"bg.battleground",
"CMSG_BATTLEFIELD_PORT {} Slot: {}, Unk: {}, Time: {}, AcceptedInvite: {}. Cant find BG with id {}!",
340 TC_LOG_DEBUG(
"bg.battleground",
"CMSG_BATTLEFIELD_PORT {} Slot: {}, Unk: {}, Time: {}, AcceptedInvite: {}.",
364 TC_LOG_ERROR(
"network",
"Player {} {} has level ({}) higher than maxlevel ({}) of battleground ({})! Do not port him to battleground!",
411 TC_LOG_DEBUG(
"bg.battleground",
"Battleground: player {} ({}) joined battle for bg {}, bgtype {}, queue {{ BattlemasterListId: {}, Type: {}, Rated: {}, TeamSize: {} }}.",
439 TC_LOG_DEBUG(
"bg.battleground",
"Battleground: player {} ({}) left queue for bgtype {}, queue {{ BattlemasterListId: {}, Type: {}, Rated: {}, TeamSize: {} }}.",
470 if (bgPlayer && bgPlayer->
queueTypeId == bgQueueTypeId)
528 TC_LOG_ERROR(
"network",
"Battleground: template bg (all arenas) not found");
562 if (arenaRating <= 0)
582 Player* member = itr->GetSource();
589 sBattlegroundMgr->BuildBattlegroundStatusFailed(&battlefieldStatus, bgQueueTypeId,
_player, 0, err, &errorGuid);
606 sBattlegroundMgr->BuildBattlegroundStatusQueued(&battlefieldStatus, member, queueSlot, ginfo->
JoinTime, bgQueueTypeId, avgTime,
true);
609 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__,...)
#define TC_LOG_ERROR(filterType__,...)
#define TC_LOG_INFO(filterType__,...)
float constexpr MAX_AREA_SPIRIT_HEALER_RANGE
GroupJoinBattlegroundResult
constexpr BattlegroundQueueTypeId BATTLEGROUND_QUEUE_NONE
static constexpr uint8 PLAYER_MAX_BATTLEGROUND_QUEUES
@ ERR_BATTLEGROUND_JOIN_TIMED_OUT
@ ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS
@ ERR_LFG_CANT_USE_BATTLEGROUND
@ ERR_BATTLEGROUND_JOIN_FAILED
@ ERR_BATTLEGROUND_TOO_MANY_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)
uint32 GetAverageMMR(Group *group) const
static uint8 GetTypeBySlot(uint8 slot)
static BattlegroundQueueTypeId BGQueueTypeId(uint16 battlemasterListId, BattlegroundQueueIdType type, bool rated, uint8 teamSize)
static bool IsValidQueueId(BattlegroundQueueTypeId bgQueueTypeId)
static bool IsRandomBattleground(uint32 battlemasterListId)
GroupQueueInfo * AddGroup(Player const *leader, Group const *group, Team team, PVPDifficultyEntry const *bracketEntry, bool isPremade, uint32 ArenaRating, uint32 MatchmakerRating, uint32 ArenaTeamId=0)
uint32 GetAverageQueueWaitTime(GroupQueueInfo *ginfo, BattlegroundBracketId bracket_id) const
BattlegroundQueueTypeId const GetQueueId() 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(const char *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
GroupReference * GetFirstMember()
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
static ObjectGuid GetGUID(Object const *o)
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 TeleportTo(uint32 mapid, float x, float y, float z, float orientation, TeleportToOptions options=TELE_TO_NONE, Optional< uint32 > instanceId={})
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 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
BattlemasterListEntry const * BattlemasterEntry
uint16 GetMaxPlayersPerTeam() const
uint16 GetMinPlayersPerTeam() const
EnumFlag< BattlemasterListFlags > GetFlags() const
std::array< int16, 16 > MapID
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