public virtual S2C.Message.ResJoin ResJoin(string message) { Message.ResJoin data = JsonConvert.DeserializeObject <Message.ResJoin>(message); if (OnResJoin != null) { OnResJoin(message, data); } return(data); }
public bool ResJoin(UdpClient client, String uid, bool is_ok, String error_msg) { if (client == null) return false; Message.ResJoin msg = new Message.ResJoin(); msg.id = "102"; msg.uid = uid; msg.is_ok = is_ok; msg.error_msg = error_msg; string jsonmsg = JsonConvert.SerializeObject(msg); byte[] data = UTF8Encoding.UTF8.GetBytes(jsonmsg); client.Send(data, data.Length); return true; }
public bool ResJoin(UdpClient client, String uid, bool is_ok, String error_msg) { if (client == null) { return(false); } Message.ResJoin msg = new Message.ResJoin(); msg.id = "102"; msg.uid = uid; msg.is_ok = is_ok; msg.error_msg = error_msg; string jsonmsg = JsonConvert.SerializeObject(msg); byte[] data = UTF8Encoding.UTF8.GetBytes(jsonmsg); client.Send(data, data.Length); return(true); }