public RSN_Packet(string _token, RSN_PacketType _type, int _id, string _body, int _parseType) { body = _body; token = _token; type = _type; id = _id; parseType = _parseType; }
public static void SendDataToClient(NetworkStream stream, string body, int messageId, int parseType, string token = " ", RSN_PacketType type = RSN_PacketType.EncodedMessage) { //Create packet RSN_Packet packet = new RSN_Packet(token, type, messageId, body, parseType); //Decode byte[] data = packet.EncodePacket(); //Send it over stream.Write(data, 0, data.Length); }