[StructLayout(LayoutKind.Sequential, Pack = 1)] public class Packet { /// /// Type of packet. /// public enum TypeID : byte { Account = 0x00, Character = 0x01, Speech = 0x02, Movement = 0x03, Server = 0x04, Utility = 0x09 } /// /// Constructor. /// public Packet() { ID = 0xff; SubID = 0xff; } /// /// Returns the ID of a byte array destined to be converted to a packet. /// /// /// public static byte GetID(byte[] Data) { return Data[0]; } /// /// Returns the Sub ID of a byte array destined to be converted to a packet. /// /// /// public static byte GetSubID(byte[] Data) { return Data[1]; } /// /// The type of packet. /// public byte ID; /// /// The sub-type of packet. /// public byte SubID; /// /// The total size, in bytes, of the packet. /// public UInt32 Size; /// /// Connected client that sent this packet /// public ConnectedClient Client; }