private static SocketIOPacket CreateMessagePacket(JArray JsonArray, int PacketID) { SocketIOPacket Packet = new SocketIOPacket { JsonData = JsonArray, IsJson = true }; if (PacketID >= 0) { Packet.ID = PacketID; } using (Deconstructor Deconstructor = new Deconstructor()) { Deconstructor.SetPacket(Packet); Packet = Deconstructor.Deconstruct(); if (Packet.Attachments.Count > 0) { Packet.IsJson = false; } } return(Packet); }
private static SocketIOPacket CreateMessagePacket(JArray JsonArray, int PacketID, bool JsonOnly) { SocketIOPacket Packet = new SocketIOPacket() { EnginePacketType = EngineIOPacketType.MESSAGE }; Packet.JsonData = JsonArray; Packet.IsJson = true; if (PacketID >= 0) { Packet.ID = PacketID; } if (!JsonOnly) { using (Deconstructor Deconstructor = new Deconstructor()) { Deconstructor.SetPacket(Packet); Packet = Deconstructor.Deconstruct(); if (Packet.Attachments.Count > 0) { Packet.IsJson = false; } } } return(Packet); }