Пример #1
0
        public virtual S2C.Message.NotifyJoin NotifyJoin(string message)
        {
            Message.NotifyJoin data = JsonConvert.DeserializeObject <Message.NotifyJoin>(message);
            if (OnNotifyJoin != null)
            {
                OnNotifyJoin(message, data);
            }

            return(data);
        }
Пример #2
0
 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;
 }
Пример #3
0
        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);
        }