Exemple #1
0
        public virtual C2S.Message.ReqJoin ReqJoin(string message)
        {
            Message.ReqJoin data = JsonConvert.DeserializeObject <Message.ReqJoin>(message);
            if (OnReqJoin != null)
            {
                OnReqJoin(message, data);
            }

            return(data);
        }
 public bool ReqJoin(UdpClient client, String uid, String group)
 {
     if (client == null) return false;
     Message.ReqJoin msg = new Message.ReqJoin();
     msg.id = "104";
     msg.uid = uid;
     msg.group = group;
     string jsonmsg = JsonConvert.SerializeObject(msg);
     byte[] data = UTF8Encoding.UTF8.GetBytes(jsonmsg);
     client.Send(data, data.Length);
     return true;
 }
Exemple #3
0
        public bool ReqJoin(UdpClient client, String uid, String group)
        {
            if (client == null)
            {
                return(false);
            }
            Message.ReqJoin msg = new Message.ReqJoin();
            msg.id    = "104";
            msg.uid   = uid;
            msg.group = group;
            string jsonmsg = JsonConvert.SerializeObject(msg);

            byte[] data = UTF8Encoding.UTF8.GetBytes(jsonmsg);
            client.Send(data, data.Length);
            return(true);
        }