Updated to 8.2.0.31429 (scripts disabled atm, they still need updated)
Code Port from TrinityCore https://github.com/TrinityCore/TrinityCore Casc from WoW-Tools https://github.com/WoW-Tools/CASCExplorer
This commit is contained in:
@@ -108,9 +108,9 @@ namespace Game.Network
|
||||
this.opcode = (uint)opcode;
|
||||
}
|
||||
|
||||
public WorldPacket(byte[] data, uint opcode) : base(data)
|
||||
public WorldPacket(byte[] data) : base(data)
|
||||
{
|
||||
this.opcode = opcode;
|
||||
opcode = ReadUInt16();
|
||||
}
|
||||
|
||||
public ObjectGuid ReadPackedGuid()
|
||||
@@ -223,18 +223,23 @@ namespace Game.Network
|
||||
uint opcode;
|
||||
}
|
||||
|
||||
public class ServerPacketHeader
|
||||
public class PacketHeader
|
||||
{
|
||||
public ServerPacketHeader(uint size, ServerOpcodes opcode)
|
||||
public int Size;
|
||||
public byte[] Tag = new byte[12];
|
||||
|
||||
public void Read(byte[] buffer)
|
||||
{
|
||||
Size = size + 2;
|
||||
Opcode = opcode;
|
||||
Size = BitConverter.ToInt32(buffer, 0);
|
||||
Buffer.BlockCopy(buffer, 4, Tag, 0, 12);
|
||||
}
|
||||
|
||||
data = BitConverter.GetBytes(Size).Combine(BitConverter.GetBytes((ushort)opcode));
|
||||
}
|
||||
public void Write(ByteBuffer byteBuffer)
|
||||
{
|
||||
byteBuffer.WriteInt32(Size);
|
||||
byteBuffer.WriteBytes(Tag, 12);
|
||||
}
|
||||
|
||||
public ServerOpcodes Opcode { get; set; }
|
||||
public uint Size { get; set; }
|
||||
public byte[] data { get; set; }
|
||||
public bool IsValidSize() { return Size < 0x10000; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user