예제 #1
0
 public void Request(NpCloudServerData parameter)
 {
     if (!this.IsConnected)
     {
         throw new NpCloudException(760, "ソケットに未接続");
     }
     this.SocketInstance.Request(parameter);
 }
예제 #2
0
 private byte[] CreateRequestBuffer(uint uid, NpCloudServerData param)
 {
     byte[] array = this.CreateSystemBuffer(uid, this.CreateParameter(param), NpCloudHeaderType.CommonMsg);
     if (array.Length <= 0)
     {
         throw new NpCloudException(731, "送信データのバッファが異常でした");
     }
     return(array);
 }
        public void GetRoomMsgLog(string roomId, int limit)
        {
            NpChatLogRequestParameter npChatLogRequestParameter = new NpChatLogRequestParameter();

            npChatLogRequestParameter.roomId = roomId;
            npChatLogRequestParameter.limit  = limit;
            NpCloudServerData npCloudServerData = new NpCloudServerData();

            npCloudServerData.content = npChatLogRequestParameter;
            npCloudServerData.type    = NpCloudType.direct;
            npCloudServerData.ctrl    = "9202";
            npCloudServerData.value   = NpCloudValueType.chathis;
            NpCloudManager.GetInstance().Request(npCloudServerData);
        }
예제 #4
0
        public uint SequenceRequest <T>(T paramter, string ctrl, uint uid) where T : class
        {
            if (!this.IsConnected)
            {
                throw new NpCloudException(760, "ソケットに未接続");
            }
            NpCloudServerData npCloudServerData = new NpCloudServerData();

            npCloudServerData.ctrl    = ctrl;
            npCloudServerData.content = paramter;
            npCloudServerData.value   = NpCloudValueType.send;
            npCloudServerData.type    = NpCloudType.common;
            return(this.SocketInstance.SequenceRequest(uid, npCloudServerData));
        }
예제 #5
0
        private NpCloudRequestParameter CreateParameter(NpCloudServerData param)
        {
            Dictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("value", param.value.ToString());
            if (param.ctrl != null && !param.ctrl.Equals(string.Empty))
            {
                dictionary.Add("ctrl", param.ctrl);
            }
            return(new NpCloudRequestParameter
            {
                command = dictionary,
                content = param.content,
                type = param.type.ToString()
            });
        }
        public void SendRoomMessage(string roomId, string message)
        {
            NpChatRequestParameter npChatRequestParameter = new NpChatRequestParameter();

            npChatRequestParameter.msg.Add(message);
            npChatRequestParameter.ngcheck = 1;
            npChatRequestParameter.roomId  = roomId;
            npChatRequestParameter.to      = NpCloudManager.GetInstance().GetUserList(roomId);
            NpCloudServerData npCloudServerData = new NpCloudServerData();

            npCloudServerData.value   = NpCloudValueType.send;
            npCloudServerData.type    = NpCloudType.direct;
            npCloudServerData.content = npChatRequestParameter;
            npCloudServerData.ctrl    = "9201";
            NpCloudManager.GetInstance().Request(npCloudServerData);
        }
예제 #7
0
 public uint SequenceRequest(uint uid, NpCloudServerData param)
 {
     byte[] buffer = this.CreateRequestBuffer(uid, param);
     this.Request(buffer);
     return((uid != 0u) ? uid : this.mRequestCounter);
 }
예제 #8
0
 public void Request(NpCloudServerData param)
 {
     byte[] buffer = this.CreateRequestBuffer(param);
     this.Request(buffer);
 }
 public uint SequenceRequest(uint uid, NpCloudServerData param)
 {
     return(this.mSocketSystem.SequenceRequest(uid, param));
 }
 public void Request(NpCloudServerData param)
 {
     this.mSocketSystem.Request(param);
 }