Core/PacketIO: Updated to 11.0.0

Port From (https://github.com/TrinityCore/TrinityCore/commit/e59eef5432c7b70679d33f4911c88d0f7d75fd39)
This commit is contained in:
Hondacrx
2024-09-02 18:44:55 -04:00
parent bd0d40fa13
commit f38ad4607e
74 changed files with 4980 additions and 3595 deletions
+13 -9
View File
@@ -146,6 +146,7 @@ namespace Game.Groups
stmt.AddValue(index++, (byte)m_raidDifficulty);
stmt.AddValue(index++, (byte)m_legacyRaidDifficulty);
stmt.AddValue(index++, m_masterLooterGuid.GetCounter());
stmt.AddValue(index++, (sbyte)m_pingRestriction);
DB.Characters.Execute(stmt);
@@ -191,6 +192,8 @@ namespace Game.Groups
m_masterLooterGuid = ObjectGuid.Create(HighGuid.Player, field.Read<ulong>(16));
m_pingRestriction = (RestrictPingsTo)field.Read<sbyte>(18);
if (m_groupFlags.HasAnyFlag(GroupFlags.Lfg))
Global.LFGMgr._LoadFromDB(field, GetGUID());
}
@@ -819,6 +822,8 @@ namespace Game.Groups
partyUpdate.SequenceNum = player.NextGroupUpdateSequenceNumber(m_groupCategory);
partyUpdate.PingRestriction = m_pingRestriction;
partyUpdate.MyIndex = -1;
byte index = 0;
for (var i = 0; i < m_memberSlots.Count; ++i, ++index)
@@ -1883,23 +1888,20 @@ namespace Game.Groups
SendUpdate();
}
public bool IsRestrictPingsToAssistants()
public RestrictPingsTo GetRestrictPings()
{
return m_groupFlags.HasFlag(GroupFlags.RestrictPings);
return m_pingRestriction;
}
public void SetRestrictPingsToAssistants(bool restrictPingsToAssistants)
public void SetRestrictPingsTo(RestrictPingsTo restrictTo)
{
if (restrictPingsToAssistants)
m_groupFlags |= GroupFlags.RestrictPings;
else
m_groupFlags &= ~GroupFlags.RestrictPings;
m_pingRestriction = restrictTo;
if (!IsBGGroup() && !IsBFGroup())
{
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GROUP_TYPE);
PreparedStatement stmt = CharacterDatabase.GetPreparedStatement(CharStatements.UPD_GROUP_PING_RESTRICTION);
stmt.AddValue(0, (ushort)m_groupFlags);
stmt.AddValue(0, (sbyte)m_pingRestriction);
stmt.AddValue(1, m_dbStoreId);
DB.Characters.Execute(stmt);
@@ -1982,6 +1984,8 @@ namespace Game.Groups
uint m_activeMarkers;
CountdownInfo[] _countdowns = new CountdownInfo[3];
RestrictPingsTo m_pingRestriction;
}
public class MemberSlot
+2 -2
View File
@@ -107,8 +107,8 @@ namespace Game.Groups
// 0 1 2 3 4 5 6 7 8 9
SQLResult result = DB.Characters.Query("SELECT g.leaderGuid, g.lootMethod, g.looterGuid, g.lootThreshold, g.icon1, g.icon2, g.icon3, g.icon4, g.icon5, g.icon6" +
// 10 11 12 13 14 15 16 17 18 19
", g.icon7, g.icon8, g.groupType, g.difficulty, g.raiddifficulty, g.legacyRaidDifficulty, g.masterLooterGuid, g.guid, lfg.dungeon, lfg.state FROM `groups` g LEFT JOIN lfg_data lfg ON lfg.guid = g.guid ORDER BY g.guid ASC");
// 10 11 12 13 14 15 16 17 18 19 20
", g.icon7, g.icon8, g.groupType, g.difficulty, g.raiddifficulty, g.legacyRaidDifficulty, g.masterLooterGuid, g.guid, g.pingRestriction, lfg.dungeon, lfg.state FROM `groups` g LEFT JOIN lfg_data lfg ON lfg.guid = g.guid ORDER BY g.guid ASC");
if (result.IsEmpty())
{
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 group definitions. DB table `groups` is empty!");