public virtual C2S.Message.ReqChat ReqChat(string message) { Message.ReqChat data = JsonConvert.DeserializeObject <Message.ReqChat>(message); if (OnReqChat != null) { OnReqChat(message, data); } return(data); }
public bool ReqChat(UdpClient client, String uid, String group, String chat) { if (client == null) return false; Message.ReqChat msg = new Message.ReqChat(); msg.id = "101"; msg.uid = uid; msg.group = group; msg.chat = chat; string jsonmsg = JsonConvert.SerializeObject(msg); byte[] data = UTF8Encoding.UTF8.GetBytes(jsonmsg); client.Send(data, data.Length); return true; }
public bool ReqChat(UdpClient client, String uid, String group, String chat) { if (client == null) { return(false); } Message.ReqChat msg = new Message.ReqChat(); msg.id = "101"; msg.uid = uid; msg.group = group; msg.chat = chat; string jsonmsg = JsonConvert.SerializeObject(msg); byte[] data = UTF8Encoding.UTF8.GetBytes(jsonmsg); client.Send(data, data.Length); return(true); }