aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Groups/Group.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-09-14 00:11:06 +0200
committerShauren <shauren.trinity@gmail.com>2023-09-14 00:11:06 +0200
commitc2f5ce2b0333a9bda341ea837340dd3ac4b19ae8 (patch)
tree15a8bacce27533a2ebaa85ec2aa31c22eabccc94 /src/server/game/Groups/Group.cpp
parent097b5f3ec00f18161c9d616f60ed762eb722bde0 (diff)
Core/Groups: Implemented 10.1.7 ping system
Diffstat (limited to 'src/server/game/Groups/Group.cpp')
-rw-r--r--src/server/game/Groups/Group.cpp50
1 files changed, 44 insertions, 6 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index 55a481c8fc7..ee431dca54f 100644
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -173,7 +173,7 @@ bool Group::Create(Player* leader)
stmt->setBinary(index++, m_targetIcons[5].GetRawValue());
stmt->setBinary(index++, m_targetIcons[6].GetRawValue());
stmt->setBinary(index++, m_targetIcons[7].GetRawValue());
- stmt->setUInt8(index++, uint8(m_groupFlags));
+ stmt->setUInt16(index++, m_groupFlags);
stmt->setUInt32(index++, uint8(m_dungeonDifficulty));
stmt->setUInt32(index++, uint8(m_raidDifficulty));
stmt->setUInt32(index++, uint8(m_legacyRaidDifficulty));
@@ -213,7 +213,7 @@ void Group::LoadGroupFromDB(Field* fields)
for (uint8 i = 0; i < TARGET_ICONS_COUNT; ++i)
m_targetIcons[i].SetRawValue(fields[4 + i].GetBinary());
- m_groupFlags = GroupFlags(fields[12].GetUInt8());
+ m_groupFlags = GroupFlags(fields[12].GetUInt16());
if (m_groupFlags & GROUP_FLAG_RAID)
_initRaidSubGroupsCounter();
@@ -242,6 +242,9 @@ void Group::LoadMemberFromDB(ObjectGuid::LowType guidLow, uint8 memberFlags, uin
return;
}
+ if (m_groupFlags & GROUP_FLAG_EVERYONE_ASSISTANT)
+ memberFlags |= MEMBER_FLAG_ASSISTANT;
+
member.name = character->Name;
member.race = Races(character->Race);
member._class = character->Class;
@@ -266,7 +269,7 @@ void Group::ConvertToLFG()
{
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
- stmt->setUInt8(0, uint8(m_groupFlags));
+ stmt->setUInt16(0, m_groupFlags);
stmt->setUInt32(1, m_dbStoreId);
CharacterDatabase.Execute(stmt);
@@ -285,7 +288,7 @@ void Group::ConvertToRaid()
{
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
- stmt->setUInt8(0, uint8(m_groupFlags));
+ stmt->setUInt16(0, m_groupFlags);
stmt->setUInt32(1, m_dbStoreId);
CharacterDatabase.Execute(stmt);
@@ -304,7 +307,7 @@ void Group::ConvertToGroup()
if (m_memberSlots.size() > 5)
return; // What message error should we send?
- m_groupFlags = GroupFlags(GROUP_FLAG_NONE);
+ m_groupFlags = GroupFlags(m_groupFlags & ~GROUP_FLAG_RAID);
if (m_subGroupsCounts)
{
@@ -316,7 +319,7 @@ void Group::ConvertToGroup()
{
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
- stmt->setUInt8(0, uint8(m_groupFlags));
+ stmt->setUInt16(0, m_groupFlags);
stmt->setUInt32(1, m_dbStoreId);
CharacterDatabase.Execute(stmt);
@@ -1847,5 +1850,40 @@ void Group::SetEveryoneIsAssistant(bool apply)
for (member_witerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr)
ToggleGroupMemberFlag(itr, MEMBER_FLAG_ASSISTANT, apply);
+ if (!isBGGroup() && !isBFGroup())
+ {
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
+
+ stmt->setUInt16(0, m_groupFlags);
+ stmt->setUInt32(1, m_dbStoreId);
+
+ CharacterDatabase.Execute(stmt);
+ }
+
+ SendUpdate();
+}
+
+bool Group::IsRestrictPingsToAssistants() const
+{
+ return (m_groupFlags & GROUP_FLAG_RESTRICT_PINGS) != 0;
+}
+
+void Group::SetRestrictPingsToAssistants(bool restrictPingsToAssistants)
+{
+ if (restrictPingsToAssistants)
+ m_groupFlags = GroupFlags(m_groupFlags | GROUP_FLAG_RESTRICT_PINGS);
+ else
+ m_groupFlags = GroupFlags(m_groupFlags & ~GROUP_FLAG_RESTRICT_PINGS);
+
+ if (!isBGGroup() && !isBFGroup())
+ {
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GROUP_TYPE);
+
+ stmt->setUInt16(0, m_groupFlags);
+ stmt->setUInt32(1, m_dbStoreId);
+
+ CharacterDatabase.Execute(stmt);
+ }
+
SendUpdate();
}