Пример #1
0
 public void addResponse(ClientResponse response)
 {
     callBackResponseList.Add(response);
 }
Пример #2
0
 private void onSocketData(ClientResponse response)
 {
     _cache.Add(response);
 }
Пример #3
0
        private void dispatchHandle(ClientResponse response)
        {
            switch (response.headCode)
            {
            case APIS.CLOSE_RESPONSE:
                TipsManagerScript.getInstance().setTips("服务器关闭了");
                CustomSocket.getInstance().closeSocket();
                break;

            case APIS.LOGIN_RESPONSE:
                if (LoginCallBack != null)
                {
                    LoginCallBack(response);
                }
                break;

            case APIS.CREATEROOM_RESPONSE:
                if (CreateRoomCallBack != null)
                {
                    CreateRoomCallBack(response);
                }
                break;

            case APIS.JOIN_ROOM_RESPONSE:
                if (JoinRoomCallBack != null)
                {
                    JoinRoomCallBack(response);
                }
                break;

            case APIS.STARTGAME_RESPONSE_NOTICE:
                if (StartGameNotice != null)
                {
                    StartGameNotice(response);
                }
                break;

            case APIS.PICKCARD_RESPONSE:
                if (pickCardCallBack != null)
                {
                    pickCardCallBack(response);
                }
                break;

            case APIS.OTHER_PICKCARD_RESPONSE_NOTICE:
                if (otherPickCardCallBack != null)
                {
                    otherPickCardCallBack(response);
                }
                break;

            case APIS.CHUPAI_RESPONSE:
                if (putOutCardCallBack != null)
                {
                    putOutCardCallBack(response);
                }
                break;

            case APIS.CHUPAI_PDK_RESPONSE:
                if (PDK_putOutCardCallBack != null)
                {
                    PDK_putOutCardCallBack(response);
                }
                break;

            case APIS.CHIBUQI_PDK_RESPONSE:
                if (PDK_ChiBuQiCallBack != null)
                {
                    PDK_ChiBuQiCallBack(response);
                }
                break;

            case APIS.JOIN_ROOM_NOICE:
                if (otherUserJointRoomCallBack != null)
                {
                    otherUserJointRoomCallBack(response);
                }
                break;

            case APIS.JOIN_ROOM_IP_RESPONSE:
                if (JoinRoomIPCallBack != null)
                {
                    JoinRoomIPCallBack(response);
                }
                break;

            case APIS.PENGPAI_RESPONSE:
                if (PengCardCallBack != null)
                {
                    PengCardCallBack(response);
                }
                break;

            case APIS.CHI_RESPONSE:
                if (ChiCardCallBack != null)
                {
                    ChiCardCallBack(response);
                }
                break;

            case APIS.GANGPAI_RESPONSE:
                if (GangCardCallBack != null)
                {
                    GangCardCallBack(response);
                }
                break;

            case APIS.OTHER_GANGPAI_NOICE:
                if (gangCardNotice != null)
                {
                    gangCardNotice(response);
                }
                break;

            case APIS.RETURN_INFO_RESPONSE:
                if (btnActionShow != null)
                {
                    btnActionShow(response);
                }
                break;

            case APIS.HUPAI_RESPONSE:
                if (HupaiCallBack != null)
                {
                    HupaiCallBack(response);
                }
                break;

            case APIS.HUPAIBACKDZPK_RESPONSE:
                if (HupaiBackDzpkCallBack != null)
                {
                    HupaiBackDzpkCallBack(response);
                }
                break;

            case APIS.HUPAIALL_RESPONSE:
                if (FinalGameOverCallBack != null)
                {
                    FinalGameOverCallBack(response);
                }
                break;

            case APIS.OUT_ROOM_RESPONSE:
                if (outRoomCallback != null)
                {
                    outRoomCallback(response);
                }
                break;

            case APIS.headRESPONSE:
                break;

            case APIS.DISSOLIVE_ROOM_RESPONSE:
                if (dissoliveRoomResponse != null)
                {
                    dissoliveRoomResponse(response);
                }
                break;

            case APIS.PrepareGame_MSG_RESPONSE:
                if (gameReadyNotice != null)
                {
                    gameReadyNotice(response);
                }
                break;

            case APIS.MicInput_Response:
                if (micInputNotice != null)
                {
                    micInputNotice(response);
                }
                break;

            case APIS.MessageBox_Notice:
                if (messageBoxNotice != null)
                {
                    messageBoxNotice(response);
                }
                break;

            case APIS.ERROR_RESPONSE:
                if (serviceErrorNotice != null)
                {
                    serviceErrorNotice(response);
                }
                break;

            case APIS.BACK_LOGIN_RESPONSE:
                if (RoomBackResponse != null)
                {
                    RoomBackResponse(response);
                }

                break;

            case APIS.CARD_CHANGE:
                if (cardChangeNotice != null)
                {
                    cardChangeNotice(response);
                }
                break;

            case APIS.OFFLINE_NOTICE:
                if (offlineNotice != null)
                {
                    offlineNotice(response);
                }
                break;

            case APIS.RETURN_ONLINE_RESPONSE:

                if (returnGameResponse != null)
                {
                    returnGameResponse(response);
                }
                break;

            case APIS.PRIZE_RESPONSE:
                if (giftResponse != null)
                {
                    giftResponse(response);
                }
                break;

            case APIS.Game_FollowBander_Notice:
                if (gameFollowBanderNotice != null)
                {
                    gameFollowBanderNotice(response);
                }
                break;


            case APIS.ONLINE_NOTICE:
                if (onlineNotice != null)
                {
                    onlineNotice(response);
                }
                break;

            case APIS.GAME_BROADCAST:
                if (gameBroadcastNotice != null)
                {
                    gameBroadcastNotice(response);
                }
                break;

            case APIS.GAME_CONFIG:
                if (gameConfigNotice != null)
                {
                    gameConfigNotice(response);
                }
                break;

            case APIS.CONTACT_INFO_RESPONSE:
                if (contactInfoResponse != null)
                {
                    contactInfoResponse(response);
                }
                break;

            case APIS.HOST_UPDATEDRAW_RESPONSE:
                if (hostUpdateDrawResponse != null)
                {
                    hostUpdateDrawResponse(response);
                }
                break;

            case APIS.ZHANJI_REPORTER_REPONSE:
                if (zhanjiResponse != null)
                {
                    zhanjiResponse(response);
                }
                break;

            case APIS.ZHANJI_DETAIL_REPORTER_REPONSE:
                if (zhanjiDetailResponse != null)
                {
                    zhanjiDetailResponse(response);
                }
                break;

            case APIS.GAME_BACK_PLAY_RESPONSE:
                if (gameBackPlayResponse != null)
                {
                    gameBackPlayResponse(response);
                }
                break;

            case APIS.TIP_MESSAGE:
                TipsManagerScript.getInstance().setTips(response.message);
                break;

            case APIS.OTHER_TELE_LOGIN:
                if (otherTeleLogin != null)
                {
                    otherTeleLogin(response);
                }
                break;

            case APIS.QIANG_DN_RESPONSE:
                if (DN_qiangResponse != null)
                {
                    DN_qiangResponse(response);
                }
                break;

            case APIS.ZHUANG_DN_RESPONSE:
                if (DN_zhuangResponse != null)
                {
                    DN_zhuangResponse(response);
                }
                break;

            case APIS.ZHU_DN_RESPONSE:
                if (DN_xiaZhuResponse != null)
                {
                    DN_xiaZhuResponse(response);
                }
                break;

            case APIS.NIU_DN_RESPONSE:
                if (DN_niuResponse != null)
                {
                    DN_niuResponse(response);
                }
                break;

            case APIS.NIUNOTICE_DN_RESPONSE:
                if (DN_niuResponse != null)
                {
                    DN_niuNoticeResponse(response);
                }
                break;

            case APIS.NIUSETTLE_DN_RESPONSE:
                if (DN_niuSettleResponse != null)
                {
                    DN_niuSettleResponse(response);
                }
                break;

            case APIS.GENZHU_DZPK_RESPONSE:
                if (DZPK_genZhuResponse != null)
                {
                    DZPK_genZhuResponse(response);
                }
                break;

            case APIS.JIAZHU_DZPK_RESPONSE:
                if (DZPK_jiaZhuResponse != null)
                {
                    DZPK_jiaZhuResponse(response);
                }
                break;

            case APIS.QIPAI_DZPK_RESPONSE:
                if (DZPK_qiPaiResponse != null)
                {
                    DZPK_qiPaiResponse(response);
                }
                break;

            case APIS.RANGPAI_DZPK_RESPONSE:
                if (DZPK_rangPaiResponse != null)
                {
                    DZPK_rangPaiResponse(response);
                }
                break;

            case APIS.PUTOFF_DZPK_RESPONSE:
                if (DZPK_putOffResponse != null)
                {
                    DZPK_putOffResponse(response);
                }
                break;

            case APIS.FAPAI_DZPK_RESPONSE:
                if (DZPK_faPaiResponse != null)
                {
                    DZPK_faPaiResponse(response);
                }
                break;

            case APIS.ShangHuo_MSG_RESPONSE:
                if (shanghuoResponse != null)
                {
                    shanghuoResponse(response);
                }
                break;

            case APIS.CHEAT_Response:
                if (cheatCallBack != null)
                {
                    cheatCallBack(response);
                }
                break;
            }


            GlobalDataScript.headTime = GlobalDataScript.GetTimeStamp();
        }
Пример #4
0
        private void dispatchHandle(ClientResponse response)
        {
            switch (response.headCode)
            {
            case APIS.CLOSE_RESPONSE:
                TipsManagerScript.getInstance().setTips("服务器关闭了");
                CustomSocket.getInstance().closeSocket();
                break;

            case APIS.LOGIN_RESPONSE:
                if (LoginCallBack != null)
                {
                    LoginCallBack(response);
                }
                break;

            case APIS.START_PREPARE_GAME_RESPONSE:
            {
                Debug.LogError("let players enter game!! " + response.message);
                if (StartPrepareGameCallBack != null)
                {
                    StartPrepareGameCallBack(response);
                }
            }
            break;

            case APIS.CREATEROOM_RESPONSE:
                if (CreateRoomCallBack != null)
                {
                    CreateRoomCallBack(response);
                }
                break;

            case APIS.JOIN_ROOM_RESPONSE:
                if (JoinRoomCallBack != null)
                {
                    JoinRoomCallBack(response);
                }
                break;

            case APIS.STARTGAME_RESPONSE_NOTICE:
                if (StartGameNotice != null)
                {
                    StartGameNotice(response);
                }
                break;

            case APIS.PICKCARD_RESPONSE:
                if (pickCardCallBack != null)
                {
                    pickCardCallBack(response);
                }
                break;

            case APIS.OTHER_PICKCARD_RESPONSE_NOTICE:
                if (otherPickCardCallBack != null)
                {
                    otherPickCardCallBack(response);
                }
                break;

            case APIS.CHUPAI_RESPONSE:
                if (putOutCardCallBack != null)
                {
                    putOutCardCallBack(response);
                }
                break;

            case APIS.JOIN_ROOM_NOICE:
                if (otherUserJointRoomCallBack != null)
                {
                    otherUserJointRoomCallBack(response);
                }
                break;

            case APIS.PENGPAI_RESPONSE:
                if (PengCardCallBack != null)
                {
                    PengCardCallBack(response);
                }
                break;

            case APIS.GANGPAI_RESPONSE:
                if (GangCardCallBack != null)
                {
                    GangCardCallBack(response);
                }
                break;

            case APIS.OTHER_GANGPAI_NOICE:
                if (gangCardNotice != null)
                {
                    gangCardNotice(response);
                }
                break;

            case APIS.RETURN_INFO_RESPONSE:
                if (btnActionShow != null)
                {
                    btnActionShow(response);
                }
                break;

            case APIS.HUPAI_RESPONSE:
                if (HupaiCallBack != null)
                {
                    HupaiCallBack(response);
                }
                break;

            case APIS.TINGPAI_RESPONE:
                if (TingpaiCallBack != null)
                {
                    TingpaiCallBack(response);
                }
                break;

            case APIS.HUPAIALL_RESPONSE:
                if (FinalGameOverCallBack != null)
                {
                    FinalGameOverCallBack(response);
                }
                break;

            case APIS.OUT_ROOM_RESPONSE:
                if (outRoomCallback != null)
                {
                    outRoomCallback(response);
                }
                break;

            case APIS.headRESPONSE:
                if (hearBeateResponse != null)
                {
                    hearBeateResponse(response);
                }

                break;

            case APIS.DISSOLIVE_ROOM_RESPONSE:
                if (dissoliveRoomResponse != null)
                {
                    dissoliveRoomResponse(response);
                }
                break;

            case APIS.PrepareGame_MSG_RESPONSE:
                if (gameReadyNotice != null)
                {
                    gameReadyNotice(response);
                }
                break;

            case APIS.MicInput_Response:
                if (micInputNotice != null)
                {
                    micInputNotice(response);
                }
                break;

            case APIS.MessageBox_Notice:
                if (messageBoxNotice != null)
                {
                    messageBoxNotice(response);
                }
                break;

            case APIS.ERROR_RESPONSE:
                if (serviceErrorNotice != null)
                {
                    serviceErrorNotice(response);
                }
                break;

            case APIS.BACK_LOGIN_RESPONSE:
                if (RoomBackResponse != null)
                {
                    RoomBackResponse(response);
                }

                break;

            case APIS.CARD_CHANGE:
                if (cardChangeNotice != null)
                {
                    cardChangeNotice(response);
                }
                break;

            case APIS.OFFLINE_NOTICE:
                if (offlineNotice != null)
                {
                    offlineNotice(response);
                }
                break;

            case APIS.RETURN_ONLINE_RESPONSE:

                if (returnGameResponse != null)
                {
                    returnGameResponse(response);
                }
                break;

            case APIS.PRIZE_RESPONSE:
                if (giftResponse != null)
                {
                    giftResponse(response);
                }
                break;

            case APIS.Game_FollowBander_Notice:
                if (gameFollowBanderNotice != null)
                {
                    gameFollowBanderNotice(response);
                }
                break;


            case APIS.ONLINE_NOTICE:
                if (onlineNotice != null)
                {
                    onlineNotice(response);
                }
                break;

            case APIS.GAME_BROADCAST:
                if (gameBroadcastNotice != null)
                {
                    gameBroadcastNotice(response);
                }
                break;

            case APIS.CONTACT_INFO_RESPONSE:
                if (contactInfoResponse != null)
                {
                    contactInfoResponse(response);
                }
                break;

            case APIS.HOST_UPDATEDRAW_RESPONSE:
                if (hostUpdateDrawResponse != null)
                {
                    hostUpdateDrawResponse(response);
                }
                break;

            case APIS.ZHANJI_REPORTER_REPONSE:
                if (zhanjiResponse != null)
                {
                    zhanjiResponse(response);
                }
                break;

            case APIS.ZHANJI_DETAIL_REPORTER_REPONSE:
                if (zhanjiDetailResponse != null)
                {
                    zhanjiDetailResponse(response);
                }
                break;

            case APIS.GAME_BACK_PLAY_RESPONSE:
                if (gameBackPlayResponse != null)
                {
                    gameBackPlayResponse(response);
                }
                break;

            case APIS.TIP_MESSAGE:
                TipsManagerScript.getInstance().setTips(response.message);
                break;

            case APIS.OTHER_TELE_LOGIN:
                if (otherTeleLogin != null)
                {
                    otherTeleLogin(response);
                }
                break;

            case APIS.INVITE_RESPONSE:
                if (null != inviteResponse)
                {
                    inviteResponse(response);
                }
                break;

            case APIS.INVITE_GET_REWARD_RESPONSE:
                if (null != inviteGetRewardResponse)
                {
                    inviteGetRewardResponse(response);
                }
                break;

            case APIS.INVITE_HISTORY_RESPONSE:
                if (null != inviteHistoryResponse)
                {
                    inviteHistoryResponse(response);
                }
                break;

            case APIS.PAY_START_ORDER_RESPONSE:
                if (startPayOrderResponse != null)
                {
                    startPayOrderResponse(response);
                }
                break;

            case APIS.PAY_SUCCESS_RESPONSE:
                if (paySuccessResponse != null)
                {
                    paySuccessResponse(response);
                }
                if (response.status == 1)
                {
                    GlobalDataScript.loginResponseData.account.roomcard = int.Parse(response.message);
                    if (cardChangeNotice != null)
                    {
                        cardChangeNotice(response);
                    }
                }
                break;
            }
        }
Пример #5
0
        /**
         * 胡牌请求回调
         */
        private void onHuNotify(ClientResponse response)
        {
            HupaiResponseVo hvo = JsonMapper.ToObject <HupaiResponseVo> (response.message);

            _data.hupaiResponseVO = hvo;
            string scores = hvo.currentScore;

            hupaiCoinChange(scores);


            if (hvo.type == "0")
            {
                SoundManager.getInstance().playSoundByAction("hu", GlobalData.getInstance().myAvatarVO.account.sex);
                _actionHlpr.showEffect(ActionType.HU);

                for (int i = 0; i < hvo.avatarList.Count; i++)
                {
                    var item   = hvo.avatarList [i];
                    var hutype = GameHelper.getHelper().getHuType(item.totalInfo.getHuInfo());
                    if (hutype == HuType.JIE_PAO)
                    {
                        _uiHelper.getCardGOs(i).PlayerItem.setHuFlagDisplay();
                        SoundManager.getInstance().playSoundByAction("hu", avatarList [i].account.sex);
                    }
                    else if (hutype == HuType.ZI_MO)
                    {
                        _uiHelper.getCardGOs(i).PlayerItem.setHuFlagDisplay();
                        SoundManager.getInstance().playSoundByAction("zimo", avatarList [i].account.sex);
                    }
                    else
                    {
                        _uiHelper.getCardGOs(i).PlayerItem.setHuFlagHidde();
                    }
                }

                string allMas = hvo.allMas;
                if (GlobalData.getInstance().roomVO.roomType == GameType.ZHUAN_ZHUAN || GlobalData.getInstance().roomVO.roomType == GameType.JI_PING_HU)                    //只有转转麻将才显示抓码信息
                {
                    if (GlobalData.getInstance().roomVO.ma > 0 && allMas != null && allMas.Length > 0)
                    {
                        zhuamaPanel = SceneManager.getInstance().loadPerfab("prefab/Panel_ZhuaMa");
                        zhuamaPanel.GetComponent <ZhuaMaView> ().init(_data);
                        zhuamaPanel.GetComponent <ZhuaMaView> ().arrageMas(allMas, hvo.validMas);
                        Invoke("openGameOverView", 7);
                    }
                    else
                    {
                        Invoke("openGameOverView", 3);
                    }
                }
                else
                {
                    Invoke("openGameOverView", 3);
                }
            }
            else if (hvo.type == "1")
            {
                SoundManager.getInstance().playSoundByAction("liuju", GlobalData.getInstance().myAvatarVO.account.sex);
                _actionHlpr.showEffect(ActionType.LIUJU);
                Invoke("openGameOverView", 3);
            }
            else
            {
                Invoke("openGameOverView", 3);
            }
        }
Пример #6
0
        public void onReturnOnlineResponse(ClientResponse response)
        {
            //1.显示剩余牌的张数和圈数
            JsonData msgData      = JsonMapper.ToObject(response.message);
            string   surplusCards = msgData ["surplusCards"].ToString();

            _data.remainCardNum = int.Parse(surplusCards) + 1;
            _uiHelper.updateRemainCardNum();
            int gameRound = int.Parse(msgData ["gameRound"].ToString());

            _tableView.remainRoundText.text = gameRound + "";
            GlobalData.getInstance().remainRoundCount = gameRound;

            try {
                _data.putoutIndex = int.Parse(msgData ["curAvatarIndex"].ToString());
                _data.putoutPoint = int.Parse(msgData ["putOffCardPoint"].ToString());

                _data.pickIndex = int.Parse(msgData ["pickAvatarIndex"].ToString());
                if (msgData.Keys.Contains("currentCardPoint"))
                {
                    _data.pickPoint = int.Parse(msgData ["currentCardPoint"].ToString());
                }
            } catch (Exception e) {
                Debug.Log(e.ToString());
            }

            var Hand = _uiHelper.getCardGOs(Direction.B).Hand;

            if (_data.pickIndex == _data.myIndex || (Hand.Count % 3 == 2))          //把摸的牌放对位置

            {
                if (_data.pickPoint == -2)
                {
                    var lastCard = Hand [Hand.Count - 1];
                    _data.pickPoint = lastCard.GetComponent <MyHandCardView> ().getPoint();
                    _uiHelper.rangeMyHandCard(true);
                }
                else
                {
                    if ((Hand.Count) % 3 != 1)
                    {
                        MyDebug.Log("摸牌" + _data.pickPoint);
                        _uiHelper.removeMyHandCard(_data.pickPoint, 1);
                        _uiHelper.rangeMyHandCard(false);
                        _uiHelper.addPickCard(_data.myIndex, _data.pickPoint);
                    }
                }
                MyHandCardView.isPutout = true;
            }
            else
            {
                if (_data.pickIndex != _data.putoutIndex)
                {
                    _uiHelper.rangeOtherHandCard(_data.pickIndex, 1);
                }
            }
            //光标指向打牌人

            var Table = _uiHelper.getCardGOs(_data.putoutIndex).Table;

            if (Table.Count == 0)              //刚启动

            {
            }
            else
            {
                _uiHelper.lastCardOnTable = Table [Table.Count - 1];
                _uiHelper.addPointer(_uiHelper.lastCardOnTable);
            }
        }
Пример #7
0
 public void serviceErrorNotice(ClientResponse response)
 {
     TipsManagerScript.getInstance().setTips(response.message);
 }
Пример #8
0
        void onResponse(ClientResponse response)
        {
            switch (response.headCode)
            {
            case APIS.JOIN_ROOM_NOTIFY:
                onOtherJointRoom(response);
                break;

            case APIS.START_GAME_NOTIFY:            //开始游戏
                onStartGame(response);
                break;

            case APIS.MY_PICK_NOTIFY:            //自己摸牌
                onMyPickCard(response);
                break;

            case APIS.OTHER_PICK_NOTIFY:            //别人摸牌通知
                onOtherPickCard(response);
                break;

            case APIS.OTHER_PUTOUT_NOTIFY:            //出牌通知
                onOtherPutOutCard(response);
                break;

            case APIS.PENGPAI_NOTIFY:            //碰牌回调
                onPengNotify(response);
                break;

            case APIS.CHIPAI_NOTIFY:            //吃牌回调
                onChiNotify(response);
                break;

            case APIS.GANGPAI_RESPONSE:            //杠牌回调
                onMyGangResponse(response);
                break;

            case APIS.OTHER_GANGPAI_NOTIFY:
                onOtherGangNotify(response);
                break;

            case APIS.ACTION_BUTTON_NOTIFY:            //碰杠行为按钮显示
                onActionBtnNotify(response);
                break;

            case APIS.HUPAI_RESPONSE:            //胡牌回调
                onHuNotify(response);
                break;

            case APIS.OUT_ROOM_RESPONSE:            //退出房间回调
                outRoomCallbak(response);
                break;

            case APIS.READY_NOTIFY:            //准备游戏通知返回
                gameReadyNotice(response);
                break;

            case APIS.OFFLINE_NOTICE:            //离线通知
                offlineNotice(response);
                break;

            case APIS.ONLINE_NOTICE:            //上线通知
                onlineNotice(response);
                break;

            case APIS.RETURN_ONLINE_RESPONSE:
                onReturnOnlineResponse(response);
                break;

            case APIS.Game_FollowBander_Notice:            //跟庄
                _actionHlpr.showEffect(ActionType.GEN_ZHUANG);
                break;

            default:
                return;
            }
        }
Пример #9
0
        private void dispatchHandle(ClientResponse response)
        {
            switch (response.headCode)
            {
            case APIS.CLOSE_RESPONSE:
                TipsManagerScript.getInstance().setTips("服务器关闭了");
                CustomSocket.getInstance().closeSocket();
                break;

            case APIS.LOGIN_RESPONSE:
                if (LoginCallBack != null)
                {
                    LoginCallBack(response);
                }
                break;

            case APIS.CREATEROOM_RESPONSE:
                if (CreateRoomCallBack != null)
                {
                    CreateRoomCallBack(response);
                }
                break;

            case APIS.JOIN_ROOM_RESPONSE:
                if (JoinRoomCallBack != null)
                {
                    JoinRoomCallBack(response);
                }
                break;

            case APIS.STARTGAME_RESPONSE_NOTICE:
                if (StartGameNotice != null)
                {
                    StartGameNotice(response);
                }
                break;

            case APIS.PICKCARD_RESPONSE:
                if (pickCardCallBack != null)
                {
                    pickCardCallBack(response);
                }
                break;

            case APIS.OTHER_PICKCARD_RESPONSE_NOTICE:
                if (otherPickCardCallBack != null)
                {
                    otherPickCardCallBack(response);
                }
                break;

            case APIS.CHUPAI_RESPONSE:
                if (putOutCardCallBack != null)
                {
                    putOutCardCallBack(response);
                }
                break;

            case APIS.JOIN_ROOM_NOICE:
                if (otherUserJointRoomCallBack != null)
                {
                    otherUserJointRoomCallBack(response);
                }
                break;

            case APIS.PENGPAI_RESPONSE:
                if (PengCardCallBack != null)
                {
                    PengCardCallBack(response);
                }
                break;

            case APIS.GANGPAI_RESPONSE:
                if (GangCardCallBack != null)
                {
                    GangCardCallBack(response);
                }
                break;

            case APIS.OTHER_GANGPAI_NOICE:
                if (gangCardNotice != null)
                {
                    gangCardNotice(response);
                }
                break;

            case APIS.RETURN_INFO_RESPONSE:
                if (btnActionShow != null)
                {
                    btnActionShow(response);
                }
                break;

            case APIS.HUPAI_RESPONSE:
                if (HupaiCallBack != null)
                {
                    HupaiCallBack(response);
                }
                break;

            case APIS.HUPAIALL_RESPONSE:
                if (FinalGameOverCallBack != null)
                {
                    FinalGameOverCallBack(response);
                }
                break;

            case APIS.OUT_ROOM_RESPONSE:
                if (outRoomCallback != null)
                {
                    outRoomCallback(response);
                }
                break;

            case APIS.headRESPONSE:
                break;

            case APIS.DISSOLIVE_ROOM_RESPONSE:
                if (dissoliveRoomResponse != null)
                {
                    dissoliveRoomResponse(response);
                }
                break;

            case APIS.PrepareGame_MSG_RESPONSE:
                if (gameReadyNotice != null)
                {
                    gameReadyNotice(response);
                }
                break;

            case APIS.MicInput_Response:
                if (micInputNotice != null)
                {
                    micInputNotice(response);
                }
                break;

            case APIS.MessageBox_Notice:
                if (messageBoxNotice != null)
                {
                    messageBoxNotice(response);
                }
                break;

            case APIS.ERROR_RESPONSE:
                if (serviceErrorNotice != null)
                {
                    serviceErrorNotice(response);
                }
                break;

            case APIS.BACK_LOGIN_RESPONSE:
                if (RoomBackResponse != null)
                {
                    RoomBackResponse(response);
                }

                break;

            case APIS.CARD_CHANGE:
                if (cardChangeNotice != null)
                {
                    cardChangeNotice(response);
                }
                break;

            case APIS.OFFLINE_NOTICE:
                if (offlineNotice != null)
                {
                    offlineNotice(response);
                }
                break;

            case APIS.RETURN_ONLINE_RESPONSE:

                if (returnGameResponse != null)
                {
                    returnGameResponse(response);
                }
                break;

            case APIS.PRIZE_RESPONSE:
                if (giftResponse != null)
                {
                    giftResponse(response);
                }
                break;

            case APIS.Game_FollowBander_Notice:
                if (gameFollowBanderNotice != null)
                {
                    gameFollowBanderNotice(response);
                }
                break;


            case APIS.ONLINE_NOTICE:
                if (onlineNotice != null)
                {
                    onlineNotice(response);
                }
                break;

            case APIS.GAME_BROADCAST:
                if (gameBroadcastNotice != null)
                {
                    gameBroadcastNotice(response);
                }
                break;

            case APIS.CONTACT_INFO_RESPONSE:
                if (contactInfoResponse != null)
                {
                    contactInfoResponse(response);
                }
                break;

            case APIS.HOST_UPDATEDRAW_RESPONSE:
                if (hostUpdateDrawResponse != null)
                {
                    hostUpdateDrawResponse(response);
                }
                break;

            case APIS.ZHANJI_REPORTER_REPONSE:
                if (zhanjiResponse != null)
                {
                    zhanjiResponse(response);
                }
                break;

            case APIS.ZHANJI_DETAIL_REPORTER_REPONSE:
                if (zhanjiDetailResponse != null)
                {
                    zhanjiDetailResponse(response);
                }
                break;

            case APIS.GAME_BACK_PLAY_RESPONSE:
                if (gameBackPlayResponse != null)
                {
                    gameBackPlayResponse(response);
                }
                break;

            case APIS.TIP_MESSAGE:
                TipsManagerScript.getInstance().setTips(response.message);
                break;

            case APIS.OTHER_TELE_LOGIN:
                if (otherTeleLogin != null)
                {
                    otherTeleLogin(response);
                }
                break;
            }
        }
Пример #10
0
 public void serviceErrorNotice(ClientResponse response)
 {
     watingPanel.gameObject.SetActive(false);
     TipsManagerScript.getInstance().setTips(response.message);
 }
Пример #11
0
 public void ServiceErrorReply(ClientResponse response)
 {
     TipsManagerScript.getInstance.setTips(response.message);
 }
Пример #12
0
 public void AddResponse(ClientResponse response)
 {
     MyDebug.Log(response.headCode);
     callBackResponseList.Add(response);
     MyDebug.Log("----" + response.headCode);
 }
Пример #13
0
        private void DispatchHandle(ClientResponse response)
        {
            MyDebug.Log(response.headCode + "===========================");
            switch (response.headCode)
            {
            case APIS.CLOSE_RESPONSE:
                TipsManagerScript.getInstance.setTips(LocalizationManager.GetInstance.GetValue("KEY.20013"));
                CustomSocket.Instance.CloseSocket();
                break;

            case APIS.LOGIN_RESPONSE:
                if (loginReply != null)
                {
                    loginReply(response);
                }

                break;

            case APIS.CREATEROOM_RESPONSE:
                if (createRoomReply != null)
                {
                    createRoomReply(response);
                }

                break;

            case APIS.JOIN_ROOM_RESPONSE:
                if (joinRoomReply != null)
                {
                    joinRoomReply(response);
                }

                break;

            case APIS.STARTGAME_RESPONSE_NOTICE:
                if (startGameReply != null)
                {
                    startGameReply(response);
                }
                //startResply = response;
                //Invoke("StartReplyInvoke", 0.1f);
                break;

            case APIS.BACK_BANKER:
                if (backBanker != null)
                {
                    backBanker(response);
                }
                break;

            case APIS.BACK_XIAZHU:
                if (backXiaZhu != null)
                {
                    backXiaZhu(response);
                }
                break;

            case APIS.MPPICKCARD_RESPONSE:
                if (MPsendCard != null)
                {
                    MPsendCard(response);
                }
                break;


            case APIS.PICKCARD_RESPONSE:
                if (pickCardReply != null)
                {
                    pickCardReply(response);
                }
                //pickCardResply = response;
                //StartCoroutine(PickReplyInvoke());
                break;

            case APIS.OTHER_PICKCARD_RESPONSE_NOTICE:
                if (otherPickCardReply != null)
                {
                    otherPickCardReply(response);
                }

                break;

            case APIS.CHUPAI_RESPONSE:
                if (otherPutOutCardReply != null)
                {
                    otherPutOutCardReply(response);
                }

                break;

            case APIS.JOIN_ROOM_NOICE:
                if (otherJoinRoomReply != null)
                {
                    otherJoinRoomReply(response);
                }

                break;

            case APIS.CHIPAI_RESPONSE:
                if (otherChiReply != null)
                {
                    otherChiReply(response);
                }

                break;

            case APIS.PENGPAI_RESPONSE:
                if (otherPentReply != null)
                {
                    otherPentReply(response);
                }
                break;

            case APIS.GANGPAI_RESPONSE:
                if (gangReply != null)
                {
                    gangReply(response);
                }

                break;

            case APIS.OTHER_GANGPAI_NOICE:
                if (otherGangReply != null)
                {
                    otherGangReply(response);
                }

                break;

            case APIS.RETURN_INFO_RESPONSE:
                actionBtnReply(response);
                //actioonResply = response;
                //StartCoroutine(ActionInvoke());
                break;

            case APIS.HUPAI_RESPONSE:
                if (huReply != null)
                {
                    huReply(response);
                }

                break;

            case APIS.HUPAIALL_RESPONSE:
                if (gameOverReply != null)
                {
                    gameOverReply(response);
                }
                break;

            case APIS.GAMEOVERALL_RESPONSE:
                if (ALLgameOverReply != null)
                {
                    ALLgameOverReply(response);
                }
                break;

            case APIS.OUT_ROOM_RESPONSE:
                if (quitRoomReply != null)
                {
                    quitRoomReply(response);
                }

                break;

            case APIS.headRESPONSE:
                break;

            case APIS.USER_SHOW_CARD:
                if (userShowCard != null)
                {
                    userShowCard(response);
                }

                break;

            case APIS.DISSOLIVE_ROOM_RESPONSE:
                if (response.message == null)
                {
                    ShowExit();
                }
                if (dissolveRoomReply != null)
                {
                    dissolveRoomReply(response);
                }

                break;

            case APIS.DISSOLIVE_ROOM_REQUEST:
                if (dissloveRoomReq != null)
                {
                    dissloveRoomReq(response);
                }
                break;

            case APIS.PrepareGame_MSG_RESPONSE:
                if (readyReply != null)
                {
                    readyReply(response);
                }

                break;

            case APIS.MicInput_Response:
                if (micInputReply != null)
                {
                    micInputReply(response);
                }

                break;

            case APIS.MessageBox_Notice:
                if (messageBoxReply != null)
                {
                    messageBoxReply(response);
                }

                break;

            case APIS.ERROR_RESPONSE:
                if (serviceErrorReply != null)
                {
                    serviceErrorReply(response);
                }

                break;

            case APIS.BACK_LOGIN_RESPONSE:
                backResply = response;
                BackReplyInvoke();

                break;

            case APIS.CARD_CHANGE:
                if (cardChangeReply != null)
                {
                    cardChangeReply(response);
                }

                break;

            case APIS.OFFLINE_NOTICE:
                if (offlineReply != null)
                {
                    offlineReply(response);
                }

                break;

            case APIS.RETURN_ONLINE_RESPONSE:
                if (returnGameReply != null)
                {
                    returnGameReply(response);
                }

                break;

            case APIS.PRIZE_RESPONSE:
                if (giftReply != null)
                {
                    giftReply(response);
                }

                break;

            case APIS.Game_FollowBander_Notice:
                if (followBankerReply != null)
                {
                    followBankerReply(response);
                }

                break;

            case APIS.ONLINE_NOTICE:
                if (onlineReply != null)
                {
                    onlineReply(response);
                }

                break;

            case APIS.GAME_BROADCAST:
                if (broadcastNoticeReply != null)
                {
                    broadcastNoticeReply(response);
                }

                break;

            case APIS.CONTACT_INFO_RESPONSE:
                if (contactInfoReply != null)
                {
                    contactInfoReply(response);
                }

                break;

            case APIS.HOST_UPDATEDRAW_RESPONSE:
                if (lotteryReply != null)
                {
                    lotteryReply(response);
                }

                break;

            case APIS.ZHANJI_REPORTER_REPONSE:
                if (recordReply != null)
                {
                    recordReply(response);
                }

                break;

            case APIS.ZHANJI_DETAIL_REPORTER_REPONSE:
                if (recordDetailReply != null)
                {
                    recordDetailReply(response);
                }

                break;

            case APIS.GAME_BACK_PLAY_RESPONSE:
                if (gameBattleReply != null)
                {
                    gameBattleReply(response);
                }

                break;

            case APIS.TIP_MESSAGE:
                TipsManagerScript.getInstance.setTips(response.message);
                break;

            case APIS.OTHER_TELE_LOGIN:
                if (otherDeviceLoginReply != null)
                {
                    otherDeviceLoginReply(response);
                }

                break;

            case APIS.REFRESH_PLAYER_STATE:
                if (playerStateReply != null)
                {
                    playerStateReply(response);
                }

                break;

            case APIS.ROOM_OPTION:
                if (roomOptionReply != null)
                {
                    roomOptionReply(response);
                }
                break;

            case APIS.SetRoomMark:
                if (setRoomMark != null)
                {
                    setRoomMark(response);
                }
                break;
            }
        }