public static T Deserialize <T>(this CoflnetEncoder encoder, MessageEventArgs args) { return(encoder.Deserialize <T>(args.RawData)); }
public static ServerCommandData Deserialize(this CoflnetEncoder encoder, MessageEventArgs args) { return(encoder.Deserialize <ServerCommandData>(args.RawData)); }
/// <summary> /// Send the specified data after encoding with the given socket. /// </summary> /// <param name="encoder">Encoder.</param> /// <param name="data">Data.</param> /// <param name="socket">Socket.</param> /// <typeparam name="T">The 1st type parameter.</typeparam> public static void Send <T>(this CoflnetEncoder encoder, T data, CoflnetWebsocketServer socket) { socket.SendBack(encoder.Serialize <T>(data)); }
public static CommandData SerializeServerCommandData <T>(T target, string type, CoflnetEncoder encoder) { return(new CommandData(type, encoder.Serialize <T>(target))); }