Core/PacketIO: Updated packet structures to 11.0.5

Port From (https://github.com/TrinityCore/TrinityCore/commit/5f37b29f41b6cb3fbcc3dc6bc0cf3a25c1f7eb6a)
This commit is contained in:
Hondacrx
2024-11-11 11:36:52 -05:00
parent 9ccc3f7e05
commit 0080898785
9 changed files with 39 additions and 13 deletions
+2
View File
@@ -698,6 +698,8 @@ namespace Game
broadcastPingUnit.Type = pingUnit.Type;
broadcastPingUnit.PinFrameID = pingUnit.PinFrameID;
broadcastPingUnit.PingDuration = pingUnit.PingDuration;
broadcastPingUnit.CreatureID = pingUnit.CreatureID;
broadcastPingUnit.SpellOverrideNameID = pingUnit.SpellOverrideNameID;
broadcastPingUnit.Write();
for (GroupReference itr = group.GetFirstMember(); itr != null; itr = itr.Next())
-1
View File
@@ -477,7 +477,6 @@ namespace Game
price -= MathFunctions.CalculatePct(price, priceMod);
item.MuID = (int)slot + 1;
item.Durability = (int)itemTemplate.MaxDurability;
item.ExtendedCostID = (int)vendorItem.ExtendedCost;
item.Type = (int)vendorItem.Type;
item.Quantity = leftInStock;
@@ -609,16 +609,16 @@ namespace Game.Networking.Packets
{
_worldPacket.WriteInt32(Items.Count);
_worldPacket.WriteUInt32(Unknown830);
_worldPacket.WriteUInt32(TotalCount);
_worldPacket.WriteUInt32(DesiredDelay);
foreach (AuctionItem item in Items)
item.Write(_worldPacket);
_worldPacket.WriteBits((int)ListType, 2);
_worldPacket.WriteBit(HasMoreResults);
_worldPacket.FlushBits();
BucketKey.Write(_worldPacket);
foreach (AuctionItem item in Items)
item.Write(_worldPacket);
_worldPacket.WriteUInt32(TotalCount);
}
}
@@ -76,7 +76,7 @@ namespace Game.Networking.Packets
{
_worldPacket.WritePackedGuid(VendorGUID);
_worldPacket.WriteUInt32(Muid);
_worldPacket.WriteUInt8((byte)Reason);
_worldPacket.WriteUInt32((uint)Reason);
}
public ObjectGuid VendorGUID;
@@ -1241,7 +1241,7 @@ namespace Game.Networking.Packets
public void Write(WorldPacket data)
{
data.WriteUInt16((ushort)MessageID);
data.WriteUInt32((uint)MessageID);
data.WriteUInt32(SequenceIndex);
data.WriteBit(Speed.HasValue);
data.WriteBit(SpeedRange != null);
+2 -4
View File
@@ -145,14 +145,14 @@ namespace Game.Networking.Packets
public override void Write()
{
_worldPacket.WritePackedGuid(Vendor);
_worldPacket.WriteUInt8(Reason);
_worldPacket.WriteInt32(Reason);
_worldPacket.WriteInt32(Items.Count);
foreach (VendorItemPkt item in Items)
item.Write(_worldPacket);
}
public byte Reason = 0;
public int Reason;
public List<VendorItemPkt> Items = new();
public ObjectGuid Vendor;
}
@@ -428,7 +428,6 @@ namespace Game.Networking.Packets
data.WriteUInt64(Price);
data.WriteInt32(MuID);
data.WriteInt32(Type);
data.WriteInt32(Durability);
data.WriteInt32(StackCount);
data.WriteInt32(Quantity);
data.WriteInt32(ExtendedCostID);
@@ -446,7 +445,6 @@ namespace Game.Networking.Packets
public ItemInstance Item = new();
public int Quantity = -1;
public ulong Price;
public int Durability;
public int StackCount;
public int ExtendedCostID;
public int PlayerConditionFailed;
@@ -965,6 +965,8 @@ namespace Game.Networking.Packets
public PingSubjectType Type = PingSubjectType.Max;
public uint PinFrameID;
public TimeSpan PingDuration;
public uint CreatureID;
public uint SpellOverrideNameID;
public SendPingUnit(WorldPacket packet) : base(packet) { }
@@ -975,6 +977,14 @@ namespace Game.Networking.Packets
Type = (PingSubjectType)_worldPacket.ReadUInt8();
PinFrameID = _worldPacket.ReadUInt32();
PingDuration = TimeSpan.FromMilliseconds(_worldPacket.ReadInt32());
bool hasCreatureID = _worldPacket.HasBit();
bool hasSpellOverrideNameID = _worldPacket.HasBit();
if (hasCreatureID)
CreatureID = _worldPacket.ReadUInt32();
if (hasSpellOverrideNameID)
SpellOverrideNameID = _worldPacket.ReadUInt32();
}
}
@@ -985,6 +995,8 @@ namespace Game.Networking.Packets
public PingSubjectType Type = PingSubjectType.Max;
public uint PinFrameID;
public TimeSpan PingDuration;
public uint? CreatureID;
public uint? SpellOverrideNameID;
public ReceivePingUnit() : base(ServerOpcodes.ReceivePingUnit) { }
@@ -995,6 +1007,15 @@ namespace Game.Networking.Packets
_worldPacket.WriteUInt8((byte)Type);
_worldPacket.WriteUInt32(PinFrameID);
_worldPacket.WriteInt32((int)PingDuration.TotalMilliseconds);
_worldPacket.WriteBit(CreatureID.HasValue);
_worldPacket.WriteBit(SpellOverrideNameID.HasValue);
_worldPacket.FlushBits();
if (CreatureID.HasValue)
_worldPacket.WriteUInt32(CreatureID.Value);
if (SpellOverrideNameID.HasValue)
_worldPacket.WriteUInt32(SpellOverrideNameID.Value);
}
}
@@ -15,6 +15,7 @@ namespace Game.Networking.Packets
public int Price;
public long AvailableUntil;
public bool Disabled;
public bool Field_41;
public void Write(WorldPacket data)
{
@@ -28,6 +29,7 @@ namespace Game.Networking.Packets
data.WriteInt32(Price);
data.WriteInt64(AvailableUntil);
data.WriteBit(Disabled);
data.WriteBit(Field_41);
data.FlushBits();
}
}
@@ -1155,7 +1155,7 @@ namespace Game.Networking.Packets
{
Guid = _worldPacket.ReadPackedGuid();
CastID = _worldPacket.ReadPackedGuid();
MoveMsgID = _worldPacket.ReadUInt16();
MoveMsgID = _worldPacket.ReadUInt32();
SpellID = _worldPacket.ReadUInt32();
Pitch = _worldPacket.ReadFloat();
Speed = _worldPacket.ReadFloat();
@@ -1170,7 +1170,7 @@ namespace Game.Networking.Packets
public ObjectGuid Guid;
public ObjectGuid CastID;
public ushort MoveMsgID;
public uint MoveMsgID;
public uint SpellID;
public float Pitch;
public float Speed;
@@ -1348,6 +1348,8 @@ namespace Game.Networking.Packets
data.WriteInt32(AttackPower);
data.WriteInt32(SpellPower);
data.WriteUInt32(Armor);
data.WriteInt32(Unknown_1105_1);
data.WriteInt32(Unknown_1105_2);
data.WriteBits(PowerData.Count, 9);
data.FlushBits();
@@ -1363,6 +1365,8 @@ namespace Game.Networking.Packets
int AttackPower;
int SpellPower;
uint Armor;
int Unknown_1105_1;
int Unknown_1105_2;
List<SpellLogPowerData> PowerData = new();
}