Core/PacketIO: Updated packet structures to 8.1.5

Port TrinityCore Commit: https://github.com/TrinityCore/TrinityCore/commit/31fda79556e55375962a3c9e46f6dbdbf6e90d18
This commit is contained in:
hondacrx
2019-06-22 18:42:45 -04:00
parent d500b65ad9
commit e4d500f4b5
54 changed files with 1179 additions and 1077 deletions
+23 -6
View File
@@ -18,6 +18,7 @@
using Framework.Constants;
using Game.Entities;
using System.Collections.Generic;
using System;
namespace Game.Network.Packets
{
@@ -54,20 +55,36 @@ namespace Game.Network.Packets
_worldPacket.WriteBit(IsFullUpdate);
_worldPacket.FlushBits();
// both lists have to have the same size
// all lists have to have the same size
_worldPacket.WriteUInt32(Toys.Count);
_worldPacket.WriteUInt32(Toys.Count);
_worldPacket.WriteUInt32(Toys.Count);
foreach (var item in Toys)
_worldPacket.WriteUInt32(item.Key);
foreach (var pair in Toys)
_worldPacket.WriteUInt32(pair.Key);
foreach (var favourite in Toys)
_worldPacket.WriteBit(favourite.Value);
foreach (var pair in Toys)
_worldPacket.WriteBit(pair.Value.HasAnyFlag(ToyFlags.Favorite));
foreach (var pair in Toys)
_worldPacket.WriteBit(pair.Value.HasAnyFlag(ToyFlags.HasFanfare));
_worldPacket.FlushBits();
}
public bool IsFullUpdate = false;
public Dictionary<uint, bool> Toys = new Dictionary<uint, bool>();
public Dictionary<uint, ToyFlags> Toys = new Dictionary<uint, ToyFlags>();
}
class ToyClearFanfare : ClientPacket
{
public ToyClearFanfare(WorldPacket packet) : base(packet) { }
public override void Read()
{
ItemID = _worldPacket.ReadUInt32();
}
public uint ItemID;
}
}