aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Groups
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-02-09 21:08:35 +0100
committerShauren <shauren.trinity@gmail.com>2025-02-09 21:08:35 +0100
commit8565ba987668be1ebd435d4c4edd3874ee2261ec (patch)
tree50c6cd4ae8b21af89ee49f4ad1437db3ba4f87a1 /src/server/game/Groups
parentde9340ccec2d53d4b090bc6ebfadd67cc77d7f5a (diff)
Core/PacketIO: Converted BattlegroundPackets to classes
Diffstat (limited to 'src/server/game/Groups')
-rw-r--r--src/server/game/Groups/Group.cpp9
-rw-r--r--src/server/game/Groups/Group.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index 135fee4c58d..7c17d794c0e 100644
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -2013,8 +2013,10 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed)
}
}
-GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* bgOrTemplate, BattlegroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 /*MaxPlayerCount*/, bool isRated, uint32 arenaSlot)
+GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* bgOrTemplate, BattlegroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 /*MaxPlayerCount*/, bool isRated, uint32 arenaSlot, ObjectGuid& errorGuid) const
{
+ errorGuid = ObjectGuid::Empty;
+
// check if this group is LFG group
if (isLFGGroup())
return ERR_LFG_CANT_USE_BATTLEGROUND;
@@ -2044,12 +2046,13 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
// check every member of the group to be able to join
memberscount = 0;
- for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next(), ++memberscount)
+ for (GroupReference const* itr = GetFirstMember(); itr != nullptr; itr = itr->next(), ++memberscount)
{
Player* member = itr->GetSource();
// offline member? don't let join
if (!member)
return ERR_BATTLEGROUND_JOIN_FAILED;
+ errorGuid = member->GetGUID();
// rbac permissions
if (!member->CanJoinToBattleground(bgOrTemplate))
return ERR_BATTLEGROUND_JOIN_TIMED_OUT;
@@ -2087,6 +2090,8 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
return ERR_BATTLEGROUND_JOIN_FAILED;
}
+ errorGuid = ObjectGuid::Empty;
+
// only check for MinPlayerCount since MinPlayerCount == MaxPlayerCount for arenas...
if (bgOrTemplate->isArena() && memberscount != MinPlayerCount)
return ERR_ARENA_TEAM_PARTY_SIZE;
diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h
index f03a2fc44fa..8c43bba5301 100644
--- a/src/server/game/Groups/Group.h
+++ b/src/server/game/Groups/Group.h
@@ -257,7 +257,7 @@ class TC_GAME_API Group
void SetBattlegroundGroup(Battleground* bg);
void SetBattlefieldGroup(Battlefield* bf);
- GroupJoinBattlegroundResult CanJoinBattlegroundQueue(Battleground const* bgOrTemplate, BattlegroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot);
+ GroupJoinBattlegroundResult CanJoinBattlegroundQueue(Battleground const* bgOrTemplate, BattlegroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot, ObjectGuid& errorGuid) const;
void ChangeMembersGroup(ObjectGuid guid, uint8 group);
void SetTargetIcon(uint8 id, ObjectGuid whoGuid, ObjectGuid targetGuid);