示例#1
0
    public void onJoinRoomCallBack(ClientResponse response)
    {
        watingPanel.gameObject.SetActive(false);
        MyDebug.Log(response);
        if (response.status == 1)
        {
            GlobalDataScript.roomJoinResponseData = JsonMapper.ToObject <RoomCreateVo>(response.message);
            GlobalDataScript.roomVo                   = GlobalDataScript.roomJoinResponseData;
            GlobalDataScript.surplusTimes             = GlobalDataScript.roomJoinResponseData.roundNumber;
            GlobalDataScript.loginResponseData.roomId = GlobalDataScript.roomJoinResponseData.roomId;
            //loadPerfab("Prefab/Panel_GamePlay");
            GlobalDataScript.reEnterRoomData = null;

            GlobalDataScript.gamePlayPanel = PrefabManage.loadPerfab("Prefab/Panel_GamePlay");
            //SocketEventHandle.getInstance().gameReadyNotice += GlobalDataScript.gamePlayPanel.GetComponent<MyMahjongScript>().gameReadyNotice;
            //GlobalDataScript.gamePlayPanel.GetComponent<MyMahjongScript>().joinToRoom(GlobalDataScript.roomJoinResponseData.playerList);

            connectRetruen = true;
            closeDialog();
        }
        else
        {
            clear();
            TipsManagerScript.getInstance().setTips2("");
            //TipsManagerScript.getInstance();
            //watingPanel.gameObject.SetActive(true);
            //watingPanel.gameObject.transform.gameObject.SetActive(true);
            //watingPanel.gameObject.transform.FindChild("tip3/Text").GetComponent<Text>().text = response.message;


            TipsManagerScript.getInstance().setTips(response.message);
            closeDialog();
            GlobalDataScript.homePanel.GetComponent <HomePanelScript>().openEnterRoomDialog();
        }
    }
示例#2
0
        public void  openGamePlay()
        {
            string id = mZhanjiDataItemVo.id + "";

            CustomSocket.getInstance().sendMsg(new GameBackPlayRequest(id));
            PrefabManage.loadPerfab("Prefab/Panel_GamePlayBack");
        }
示例#3
0
    public bool sendHeadData2()
    {
        MyDebug.Log("send head data");
        try
        {
            if (stream != null && tcpclient.Connected)
            {
                //stream.Write(headBytes, 0, headBytes.Length);

                return(true);
            }
            else
            {
                isConnected = false;
                if (!GlobalDataScript.isonLoginPage)
                {
                    PrefabManage.loadPerfab("Prefab/Panel_Start");
                }
                SocketEventHandle.getInstance().noticeDisConect();
                return(false);
            }
        }
        catch (Exception ex)
        {
            MyDebug.Log(ex.ToString());
            isConnected = false;
            //showMessageTip ("服务器已断开连接,请重新登录");
            isConnected = false;
            SocketEventHandle.getInstance().noticeDisConect();
            return(false);
        }
    }
示例#4
0
    private void onCreateRoomCallback(ClientResponse response)
    {
        Debug.Log("创建房间返回数据=> " + response.message);
        if (response.status == 1)
        {
            int roomId = Int32.Parse(response.message);
            sendVo.roomId = roomId;
            // 全局数据设置房间信息
            GlobalDataScript.roomVo = sendVo;
            // 设置房间ID
            GlobalDataScript.loginResponseData.roomId = roomId;
            // 设置房主为true
            GlobalDataScript.loginResponseData.main = true;
            // 设置在线状态
            GlobalDataScript.loginResponseData.onLine = true;
            // 设置游戏界面
            GlobalDataScript.gamePlayPanel = PrefabManage.loadPerfab("Prefab/Panel_Game_Play");

            GlobalDataScript.gamePlayPanel.GetComponent <MyMahjongScript>().createRoomAddAvatarVO(GlobalDataScript.loginResponseData);

            closeDialog();
        }
        else
        {
            TipsManagerScript.getInstance().setTips(response.message);
        }
    }
    public void displayAvatorIp()
    {
        //userInfoPanel.SetActive (true);
        GameObject obj = PrefabManage.loadPerfab("Prefab/userInfo");

        obj.GetComponent <ShowUserInfoScript> ().setUIData(avatarvo);
    }
示例#6
0
    public void showUserInfoPanel()
    {
        //userInfoPanel.SetActive (true);
        GameObject obj = PrefabManage.loadPerfab("Prefab/userInfo");

        obj.GetComponent <ShowUserInfoScript> ().setUIData(GlobalDataScript.loginResponseData);
    }
示例#7
0
    private void  loadPerfab(string perfabName, int openFlag)
    {
        GameObject obj = PrefabManage.loadPerfab(perfabName);

        obj.GetComponent <GameOverScript> ().setDisplaContent(openFlag, GlobalDataScript.roomAvatarVoList, null, GlobalDataScript.hupaiResponseVo.validMas);
        obj.transform.SetSiblingIndex(2);
    }
    private void RoomBackResponse(ClientResponse response)
    {
        watingPanel.SetActive(false);

        if (GlobalDataScript.homePanel != null)
        {
            GlobalDataScript.homePanel.GetComponent <HomePanelScript> ().removeListener();
            Destroy(GlobalDataScript.homePanel);
        }


        if (GlobalDataScript.gamePlayPanel != null)
        {
            GlobalDataScript.gamePlayPanel.GetComponent <MyMahjongScript> ().exitOrDissoliveRoom();
        }
        GlobalDataScript.reEnterRoomData = JsonMapper.ToObject <RoomJoinResponseVo> (response.message);

        for (int i = 0; i < GlobalDataScript.reEnterRoomData.playerList.Count; i++)
        {
            AvatarVO itemData = GlobalDataScript.reEnterRoomData.playerList [i];
            if (itemData.account.openid == GlobalDataScript.loginResponseData.account.openid)
            {
                GlobalDataScript.loginResponseData.account.uuid = itemData.account.uuid;
                ChatSocket.getInstance().sendMsg(new LoginChatRequest(GlobalDataScript.loginResponseData.account.uuid));
                break;
            }
        }

        GlobalDataScript.gamePlayPanel = PrefabManage.loadPerfab("Prefab/Panel_GamePlay");
        removeListener();
        Destroy(this);
        Destroy(gameObject);
    }
    private void onJoinRoomCallBack(ClientResponse response)
    {
        Debug.Log(response);

        if (response.status == 1)
        {
            GlobalDataScript.roomJoinResponseData     = JsonMapper.ToObject <RoomJoinResponseVo>(response.message);
            GlobalDataScript.roomVo.addWordCard       = GlobalDataScript.roomJoinResponseData.addWordCard;
            GlobalDataScript.roomVo.hong              = GlobalDataScript.roomJoinResponseData.hong;
            GlobalDataScript.roomVo.ma                = GlobalDataScript.roomJoinResponseData.ma;
            GlobalDataScript.roomVo.name              = GlobalDataScript.roomJoinResponseData.name;
            GlobalDataScript.roomVo.roomId            = GlobalDataScript.roomJoinResponseData.roomId;
            GlobalDataScript.roomVo.roomType          = GlobalDataScript.roomJoinResponseData.roomType;
            GlobalDataScript.roomVo.roundNumber       = GlobalDataScript.roomJoinResponseData.roundNumber;
            GlobalDataScript.roomVo.sevenDouble       = GlobalDataScript.roomJoinResponseData.sevenDouble;
            GlobalDataScript.roomVo.xiaYu             = GlobalDataScript.roomJoinResponseData.xiaYu;
            GlobalDataScript.roomVo.ziMo              = GlobalDataScript.roomJoinResponseData.ziMo;
            GlobalDataScript.roomVo.magnification     = GlobalDataScript.roomJoinResponseData.magnification;
            GlobalDataScript.surplusTimes             = GlobalDataScript.roomJoinResponseData.roundNumber;
            GlobalDataScript.loginResponseData.roomId = GlobalDataScript.roomJoinResponseData.roomId;
            //loadPerfab("Prefab/Panel_GamePlay");
            GlobalDataScript.gamePlayPanel = PrefabManage.loadPerfab("Prefab/Panel_Game_Play");
            GlobalDataScript.gamePlayPanel.GetComponent <MyMahjongScript>().joinToRoom(GlobalDataScript.roomJoinResponseData.playerList);
            closeDialog();
        }
        else
        {
            TipsManagerScript.getInstance().setTips(response.message);
        }
    }
示例#10
0
    public void exit()
    {
        GlobalDataScript.isAutoLogin = false;
        PlayerPrefs.DeleteKey("loginInfo");
        PrefabManage.loadPerfab("Prefab/Panel_start");


        /*
         * //取消微信授权
         * WechatOperateScript wechatOperate = GameObject.Find("Canvas").GetComponent<WechatOperateScript>();
         * wechatOperate.cancelAuth ();
         *
         * Destroy (this);
         * Destroy (gameObject);
         *
         * GameObject setting = GameObject.Find ("Panel_Setting(Clone)") as GameObject;
         * Destroy (setting);
         */

        #if UNITY_ANDROID
        Application.Quit();
        #elif UNITY_IPHONE
        TipsManagerScript.getInstance().setTips("苹果手机请按Home键盘进行退出!");
        #endif

        //多态  调用退出登录接口
    }
示例#11
0
    public void openFinalOverPanl()
    {
        SoundCtrl.getInstance().playSoundUI();
        if (GlobalDataScript.finalGameEndVo != null && GlobalDataScript.finalGameEndVo.totalInfo != null && GlobalDataScript.finalGameEndVo.totalInfo.Count > 0)
        {
            GameObject obj = PrefabManage.loadPerfab("prefab/Panel_Game_Over");
            obj.GetComponent <GameOverScript>().setDisplaContent(1, GlobalDataScript.roomAvatarVoList);
            obj.transform.SetSiblingIndex(2);

            if (GlobalDataScript.singalGameOverList.Count > 0)
            {
                for (int i = 0; i < GlobalDataScript.singalGameOverList.Count; i++)
                {
                    //GlobalDataScript.singalGameOverList [i].GetComponent<GameOverScript> ().closeDialog ();
                    Destroy(GlobalDataScript.singalGameOverList [i].GetComponent <GameOverScript>());
                    Destroy(GlobalDataScript.singalGameOverList [i]);
                }
                //int count = GlobalDataScript.singalGameOverList.Count;
                //for (int i = 0; i < count; i++) {
                //	GlobalDataScript.singalGameOverList.RemoveAt (0);
                //}
                GlobalDataScript.singalGameOverList.Clear();
            }
            if (CommonEvent.getInstance().closeGamePanel != null)
            {
                CommonEvent.getInstance().closeGamePanel();
            }
        }
    }
//	public void toggleHongClick(){
//
//		if (zhuanzhuanGameRule [2].isOn) {
//			zhuanzhuanGameRule [0].isOn = true;
//		}
//	}
//
//	public void toggleQiangGangHuClick(){
//		if (zhuanzhuanGameRule [1].isOn) {
//			zhuanzhuanGameRule [2].isOn = false;
//		}
//	}

    public void onCreateRoomCallback(ClientResponse response)
    {
        MyDebug.Log(response.message);
        if (response.status == 1)
        {
            GlobalDataScript.reEnterRoomData = null;
            RoomCreateResponseVo responseVO = JsonMapper.ToObject <RoomCreateResponseVo> (response.message);
            int roomid = Int32.Parse(response.message);
            sendVo.roomId           = roomid;
            GlobalDataScript.roomVo = sendVo;
            GlobalDataScript.loginResponseData.roomId   = roomid;
            GlobalDataScript.loginResponseData.isReady  = true;
            GlobalDataScript.loginResponseData.main     = true;
            GlobalDataScript.loginResponseData.isOnLine = true;


            GlobalDataScript.gamePlayPanel = PrefabManage.loadPerfab("Prefab/Panel_GamePlay");

            GlobalDataScript.gamePlayPanel.GetComponent <MyMahjongScript> ().createRoomAddAvatarVO(GlobalDataScript.loginResponseData);
            GlobalDataScript.homePanel.GetComponent <HomePanelScript>().checkEnterInRoom();
            closeDialog();
        }
        else
        {
            TipsManagerScript.getInstance().setTips(response.message);
        }
    }
    public void onCreateRoomCallback(ClientResponse response)
    {
        if (response.handleCode == StatusCode.SESSION_expire ||
            response.handleCode == StatusCode.SESSION_invalid || response.bytes == null)
        {
            TipsManagerScript.getInstance().setTips("错误:" + response.handleCode);
            return;
        }

        staticc__room_opreation_response res = ClientRequest.DeSerialize <staticc__room_opreation_response>(response.bytes);

        Debug.Log("room number: " + res.data.room_num);

        //进入游戏中等待其他玩家加入
        GlobalDataScript.roomInfo = res.data;
        int roomid = Int32.Parse(response.message);

        sendVo.roomId = roomid;
        //			GlobalDataScript.roomVo = sendVo;
        GlobalDataScript.loginResponseData.roomId = roomid;
        //GlobalDataScript.loginResponseData.isReady = true;
        GlobalDataScript.loginResponseData.main     = true;
        GlobalDataScript.loginResponseData.isOnLine = true;

        GlobalDataScript.gamePlayPanel = PrefabManage.loadPerfab("Prefab/Panel_GamePlay");
        GlobalDataScript.gamePlayPanel.GetComponent <MyMahjongScript>().createRoomAddAvatarVO(GlobalDataScript.loginResponseData);
        closeDialog();
    }
示例#14
0
    public void showUserInfoPanel()
    {
        SoundCtrl.getInstance().playSoundByActionButton(1);
        //userInfoPanel.SetActive (true);
        GameObject obj = PrefabManage.loadPerfab("Prefab/userInfo");

        obj.GetComponent <ShowUserInfoScript>().setUIData(GlobalDataScript.loginResponseData);
    }
示例#15
0
 /****
  * 判断进入房间
  */
 private void checkEnterInRoom()
 {
     if (GlobalDataScript.roomVo != null && GlobalDataScript.roomVo.roomId != 0)
     {
         //loadPerfab ("Prefab/Panel_GamePlay");
         GlobalDataScript.gamePlayPanel = PrefabManage.loadPerfab("Prefab/Panel_GamePlay");
     }
 }
示例#16
0
 /****
  * 判断进入房间
  */
 private void checkEnterInRoom()
 {
     if (GlobalDataScript.roomInfo != null && GlobalDataScript.roomInfo.room_num != 0)
     {
         //loadPerfab ("Prefab/Panel_GamePlay");
         Debug.Log("check enter in room:" + GlobalDataScript.roomInfo);
         GlobalDataScript.gamePlayPanel = PrefabManage.loadPerfab("Prefab/Panel_GamePlay");
     }
 }
示例#17
0
 private void StartPrepareGame(ClientResponse response)
 {
     GlobalDataScript.roomJoinResponseData = JsonMapper.ToObject <RoomJoinResponseVo>(response.message);
     GlobalDataScript.reEnterRoomData      = JsonMapper.ToObject <RoomJoinResponseVo>(response.message);
     if (GlobalDataScript.gamePlayPanel == null)
     {
         GlobalDataScript.gamePlayPanel = PrefabManage.loadPerfab("Prefab/Panel_GamePlay");
         //GlobalDataScript.gamePlayPanel.GetComponent<MyMahjongScript>().joinToRoom(GlobalDataScript.roomJoinResponseData.playerList);
     }
 }
示例#18
0
 public void displayAvatorIp()
 {
     //userInfoPanel.SetActive (true);
     if (avatarvo != null)
     {
         GameObject obj = PrefabManage.loadPerfab("Prefab/userInfo");
         obj.GetComponent <ShowUserInfoScript>().setUIData(avatarvo);
         SoundCtrl.getInstance().playSoundByActionButton(1);
     }
 }
示例#19
0
 private void  disConnetNotice()
 {
     if (GlobalDataScript.isonLoginPage)
     {
     }
     else
     {
         cleaListener();
         PrefabManage.loadPerfab("Prefab/Panel_Start");
     }
 }
示例#20
0
    public void openFinalOverPanl()
    {
        SoundCtrl.getInstance().playSoundByActionButton(1);
        MyDebug.Log("------------------0----------------------");

        MyDebug.Log("-----------------GlobalDataScript.finalGameEndVo.totalInfo.Count---------------------" + GlobalDataScript.finalGameEndVo != null);

        MyDebug.Log("-----------------GlobalDataScript.finalGameEndVo.totalInfo.Count---------------------" + GlobalDataScript.finalGameEndVo.totalInfo != null);

        MyDebug.Log("-----------------GlobalDataScript.finalGameEndVo.totalInfo.Count---------------------" + GlobalDataScript.finalGameEndVo.totalInfo.Count);
        MyDebug.Log("------------------GlobalDataScript.finalGameEndVo.totalInfo !=null----------------------" + GlobalDataScript.finalGameEndVo.totalInfo != null);

        MyDebug.Log("-----------------GlobalDataScript.finalGameEndVo !=null--------------------" + GlobalDataScript.finalGameEndVo != null);
        if (GlobalDataScript.finalGameEndVo != null && GlobalDataScript.finalGameEndVo.totalInfo != null && GlobalDataScript.finalGameEndVo.totalInfo.Count > 0)
        {
            MyDebug.Log("------------------1----------------------");
            GameObject obj = PrefabManage.loadPerfab("prefab/Panel_Game_Over");

            if (GlobalDataScript.roomVo.gameType == 0)
            {
                obj.GetComponent <GameOverScript> ().setDisplayContent(1,
                                                                       GlobalDataScript.roomAvatarVoList, null, GlobalDataScript.hupaiResponseVo.validMas);
            }
            else
            {
                obj.GetComponent <GameOverScript> ().setDisplayContent_pdk(1,
                                                                           GlobalDataScript.roomAvatarVoList, null, GlobalDataScript.hupaiResponseVo.validMas);
            }
            obj.transform.SetSiblingIndex(2);
            MyDebug.Log("------------------2----------------------");
            if (GlobalDataScript.singalGameOverList.Count > 0)
            {
                MyDebug.Log("------------------3----------------------");
                for (int i = 0; i < GlobalDataScript.singalGameOverList.Count; i++)
                {
                    //GlobalDataScript.singalGameOverList [i].GetComponent<GameOverScript> ().closeDialog ();
                    Destroy(GlobalDataScript.singalGameOverList[i].GetComponent <GameOverScript>());
                    Destroy(GlobalDataScript.singalGameOverList[i]);
                }
                MyDebug.Log("------------------4----------------------");
                //int count = GlobalDataScript.singalGameOverList.Count;
                //for (int i = 0; i < count; i++) {
                //	GlobalDataScript.singalGameOverList.RemoveAt (0);
                //}
                GlobalDataScript.singalGameOverList.Clear();
            }
            MyDebug.Log("------------------5----------------------");
            if (CommonEvent.getInstance().closeGamePanel != null)
            {
                CommonEvent.getInstance().closeGamePanel();
            }
        }
    }
示例#21
0
 private void  disConnetNotice()
 {
     if (GlobalDataScript.isonLoginPage)
     {
         //CustomSocket.getInstance ().Connect();
         //ChatSocket.getInstance ().Connect ();
     }
     else
     {
         cleaListener();
         PrefabManage.loadPerfab("Prefab/Panel_Start");
     }
 }
示例#22
0
    /***
     * 打开创建房间的对话框
     *
     */
    public void openCreateRoomDialog()
    {
        SoundCtrl.getInstance().playSoundUI(true);
        if (GlobalDataScript.roomParameters != null)
        {
//			loadPerfab("Prefab/Panel_Create_Dialog");
            PrefabManage.loadPerfab("Prefab/Panel_CreateRoom");
        }
        else
        {
            TipsManagerScript.getInstance().setTips("当前正在房间状态,无法创建房间");
        }
    }
示例#23
0
    /***
     * 打开进入房间的对话框
     *
     */
    public void openEnterRoomDialog()
    {
        SoundCtrl.getInstance().playSoundUI(true);

        if (GlobalDataScript.roomInfo == null || GlobalDataScript.roomInfo.room_num == 0)
        {
            PrefabManage.loadPerfab("Prefab/Panel_Enter_Room");
        }
        else
        {
            TipsManagerScript.getInstance().setTips("当前正在房间状态,无法加入新的房间");
        }
    }
示例#24
0
    private void  disConnetNotice()
    {
        if (GlobalDataScript.isonLoginPage)
        {
            //CustomSocket.getInstance ().Connect();
            //ChatSocket.getInstance ().Connect ();
        }
        else
        {
            cleaListener();

            CustomSocket.getInstance().closeSocket();

            if (GlobalDataScript.homePanel != null)
            {
                GlobalDataScript.homePanel.GetComponent <HomePanelScript> ().removeListener();
                Destroy(GlobalDataScript.homePanel);
            }


            if (GlobalDataScript.gamePlayPanel != null)
            {
                if (GlobalDataScript.roomVo.gameType == (int)GameTypePK.NULL)
                {
                    GlobalDataScript.gamePlayPanel.GetComponent <MyMahjongScript> ().exitOrDissoliveRoom();
                }
                else if (GlobalDataScript.roomVo.gameType == (int)GameTypePK.PDK)
                {
                    GlobalDataScript.gamePlayPanel.GetComponent <MyPDKScript> ().exitOrDissoliveRoom();
                }
                else if (GlobalDataScript.roomVo.gameType == (int)GameTypePK.DN)
                {
                    GlobalDataScript.gamePlayPanel.GetComponent <MyDNScript> ().exitOrDissoliveRoom();
                }
                else if (GlobalDataScript.roomVo.gameType == (int)GameTypePK.DZPK)
                {
                    GlobalDataScript.gamePlayPanel.GetComponent <MyDZPKScript>().exitOrDissoliveRoom();
                }
                else if (GlobalDataScript.roomVo.gameType == (int)GameTypePK.AMH)
                {
                    GlobalDataScript.gamePlayPanel.GetComponent <MyDZPKScript>().exitOrDissoliveRoom();
                }
            }

            PrefabManage.loadPerfab("Prefab/Panel_Start");
            //SceneManager.LoadScene(0);//返回登录页面
        }
    }
示例#25
0
    public void onJoinRoomCallBack(ClientResponse response)
    {
        if (response.handleCode == StatusCode.SESSION_expire ||
            response.handleCode == StatusCode.SESSION_invalid || response.bytes == null)
        {
            Debug.Log("onJoinRoomCallBack error " + response.handleCode);
            return;
        }
        Debug.Log("join room success!");
        if (response.status == 1)
        {
//			GlobalDataScript.roomJoinResponseData = JsonMapper.ToObject<RoomJoinResponseVo>(response.message);
//			GlobalDataScript.roomVo.addWordCard = GlobalDataScript.roomJoinResponseData.addWordCard;
//			GlobalDataScript.roomVo.hong = GlobalDataScript.roomJoinResponseData.hong;
//			GlobalDataScript.roomVo.ma = GlobalDataScript.roomJoinResponseData.ma;
//			GlobalDataScript.roomVo.name = GlobalDataScript.roomJoinResponseData.name;
//			GlobalDataScript.roomVo.roomId = GlobalDataScript.roomJoinResponseData.roomId;
//			GlobalDataScript.roomVo.roomType = GlobalDataScript.roomJoinResponseData.roomType;
//			GlobalDataScript.roomVo.roundNumber = GlobalDataScript.roomJoinResponseData.roundNumber;
//			GlobalDataScript.roomVo.sevenDouble = GlobalDataScript.roomJoinResponseData.sevenDouble;
//			GlobalDataScript.roomVo.xiaYu = GlobalDataScript.roomJoinResponseData.xiaYu;
//			GlobalDataScript.roomVo.ziMo = GlobalDataScript.roomJoinResponseData.ziMo;
//			GlobalDataScript.roomVo.magnification = GlobalDataScript.roomJoinResponseData.magnification;
//
//			GlobalDataScript.roomVo.chengbei = GlobalDataScript.roomJoinResponseData.chengbei;
//			GlobalDataScript.roomVo.aa = GlobalDataScript.roomJoinResponseData.aa;
//			GlobalDataScript.roomVo.zashu = GlobalDataScript.roomJoinResponseData.zashu;
//			GlobalDataScript.roomVo.paofen = GlobalDataScript.roomJoinResponseData.paofen;
//			GlobalDataScript.roomVo.roundtype = GlobalDataScript.roomJoinResponseData.roundtype;
//			GlobalDataScript.roomVo.yuanzishu = GlobalDataScript.roomJoinResponseData.yuanzishu;
//			GlobalDataScript.roomVo.yuanzijiesu = GlobalDataScript.roomJoinResponseData.yuanzijiesu;
//			GlobalDataScript.roomVo.zhanzhuangbi = GlobalDataScript.roomJoinResponseData.zhanzhuangbi;
//			GlobalDataScript.roomVo.guozhuangbi = GlobalDataScript.roomJoinResponseData.guozhuangbi;
//			GlobalDataScript.roomVo.fengfa = GlobalDataScript.roomJoinResponseData.fengfa;
//
//			GlobalDataScript.surplusTimes = GlobalDataScript.roomJoinResponseData.realRoundNumber();
            GlobalDataScript.gameOver = false;

//			GlobalDataScript.loginResponseData.roomId = GlobalDataScript.roomJoinResponseData.roomId;
            GlobalDataScript.gamePlayPanel = PrefabManage.loadPerfab("Prefab/Panel_GamePlay");
//			GlobalDataScript.gamePlayPanel.GetComponent<MyMahjongScript>().joinToRoom(GlobalDataScript.roomJoinResponseData.playerList);
            closeDialog();
        }
        else
        {
            TipsManagerScript.getInstance().setTips(response.message);
        }
    }
示例#26
0
    //	public void toggleHongClick(){
    //
    //		if (zhuanzhuanGameRule [2].isOn) {
    //			zhuanzhuanGameRule [0].isOn = true;
    //		}
    //	}
    //
    //	public void toggleQiangGangHuClick(){
    //		if (zhuanzhuanGameRule [1].isOn) {
    //			zhuanzhuanGameRule [2].isOn = false;
    //		}
    //	}

    public void onCreateRoomCallback(ClientResponse response)
    {
        if (watingPanel != null)
        {
            watingPanel.gameObject.SetActive(false);
        }
        MyDebug.Log(response.message);
        if (response.status == 1)
        {
            //RoomCreateResponseVo responseVO = JsonMapper.ToObject<RoomCreateResponseVo> (response.message);
            int roomid = Int32.Parse(response.message);
            sendVo.roomId           = roomid;
            GlobalDataScript.roomVo = sendVo;
            GlobalDataScript.loginResponseData.roomId = roomid;
            //GlobalDataScript.loginResponseData.isReady = true;
            if (GlobalDataScript.roomVo.gameType == 0)           //(int)GameType.GameType_PK_PDK
            {
                GlobalDataScript.loginResponseData.main = true;
            }
            GlobalDataScript.loginResponseData.isOnLine = true;
            GlobalDataScript.reEnterRoomData            = null;
            //SceneManager.LoadSceneAsync(1);


//			saveDefaultSet (GlobalDataScript.userGameType, userDefaultSet);

            if (GlobalDataScript.roomVo.gameType == 0)               //(int)GameType.GameType_PK_PDK
            {
                GlobalDataScript.gamePlayPanel = PrefabManage.loadPerfab("Prefab/Panel_GamePlay");
            }
            else if (GlobalDataScript.roomVo.gameType == 1)                 //(int)GameType.GameType_PK_PDK
            {
                GlobalDataScript.gamePlayPanel = PrefabManage.loadPerfab("Prefab/Panel_GamePDK");
            }
            else if (GlobalDataScript.roomVo.gameType == 3)                //(int)GameType.GameType_PK_DN
            {
                GlobalDataScript.gamePlayPanel = PrefabManage.loadPerfab("Prefab/Panel_GameDN");
            }

            closeDialog();
        }
        else
        {
            TipsManagerScript.getInstance().setTips(response.message);
        }
    }
示例#27
0
    public void onJoinRoomCallBack(ClientResponse response)
    {
        if (response.status == 1)
        {
            GlobalDataScript.roomJoinResponseData = JsonMapper.ToObject <RoomJoinResponseVo> (response.message);
            GlobalDataScript.roomVo.addWordCard   = GlobalDataScript.roomJoinResponseData.addWordCard;
            GlobalDataScript.roomVo.hong          = GlobalDataScript.roomJoinResponseData.hong;
            GlobalDataScript.roomVo.ma            = GlobalDataScript.roomJoinResponseData.ma;
            GlobalDataScript.roomVo.name          = GlobalDataScript.roomJoinResponseData.name;
            GlobalDataScript.roomVo.roomId        = GlobalDataScript.roomJoinResponseData.roomId;
            GlobalDataScript.roomVo.roomType      = GlobalDataScript.roomJoinResponseData.roomType;
            GlobalDataScript.roomVo.roundNumber   = GlobalDataScript.roomJoinResponseData.roundNumber;
            GlobalDataScript.roomVo.sevenDouble   = GlobalDataScript.roomJoinResponseData.sevenDouble;
            GlobalDataScript.roomVo.xiaYu         = GlobalDataScript.roomJoinResponseData.xiaYu;
            GlobalDataScript.roomVo.ziMo          = GlobalDataScript.roomJoinResponseData.ziMo;
            GlobalDataScript.roomVo.magnification = GlobalDataScript.roomJoinResponseData.magnification;

            GlobalDataScript.roomVo.chengbei     = GlobalDataScript.roomJoinResponseData.chengbei;
            GlobalDataScript.roomVo.aa           = GlobalDataScript.roomJoinResponseData.aa;
            GlobalDataScript.roomVo.zashu        = GlobalDataScript.roomJoinResponseData.zashu;
            GlobalDataScript.roomVo.paofen       = GlobalDataScript.roomJoinResponseData.paofen;
            GlobalDataScript.roomVo.roundtype    = GlobalDataScript.roomJoinResponseData.roundtype;
            GlobalDataScript.roomVo.yuanzishu    = GlobalDataScript.roomJoinResponseData.yuanzishu;
            GlobalDataScript.roomVo.yuanzijiesu  = GlobalDataScript.roomJoinResponseData.yuanzijiesu;
            GlobalDataScript.roomVo.zhanzhuangbi = GlobalDataScript.roomJoinResponseData.zhanzhuangbi;
            GlobalDataScript.roomVo.guozhuangbi  = GlobalDataScript.roomJoinResponseData.guozhuangbi;
            GlobalDataScript.roomVo.fengfa       = GlobalDataScript.roomJoinResponseData.fengfa;

            GlobalDataScript.surplusTimes = GlobalDataScript.roomJoinResponseData.realRoundNumber();
            GlobalDataScript.gameOver     = false;

            GlobalDataScript.loginResponseData.roomId = GlobalDataScript.roomJoinResponseData.roomId;
            //loadPerfab("Prefab/Panel_GamePlay");
            GlobalDataScript.gamePlayPanel = PrefabManage.loadPerfab("Prefab/Panel_GamePlay");
            GlobalDataScript.gamePlayPanel.GetComponent <MyMahjongScript> ().joinToRoom(GlobalDataScript.roomJoinResponseData.playerList);
            closeDialog();
        }
        else
        {
            TipsManagerScript.getInstance().setTips(response.message);
        }
    }
示例#28
0
    public void displayAvatorIp()
    {
        //userInfoPanel.SetActive (true);
        if (avatarvo != null)
        {
            GameObject obj = PrefabManage.loadPerfab("Prefab/userInfo");
            obj.GetComponent <ShowUserInfoScript>().setUIData(avatarvo);
            SoundCtrl.getInstance().playSoundByActionButton(1);

//			if (avatarvo.account.uuid == GlobalDataScript.loginResponseData.account.uuid) {
//				GameObject obj = PrefabManage.loadPerfab ("Prefab/userInfo");
//				obj.GetComponent<ShowUserInfoScript> ().setUIData (avatarvo);
//				SoundCtrl.getInstance ().playSoundByActionButton (1);
//			} else {
//				GameObject obj = PrefabManage.loadPerfab ("Prefab/userInfo2");
//				obj.GetComponent<ShowUserInfoScript> ().setUIData (avatarvo);
//				SoundCtrl.getInstance ().playSoundByActionButton (1);
//			}
        }
    }
示例#29
0
    //	public void toggleHongClick(){
    //
    //		if (zhuanzhuanGameRule [2].isOn) {
    //			zhuanzhuanGameRule [0].isOn = true;
    //		}
    //	}
    //
    //	public void toggleQiangGangHuClick(){
    //		if (zhuanzhuanGameRule [1].isOn) {
    //			zhuanzhuanGameRule [2].isOn = false;
    //		}
    //	}

    public void onCreateRoomCallback(ClientResponse response)
    {
        if (watingPanel != null)
        {
            watingPanel.gameObject.SetActive(false);
        }
        MyDebug.Log(response.message);
        if (response.status == 1)
        {
            print(sendVo);
            //RoomCreateResponseVo responseVO = JsonMapper.ToObject<RoomCreateResponseVo> (response.message);
            int roomid = Int32.Parse(response.message);
            sendVo.roomId           = roomid;
            GlobalDataScript.roomVo = sendVo;
            GlobalDataScript.loginResponseData.roomId   = roomid;
            GlobalDataScript.loginResponseData.main     = true;
            GlobalDataScript.loginResponseData.isOnLine = true;
            GlobalDataScript.reEnterRoomData            = null;
            //SceneManager.LoadSceneAsync(1);

            /**
             * if (gameSence == null) {
             *      gameSence = Instantiate (Resources.Load ("Prefab/Panel_GamePlay")) as GameObject;
             *      gameSence.transform.parent = GlobalDataScript.getInstance ().canvsTransfrom;
             *      gameSence.transform.localScale = Vector3.one;
             *      gameSence.GetComponent<RectTransform> ().offsetMax = new Vector2 (0f, 0f);
             *      gameSence.GetComponent<RectTransform> ().offsetMin = new Vector2 (0f, 0f);
             *      gameSence.GetComponent<MyMahjongScript> ().createRoomAddAvatarVO (GlobalDataScript.loginResponseData);
             * }*/
            GlobalDataScript.gamePlayPanel = PrefabManage.loadPerfab("Prefab/Panel_GamePlay");

            //GlobalDataScript.gamePlayPanel.GetComponent<MyMahjongScript> ().createRoomAddAvatarVO (GlobalDataScript.loginResponseData);

            closeDialog();
            //closeXiazui();
        }
        else
        {
            TipsManagerScript.getInstance().setTips(response.message);
        }
    }
示例#30
0
 private void zhuama(string allMas, List <int> vailedMa)
 {
     if (allMas == "" || allMas == null)
     {
         return;
     }
     if (zhuamaPanel == null)
     {
         List <AvatarVO> avatarList = new List <AvatarVO> ();
         int             tempCount  = 0;
         for (int i = 0; i < 4; i++)
         {
             AvatarVO avo = new AvatarVO();
             avo.account      = new Account();
             avo.account.uuid = aa.playerItems [i].uuid;
             avatarList.Add(avo);
         }
         zhuamaPanel = PrefabManage.loadPerfab("prefab/Panel_ZhuaMa");
         zhuamaPanel.GetComponent <ZhuMaScript> ().arrageMas(allMas, avatarList, vailedMa);
     }
     Invoke("frontZhuaMa", 7);
 }