Exemplo n.º 1
0
 public void sendMsg()
 {
     if (msg.text.Length == 0)
     {
         return;
     }
     SoundCtrl.getInstance().playSoundByActionButton(1);
     CustomSocket.getInstance().sendMsg(new MessageBoxRequest(2, msg.text, GlobalDataScript.loginResponseData.account.uuid));
     if (GlobalDataScript.roomVo.gameType == 0)
     {
         if (myMaj == null)
         {
             myMaj = GameObject.Find("Panel_GamePlay(Clone)").GetComponent <MyMahjongScript> ();
         }
         if (myMaj != null)
         {
             myMaj.playerItems [0].showChatMessage(msg.text);
         }
     }
     else if (GlobalDataScript.roomVo.gameType == 1)
     {
         if (myPdk == null)
         {
             myPdk = GameObject.Find("Panel_GamePDK(Clone)").GetComponent <MyPDKScript> ();
         }
         if (myPdk != null)
         {
             myPdk.playerItems [0].showChatMessage(msg.text);
         }
     }
     else if (GlobalDataScript.roomVo.gameType == 3)
     {
         if (myDN == null && GlobalDataScript.roomVo.playerAmounts == 10)
         {
             myDN = GameObject.Find("Panel_GameDN(Clone)").GetComponent <MyDNScript> ();
         }
         if (myDN == null && GlobalDataScript.roomVo.playerAmounts == 6)
         {
             myDN = GameObject.Find("Panel_GameDN_6(Clone)").GetComponent <MyDNScript>();
         }
         if (myDN != null)
         {
             myDN.playerItems [0].showChatMessage(msg.text);
         }
     }
     else if (GlobalDataScript.roomVo.gameType == 4)
     {
         if (myDzpk == null)
         {
             myDzpk = GameObject.Find("Panel_GameDZPK(Clone)").GetComponent <MyDZPKScript> ();
         }
         if (myDzpk != null)
         {
             myDzpk.playerItems [0].showChatMessage(msg.text);
         }
     }
     hidePanel();
 }
Exemplo n.º 2
0
    public void btnClick(int index)
    {
        SoundCtrl.getInstance().playMessageBoxSound(index, GlobalDataScript.loginResponseData.account.sex, 3);
        CustomSocket.getInstance().sendMsg(new MessageBoxRequest(1, GlobalDataScript.loginResponseData.account.sex == 1 ? (index + 1000).ToString(): (index + 3000).ToString(), GlobalDataScript.loginResponseData.account.uuid));
        if (GlobalDataScript.roomVo.gameType == 0)
        {
            if (myMaj == null)
            {
                myMaj = GameObject.Find("Panel_GamePlay(Clone)").GetComponent <MyMahjongScript> ();
            }
            if (myMaj != null)
            {
                myMaj.playerItems [0].showChatMessage(index);
            }
        }
        else if (GlobalDataScript.roomVo.gameType == 1)
        {
            if (myPdk == null)
            {
                myPdk = GameObject.Find("Panel_GamePDK(Clone)").GetComponent <MyPDKScript> ();
            }
            if (myPdk != null)
            {
                myPdk.playerItems [0].showChatMessage(index);
            }
        }
        else if (GlobalDataScript.roomVo.gameType == 3)
        {
            if (myDN == null && GlobalDataScript.roomVo.playerAmounts == 10)
            {
                myDN = GameObject.Find("Panel_GameDN(Clone)").GetComponent <MyDNScript> ();
            }
            if (myDN == null && GlobalDataScript.roomVo.playerAmounts == 6)
            {
                myDN = GameObject.Find("Panel_GameDN_6(Clone)").GetComponent <MyDNScript>();
            }
            if (myDN != null)
            {
                myDN.playerItems [0].showChatMessage(index);
            }
        }
        else if (GlobalDataScript.roomVo.gameType == 4)
        {
            if (myDzpk == null)
            {
                myDzpk = GameObject.Find("Panel_GameDZPK(Clone)").GetComponent <MyDZPKScript> ();
            }
            if (myDzpk != null)
            {
                myDzpk.playerItems [0].showChatMessage(index);
            }
        }

        hidePanel();
    }
Exemplo n.º 3
0
 public void gifClick(int index)
 {
     CustomSocket.getInstance().sendMsg(new MessageBoxRequest(1, index, GlobalDataScript.loginResponseData.account.uuid, GlobalDataScript.loginResponseData.account.sex));
     if (myMaj == null)
     {
         myMaj = GameObject.Find("Panel_GamePlay(Clone)").GetComponent <MyMahjongScript>();
     }
     if (myMaj != null)
     {
         myMaj.playerItems[0].showGifMessage(index);
     }
     hidePanel();
 }
Exemplo n.º 4
0
 public void btnClick(int index)
 {
     SoundCtrl.getInstance().playMessageBoxSound(index, GlobalDataScript.loginResponseData.account.sex);
     CustomSocket.getInstance().sendMsg(new MessageBoxRequest(GlobalDataScript.loginResponseData.account.sex == 1 ? index + 1000 : index + 2000, GlobalDataScript.loginResponseData.account.uuid));
     if (myMaj == null)
     {
         myMaj = GameObject.Find("Panel_GamePlay(Clone)").GetComponent <MyMahjongScript>();
     }
     if (myMaj != null)
     {
         myMaj.playerItems [0].showChatMessage(index);
     }
     hidePanel();
 }
Exemplo n.º 5
0
    private void gameBackPlayResponse(ClientResponse response)
    {
        gamePlayResponseVo = JsonMapper.ToObject <GamePlayResponseVo> (response.message);

        var roomvo = gamePlayResponseVo.roomvo;

        cardCount = getRoomCardCount(roomvo);

        roomRemark.text = MyMahjongScript.getRoomInfoString(roomvo);
        showCardNumber();
        getMyIndex();
        chongZu();
        initall();
        initCard();
    }
Exemplo n.º 6
0
    public void inviteFriend()
    {
        if (GlobalDataScript.roomVo != null)
        {
            RoomCreateVo roomvo = GlobalDataScript.roomVo;
            GlobalDataScript.totalTimes   = roomvo.roundNumber;
            GlobalDataScript.surplusTimes = roomvo.roundNumber;
            string str = MyMahjongScript.getRoomInfoString(roomvo);
            str += "有胆,你就来!";

            string       title = "正宗亳州麻将    房间号:" + roomvo.roomId;
            ShareContent customizeShareParams = new ShareContent();
            customizeShareParams.SetTitle(title);
            customizeShareParams.SetText(str);
            //配置下载地址
            customizeShareParams.SetUrl("http://119.23.128.56:8080/download/index.html");
            //配置分享logo
            customizeShareParams.SetImageUrl("http://119.23.128.56:8080/download/logo.png");
            customizeShareParams.SetShareType(ContentType.Webpage);
            customizeShareParams.SetObjectID("");
            shareSdk.ShareContent(PlatformType.WeChat, customizeShareParams);
        }
    }
Exemplo n.º 7
0
    public void sendBiaoQing(string indexStr)
    {
        SoundCtrl.getInstance().playSoundByActionButton(1);
        int    sex = GlobalDataScript.loginResponseData.account.sex;
        string tmp = null;

        if (sex == 1)
        {
            tmp = "" + (1000 + int.Parse(indexStr));
        }
        else
        {
            tmp = "" + (3000 + int.Parse(indexStr));
        }
        CustomSocket.getInstance().sendMsg(new MessageBoxRequest(3, tmp, GlobalDataScript.loginResponseData.account.uuid));
        if (GlobalDataScript.roomVo.gameType == (int)GameTypePK.NULL)
        {
            if (myMaj == null)
            {
                myMaj = GameObject.Find("Panel_GamePlay(Clone)").GetComponent <MyMahjongScript> ();
            }
            if (myMaj != null)
            {
                int index = int.Parse(indexStr) - 1;

                //SoundCtrl.getInstance ().playMessageBoxSound (index + 1, sex, 2);
                myMaj.playerItems [0].showBiaoQing(myMaj.getBqScript().getBiaoqing(index));
            }
        }
        else if (GlobalDataScript.roomVo.gameType == (int)GameTypePK.PDK)
        {
            if (myPdk == null)
            {
                myPdk = GameObject.Find("Panel_GamePDK(Clone)").GetComponent <MyPDKScript> ();
            }
            if (myPdk != null)
            {
                int index = int.Parse(indexStr) - 1;

                //SoundCtrl.getInstance ().playMessageBoxSound (index + 1, sex, 2);
                myPdk.playerItems [0].showBiaoQing(myPdk.getBqScript().getBiaoqing(index));
            }
        }
        else if (GlobalDataScript.roomVo.gameType == (int)GameTypePK.DN)
        {
            if (myDN == null)
            {
                myDN = GameObject.Find("Panel_GameDN(Clone)").GetComponent <MyDNScript> ();
            }
            if (myDN != null)
            {
                int index = int.Parse(indexStr) - 1;
//				if(!(GlobalDataScript.roomVo.gameType == 3))
//					SoundCtrl.getInstance ().playMessageBoxSound (index + 1, sex, 2);
                myDN.playerItems [0].showBiaoQing(myDN.getBqScript().getBiaoqing(index));
            }
        }
        else if (GlobalDataScript.roomVo.gameType == (int)GameTypePK.DZPK)
        {
            if (myDzpk == null)
            {
                myDzpk = GameObject.Find("Panel_GameDZPK(Clone)").GetComponent <MyDZPKScript> ();
            }
            if (myDzpk != null)
            {
                int index = int.Parse(indexStr) - 1;
                //
                //SoundCtrl.getInstance ().playMessageBoxSound (index + 1, sex, 2);
                myDzpk.playerItems [0].showBiaoQing(myDzpk.getBqScript().getBiaoqing(index));
            }
        }
        else if (GlobalDataScript.roomVo.gameType == (int)GameTypePK.AMH)
        {
            if (myAmh == null)
            {
                myAmh = GameObject.Find("Panel_GameAMH(Clone)").GetComponent <MyDZPKScript>();
            }
            if (myAmh != null)
            {
                int index = int.Parse(indexStr) - 1;
                //
                //SoundCtrl.getInstance ().playMessageBoxSound (index + 1, sex, 2);
                myAmh.playerItems[0].showBiaoQing(myAmh.getBqScript().getBiaoqing(index));
            }
        }

        hidePanel();
    }
 void Awake()
 {
     instant = this;
 }
Exemplo n.º 9
0
    private void analysisPaiInfo(HupaiResponseItem parms)
    {
        var    itemData   = parms.totalInfo;
        string gangpaiStr = itemData.gang;

        if (gangpaiStr != null && gangpaiStr.Length > 0)
        {
            string[] gangtemps = gangpaiStr.Split(',');
            for (int i = 0; i < gangtemps.Length; i++)
            {
                var        itemList   = gangtemps[i].Split(':');
                GangpaiObj gangpaiObj = new GangpaiObj();
                gangpaiObj.uuid      = int.Parse(itemList[0]);
                gangpaiObj.cardPiont = int.Parse(itemList[1]);
                gangpaiObj.type      = itemList[2];
                //增加判断是否为自己的杠牌的操作

                paiArray [gangpaiObj.cardPiont] -= 4;
                gangPaiList.Add(gangpaiObj);

                if (gangpaiObj.type == "an")
                {
                    mdesCribe += "暗杠  ";
                }
                else
                {
                    mdesCribe += "明杠  ";
                }
            }
        }


        string pengpaiStr = itemData.peng;

        if (pengpaiStr != null && pengpaiStr.Length > 0)
        {
            pengpaiList = pengpaiStr.Split(',');


            //string[] pengpaiListTTT = pengpaiList;
            List <string> pengpaiListTTT = new List <string>();
            for (int i = 0; i < pengpaiList.Length; i++)
            {
                if (paiArray [int.Parse(pengpaiList [i])] >= 3)
                {
                    paiArray [int.Parse(pengpaiList [i])] -= 3;
                    pengpaiListTTT.Add(pengpaiList [i]);
                }
            }
            pengpaiList = pengpaiListTTT.ToArray();
        }


        string chipaiStr = itemData.chi;

        if (chipaiStr != null && chipaiStr.Length > 0)
        {
            string[] chitemps = chipaiStr.Split(',');
            for (int i = 0; i < chitemps.Length; i++)
            {
                string    item      = chitemps[i];
                ChipaiObj chipaiObj = new ChipaiObj();
                string[]  pointStr  = item.Split(':');
                chipaiObj.cardPionts = pointStr;
                chipaiList.Add(chipaiObj);
                paiArray [int.Parse(chipaiObj.cardPionts[0])] -= 1;
                paiArray [int.Parse(chipaiObj.cardPionts[1])] -= 1;
                paiArray [int.Parse(chipaiObj.cardPionts[2])] -= 1;
            }
        }


        string hupaiStr = itemData.hu;
        int    huType   = -1;

        if (!string.IsNullOrEmpty(hupaiStr))
        {
            var strList = hupaiStr.Split(':');
            hupaiObj.uuid      = int.Parse(strList[0]);
            hupaiObj.cardPiont = int.Parse(strList[1]);
            hupaiObj.type      = strList[2];
            //增加判断是否是自己胡牌的判断

            huType = MyMahjongScript.checkAvarHupai(parms.uuid, itemData.hu);
            if (huType == 0)
            {
                mdesCribe += "点炮";
            }
            else
            {
                if (huType == 1)
                {
                    mdesCribe += "接炮";
                }
                else if (huType == 2)
                {
                    mdesCribe += "自摸";
                }

                if (hupaiObj.type == "qingyise")
                {
                    mdesCribe += "清一色";
                }
                if (hupaiObj.type == "qixiaodui")
                {
                    mdesCribe += "七小对";
                }
                if (hupaiObj.type == "gangshanghua")
                {
                    mdesCribe += "杠上花";
                }
                huFlagImg.SetActive(true);
                paiArray[hupaiObj.cardPiont] -= 1;
            }
        }
        print(" >>>>>>>>>>>   hu pai result  <<<<<<<<<<<<" + resultDes);
        resultDes.text = mdesCribe;
        maPais         = parms.getMaPoints();
        arrangePai(huType);
    }
Exemplo n.º 10
0
    public void clickmfbq(string indexStr)
    {
        SoundCtrl.getInstance().playSoundByActionButton(1);
        if (ava == null)
        {
            return;
        }
        CustomSocket.getInstance().sendMsg(new MessageBoxRequest(4, indexStr, GlobalDataScript.loginResponseData.account.uuid, ava.account.uuid));
//		if (myMaj == null) {
//			myMaj = GameObject.Find("Panel_GamePlay(Clone)").GetComponent<MyMahjongScript>();
//		}
//		if (myMaj != null) {
//			int myIndex = myMaj.getMyIndexFromList ();
//			int destAvaIndex = myMaj.getIndex (ava.account.uuid);
//			int seatIndex = destAvaIndex - myIndex;
//			if (seatIndex < 0) {
//				seatIndex = 4 + seatIndex;
//			}
//
//			myMaj.playerItems [seatIndex].showMfbq (0, seatIndex, indexStr);
//		}

        if (GlobalDataScript.roomVo.gameType == 0)
        {
            if (myMaj == null)
            {
                myMaj = GameObject.Find("Panel_GamePlay(Clone)").GetComponent <MyMahjongScript> ();
            }
            if (myMaj != null)
            {
                int myIndex      = myMaj.getMyIndexFromList();
                int destAvaIndex = myMaj.getIndex(ava.account.uuid);
                int seatIndex    = destAvaIndex - myIndex;
                if (seatIndex < 0)
                {
                    seatIndex = 4 + seatIndex;
                }

                myMaj.playerItems [seatIndex].showMfbq(0, seatIndex, indexStr);
            }
        }
        else if (GlobalDataScript.roomVo.gameType == 1)
        {
            if (myPdk == null)
            {
                myPdk = GameObject.Find("Panel_GamePDK(Clone)").GetComponent <MyPDKScript> ();
            }
            if (myPdk != null)
            {
                int myIndex      = myPdk.getMyIndexFromList();
                int destAvaIndex = myPdk.getIndex(ava.account.uuid);
                int seatIndex    = destAvaIndex - myIndex;
                if (seatIndex < 0)
                {
                    seatIndex = 3 + seatIndex;
                }

                myPdk.playerItems [seatIndex].showMfbq(0, seatIndex, indexStr);
            }
        }
        else if (GlobalDataScript.roomVo.gameType == 3)
        {
            if (myDN == null)
            {
                myDN = GameObject.Find("Panel_GameDN(Clone)").GetComponent <MyDNScript> ();
            }
            if (myDN != null)
            {
                int myIndex      = myDN.getMyIndexFromList();
                int destAvaIndex = myDN.getIndex(ava.account.uuid);
                int seatIndex    = destAvaIndex - myIndex;
                if (seatIndex < 0)
                {
                    seatIndex = 5 + seatIndex;
                }

                myDN.playerItems [seatIndex].showMfbq(0, seatIndex, indexStr);
            }
        }


        closeUserInfoPanel();
    }