nexusforever/Source/NexusForever.Shared/Network/Packet/ClientGamePacket.cs
2018-10-09 12:03:35 +13:00

19 lines
571 B
C#

using System.IO;
using NexusForever.Shared.Network.Message;
namespace NexusForever.Shared.Network.Packet
{
public class ClientGamePacket : GamePacket
{
public ClientGamePacket(byte[] data)
{
using (var stream = new MemoryStream(data))
using (var reader = new GamePacketReader(stream))
{
Opcode = (GameMessageOpcode)reader.ReadUShort();
Data = reader.ReadBytes(reader.BytesRemaining);
Size = (uint)Data.Length + HeaderSize;
}
}
}
}