예제 #1
0
 public void FixedUpdate()
 {
     while (_cache.Count > 0)
     {
         if (_cache [0].headCode != APIS.HEART_RESPONSE)
         {
             Debug.Log("res: " + _cache [0].headCode.ToString("x8") + " , " + APIS.getCmdName(_cache [0].headCode) + " ,\n " + _cache [0].message);
         }
         try {
             onResponse(_cache [0]);
         } catch (Exception e) {
             Debug.Log("命令出错:" + _cache [0].headCode.ToString("x8") + " " + _cache [0].message);
             Debug.Log(e.ToString());
         }
         _cache.RemoveAt(0);
     }
     if (_isDisconnet)
     {
         _isDisconnet = false;
         if (onDisconnect != null)
         {
             onDisconnect();
         }
     }
 }
예제 #2
0
        public void requset(int cmd, string msg = "")
        {
            if (cmd != APIS.HEART_REQUEST)
            {
                Debug.Log("req: " + cmd.ToString("x8") + " , " + APIS.getCmdName(cmd) + " ,\n " + msg);
            }

            _socket.sendMsg(new ClientRequest(cmd, msg));
        }
예제 #3
0
        public void FixedUpdate()
        {
            while (_cache.Count > 0)
            {
                Debug.Log("res: " + _cache [0].headCode.ToString("x8") + " , " + APIS.getCmdName(_cache [0].headCode) + " ,\n " + _cache [0].message);
                try {
                    onResponse(_cache [0]);
                } catch (Exception e) {
                    Debug.Log("命令出错:" + _cache [0].headCode.ToString("x8") + " " + _cache [0].message);
                    Debug.Log(e.ToString());
                }

                _cache.RemoveAt(0);
            }
        }
예제 #4
0
        public void requset(ClientRequest q)
        {
            Debug.Log("req: " + q.headCode.ToString("x8") + " , " + APIS.getCmdName(q.headCode) + " ,\n " + q.msg);
            switch (q.headCode)
            {
            case APIS.LOGIN_REQUEST:
                qq(APIS.BACK_LOGIN_RESPONSE, "{\"addWordCard\":false,\"currentRound\":1,\"endStatistics\":{},\"hong\":false,\"id\":19,\"ma\":0,\"name\":\"\",\"playerList\":[{\"IP\":\"\",\"account\":{\"actualcard\":5,\"city\":\"深圳\",\"createtime\":{\"date\":14,\"day\":6,\"hours\":0,\"minutes\":51,\"month\":9,\"seconds\":22,\"time\":1507913482000,\"timezoneOffset\":-480,\"year\":117},\"headicon\":\"\",\"id\":12,\"isGame\":\"1\",\"lastlogintime\":{\"date\":1,\"day\":0,\"hours\":0,\"minutes\":0,\"month\":0,\"seconds\":0,\"time\":1483200000000,\"timezoneOffset\":-480,\"year\":117},\"managerUpId\":1,\"nickname\":\"11\",\"openid\":\"11\",\"prizecount\":70,\"province\":\"广东省\",\"roomcard\":4,\"sex\":1,\"status\":\"0\",\"totalcard\":5,\"unionid\":\"11\",\"uuid\":100011},\"chiArray\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"chupais\":[2,24,8,1],\"commonCards\":10,\"gangArray\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"hasMopaiChupai\":true,\"huReturnObjectVO\":{\"gangAndHuInfos\":{},\"gangScore\":0,\"nickname\":\"\",\"paiArray\":[],\"totalInfo\":{\"peng\":\"30\"},\"totalScore\":0,\"uuid\":0},\"huType\":1,\"isOnLine\":true,\"isReady\":false,\"main\":true,\"paiArray\":[[0,0,0,1,1,0,0,0,0,0,0,2,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,3,0,0,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0]],\"pengArray\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0],\"roomId\":324333,\"scores\":1000},{\"IP\":\"\",\"account\":{\"actualcard\":5,\"city\":\"深圳\",\"createtime\":{\"date\":7,\"day\":6,\"hours\":22,\"minutes\":18,\"month\":9,\"seconds\":45,\"time\":1507385925000,\"timezoneOffset\":-480,\"year\":117},\"headicon\":\"\",\"id\":9,\"isGame\":\"1\",\"lastlogintime\":{\"date\":1,\"day\":0,\"hours\":0,\"minutes\":0,\"month\":0,\"seconds\":0,\"time\":1483200000000,\"timezoneOffset\":-480,\"year\":117},\"managerUpId\":1,\"nickname\":\"22\",\"openid\":\"22\",\"prizecount\":70,\"province\":\"广东省\",\"roomcard\":5,\"sex\":1,\"status\":\"0\",\"totalcard\":5,\"unionid\":\"22\",\"uuid\":100008},\"chiArray\":[0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"chupais\":[28,32],\"commonCards\":10,\"gangArray\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"hasMopaiChupai\":true,\"huReturnObjectVO\":{\"gangAndHuInfos\":{},\"gangScore\":0,\"nickname\":\"\",\"paiArray\":[],\"totalInfo\":{\"chi\":\"100008:6:7:8\"},\"totalScore\":0,\"uuid\":0},\"huType\":0,\"isOnLine\":true,\"isReady\":false,\"main\":false,\"paiArray\":[[0,0,0,0,0,1,1,1,1,0,1,0,0,2,0,1,0,1,0,0,0,0,1,1,0,1,0,0,0,1,0,0,0,0],[0,0,0,0,0,0,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],\"pengArray\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"roomId\":324333,\"scores\":1000},{\"IP\":\"\",\"account\":{\"actualcard\":5,\"city\":\"深圳\",\"createtime\":{\"date\":7,\"day\":6,\"hours\":22,\"minutes\":18,\"month\":9,\"seconds\":48,\"time\":1507385928000,\"timezoneOffset\":-480,\"year\":117},\"headicon\":\"\",\"id\":10,\"isGame\":\"1\",\"lastlogintime\":{\"date\":1,\"day\":0,\"hours\":0,\"minutes\":0,\"month\":0,\"seconds\":0,\"time\":1483200000000,\"timezoneOffset\":-480,\"year\":117},\"managerUpId\":1,\"nickname\":\"33\",\"openid\":\"33\",\"prizecount\":70,\"province\":\"广东省\",\"roomcard\":5,\"sex\":1,\"status\":\"0\",\"totalcard\":5,\"unionid\":\"33\",\"uuid\":100009},\"chiArray\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"chupais\":[27,31],\"commonCards\":13,\"gangArray\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"hasMopaiChupai\":true,\"huReturnObjectVO\":{\"gangAndHuInfos\":{},\"gangScore\":0,\"nickname\":\"\",\"paiArray\":[],\"totalInfo\":{},\"totalScore\":0,\"uuid\":0},\"huType\":0,\"isOnLine\":true,\"isReady\":false,\"main\":false,\"paiArray\":[[0,1,0,0,0,1,1,0,0,0,0,0,2,1,0,0,0,0,0,0,0,0,1,1,0,1,1,0,2,0,0,0,1,0],[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],\"pengArray\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"roomId\":324333,\"scores\":1000},{\"IP\":\"\",\"account\":{\"actualcard\":5,\"city\":\"深圳\",\"createtime\":{\"date\":7,\"day\":6,\"hours\":22,\"minutes\":18,\"month\":9,\"seconds\":50,\"time\":1507385930000,\"timezoneOffset\":-480,\"year\":117},\"headicon\":\"\",\"id\":11,\"isGame\":\"1\",\"lastlogintime\":{\"date\":1,\"day\":0,\"hours\":0,\"minutes\":0,\"month\":0,\"seconds\":0,\"time\":1483200000000,\"timezoneOffset\":-480,\"year\":117},\"managerUpId\":1,\"nickname\":\"44\",\"openid\":\"44\",\"prizecount\":70,\"province\":\"广东省\",\"roomcard\":5,\"sex\":1,\"status\":\"0\",\"totalcard\":5,\"unionid\":\"44\",\"uuid\":100010},\"chiArray\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"chupais\":[27,32,31,10,5],\"commonCards\":0,\"gangArray\":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"hasMopaiChupai\":true,\"huReturnObjectVO\":{\"gangAndHuInfos\":{},\"gangScore\":0,\"nickname\":\"\",\"paiArray\":[],\"totalInfo\":{\"peng\":\"18,0,9\"},\"totalScore\":0,\"uuid\":0},\"huType\":0,\"isOnLine\":true,\"isReady\":false,\"main\":false,\"paiArray\":[[3,0,0,1,0,0,0,0,0,3,0,0,0,0,0,1,0,0,3,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],\"pengArray\":[1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"roomId\":324333,\"scores\":1000}],\"roomId\":324333,\"roomType\":3,\"roundNumber\":8,\"sevenDouble\":false,\"xiaYu\":0,\"ziMo\":0}");
                break;

            case APIS.RETURN_ONLINE_REQUEST:
                qq(APIS.RETURN_ONLINE_RESPONSE, "{\"curAvatarIndex\":3,\"currentCardPoint\":3,\"gameRound\":7,\"pickAvatarIndex\":3,\"putOffCardPoint\":5,\"surplusCards\":72}");
                qq(APIS.HUPAI_RESPONSE, "{\"avatarList\":[{\"fanCount\":1,\"gangAndHuInfos\":{\"2\":[1,2]},\"gangScore\":0,\"nickname\":\"11\",\"paiArray\":[1,1,1,1,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"totalInfo\":{\"hu\":\"100070:12:d_self:2\"},\"totalScore\":2,\"uuid\":100068},{\"fanCount\":0,\"gangAndHuInfos\":{},\"gangScore\":0,\"nickname\":\"22\",\"paiArray\":[1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"totalInfo\":{},\"totalScore\":0,\"uuid\":100069},{\"fanCount\":0,\"gangAndHuInfos\":{\"3\":[2,-4]},\"gangScore\":0,\"nickname\":\"33\",\"paiArray\":[1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"totalInfo\":{\"hu\":\"100071:12:d_other:2,100068:12:d_other:2\"},\"totalScore\":-4,\"uuid\":100070},{\"fanCount\":1,\"gangAndHuInfos\":{\"2\":[1,2]},\"gangScore\":0,\"nickname\":\"44\",\"paiArray\":[1,1,1,1,1,1,1,1,1,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"totalInfo\":{\"hu\":\"100070:12:d_self:2\"},\"totalScore\":2,\"uuid\":100071}],\"currentScore\":\"100068:2,100069:0,100070:-4,100071:2,\",\"type\":\"0\",\"validMas\":[]}");
                break;

            case APIS.HUPAI_REQUEST:
                //qq (APIS.CHIPAI_NOTIFY, "{\"cardPoint\":6,\"onePoint\":7,\"twoPoint\":8,\"avatarId\":1}");


                break;
            }
        }
예제 #5
0
 public void requset(ChatRequest q)
 {
     Debug.Log("req: " + q.headCode.ToString("x8") + " , " + APIS.getCmdName(q.headCode) + " ,\n " + q.userList.ToArray());
     _chatSocket.sendMsg(q);
 }