public RelayPacket(byte[] data, PacketContains flags) { /* * // Parses raw-content to a packet-body * // and we'll assume the id are set by * // a inherited class or network manager. * // * // However this time the raw-data will have some * // flags. That says the raw data contains an size * // along with some other stuff */ //if (flags == PacketContains.HasId) //{ // this.data = new byte[data.Length - 2]; // Array.Copy(data, 0, this.id, 0, 2); // Array.Copy(data, 2, this.data, 0, data.Length - 2); //} //else //{ // this.data = new byte[data.Length - 4]; // Array.Copy(data, 2, this.id, 0, 2); // Array.Copy(data, 4, this.data, 0, data.Length - 4); //} }
public RelayPacket(byte[] data, PacketContains flags) { /* // Parses raw-content to a packet-body // and we'll assume the id are set by // a inherited class or network manager. // // However this time the raw-data will have some // flags. That says the raw data contains an size // along with some other stuff */ //if (flags == PacketContains.HasId) //{ // this.data = new byte[data.Length - 2]; // Array.Copy(data, 0, this.id, 0, 2); // Array.Copy(data, 2, this.data, 0, data.Length - 2); //} //else //{ // this.data = new byte[data.Length - 4]; // Array.Copy(data, 2, this.id, 0, 2); // Array.Copy(data, 4, this.data, 0, data.Length - 4); //} }