aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Groups/Group.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-08-02 13:25:41 +0200
committerShauren <shauren.trinity@gmail.com>2024-08-02 13:25:41 +0200
commite59eef5432c7b70679d33f4911c88d0f7d75fd39 (patch)
treefe9bce9c82496589facec3719b3f2943d8295e76 /src/server/game/Groups/Group.cpp
parent7fb9168d57f378075b0f6692ea7ad822c1d8e43d (diff)
Core/PacketIO: Updated to 11.0.0
Diffstat (limited to 'src/server/game/Groups/Group.cpp')
-rw-r--r--src/server/game/Groups/Group.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index 289c4dc39ea..14d94305ba6 100644
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -198,6 +198,7 @@ bool Group::Create(Player* leader)
stmt->setUInt32(index++, uint8(m_raidDifficulty));
stmt->setUInt32(index++, uint8(m_legacyRaidDifficulty));
stmt->setUInt64(index++, m_masterLooterGuid.GetCounter());
+ stmt->setInt8(index++, int8(m_pingRestriction));
CharacterDatabase.Execute(stmt);
@@ -243,6 +244,8 @@ void Group::LoadGroupFromDB(Field* fields)
m_masterLooterGuid = ObjectGuid::Create<HighGuid::Player>(fields[16].GetUInt64());
+ m_pingRestriction = RestrictPingsTo(fields[18].GetInt8());
+
if (m_groupFlags & GROUP_FLAG_LFG)
sLFGMgr->_LoadFromDB(fields, GetGUID());
}
@@ -867,6 +870,8 @@ void Group::SendUpdateToPlayer(ObjectGuid playerGUID, MemberSlot const* slot) co
partyUpdate.SequenceNum = player->NextGroupUpdateSequenceNumber(m_groupCategory);
+ partyUpdate.PingRestriction = m_pingRestriction;
+
partyUpdate.MyIndex = -1;
uint8 index = 0;
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr, ++index)
@@ -1899,23 +1904,20 @@ void Group::SetEveryoneIsAssistant(bool apply)
SendUpdate();
}
-bool Group::IsRestrictPingsToAssistants() const
+RestrictPingsTo Group::GetRestrictPings() const
{
- return (m_groupFlags & GROUP_FLAG_RESTRICT_PINGS) != 0;
+ return m_pingRestriction;
}
-void Group::SetRestrictPingsToAssistants(bool restrictPingsToAssistants)
+void Group::SetRestrictPingsTo(RestrictPingsTo restrictTo)
{
- if (restrictPingsToAssistants)
- m_groupFlags = GroupFlags(m_groupFlags | GROUP_FLAG_RESTRICT_PINGS);
- else
- m_groupFlags = GroupFlags(m_groupFlags & ~GROUP_FLAG_RESTRICT_PINGS);
+ m_pingRestriction = restrictTo;
if (!isBGGroup() && !isBFGroup())
{
- CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_PING_RESTRICTION);
- stmt->setUInt16(0, m_groupFlags);
+ stmt->setInt8(0, int8(m_pingRestriction));
stmt->setUInt32(1, m_dbStoreId);
CharacterDatabase.Execute(stmt);