public virtual S2C.Message.NotifyJoin NotifyJoin(string message) { Message.NotifyJoin data = JsonConvert.DeserializeObject <Message.NotifyJoin>(message); if (OnNotifyJoin != null) { OnNotifyJoin(message, data); } return(data); }
public bool NotifyJoin(UdpClient client, String uid, String group, String public_ip, ushort public_port) { if (client == null) return false; Message.NotifyJoin msg = new Message.NotifyJoin(); msg.id = "103"; msg.uid = uid; msg.group = group; msg.public_ip = public_ip; msg.public_port = public_port; string jsonmsg = JsonConvert.SerializeObject(msg); byte[] data = UTF8Encoding.UTF8.GetBytes(jsonmsg); client.Send(data, data.Length); return true; }
public bool NotifyJoin(UdpClient client, String uid, String group, String public_ip, ushort public_port) { if (client == null) { return(false); } Message.NotifyJoin msg = new Message.NotifyJoin(); msg.id = "103"; msg.uid = uid; msg.group = group; msg.public_ip = public_ip; msg.public_port = public_port; string jsonmsg = JsonConvert.SerializeObject(msg); byte[] data = UTF8Encoding.UTF8.GetBytes(jsonmsg); client.Send(data, data.Length); return(true); }