Ejemplo n.º 1
0
    private void SendCreateRoom()
    {
        if (this.CheckRoomCard ())
        {
            this.hallProxy.HallInfo.CapScore = (this.View.CapScore.Toggle.isOn) ? 21 : 22;
            this.hallProxy.HallInfo.PayType = (this.View.NotWord.Toggle.isOn) ? 20 : 19;

            CheckCreateRoomC2S package = new CheckCreateRoomC2S();
            package.roomRounds = this.hallProxy.HallInfo.Innings;
            package.playType.Add((this.View.NotWord.Toggle.isOn) ? 20 : 19);
            package.playType.Add(this.hallProxy.HallInfo.CapScore);
            package.roomRule = roomTypeInt();
            NetMgr.Instance.SendBuff<CheckCreateRoomC2S>(SocketType.HALL, MsgNoC2S.REQUEST_CREATEROOM_C2S.GetHashCode(), 0, package);

            Debug.Log(package.roomRule);
        }
        else
        {
            DialogMsgVO dialogVO = new DialogMsgVO();
            dialogVO.dialogType = DialogType.ALERT;
            dialogVO.title = "创建房间失败";
            dialogVO.content = "您的房卡不足,请充值";
            DialogView dialogView = UIManager.Instance.ShowUI(UIViewID.DIALOG_VIEW) as DialogView;
            dialogView.data = dialogVO;
        }
    }
Ejemplo n.º 2
0
    /// <summary>规则
    /// 40——8局,41——一锅
    /// 42——房主扣,43——玩家均摊
    /// 44——三家炮,45——一家炮
    /// 46——蛋带翻,47——蛋不翻
    /// 48——长跑3,49——长跑5,50——长跑10
    /// </summary>
    private void SendCreateRoom()
    {
        if (this.CheckRoomCard())
        {
            //局数
            if (View.EightRound.GetComponent <Toggle>().isOn)
            {
                round = 40; PlayerPrefs.SetString(PrefsKey.ROUND, "8");
            }
            else
            {
                { round = 41; PlayerPrefs.SetString(PrefsKey.ROUND, "一锅"); }
            }
            //房费
            if (View.CreatorPay.GetComponent <Toggle>().isOn)
            {
                ruleList.Add(42); PlayerPrefs.SetString(PrefsKey.PAYWAY, "房主支付");
            }
            else
            {
                { ruleList.Add(43); PlayerPrefs.SetString(PrefsKey.PAYWAY, "玩家均摊"); }
            }

            //玩法
            if (View.OneShoot.GetComponent <Toggle>().isOn)
            {
                ruleList.Add(45); PlayerPrefs.SetString(PrefsKey.RULE1, "一家炮");
            }
            else
            {
                ruleList.Add(44); PlayerPrefs.SetString(PrefsKey.RULE1, "三家炮");
            }

            if (View.EggCanLieDown.GetComponent <Toggle>().isOn)
            {
                ruleList.Add(46); PlayerPrefs.SetString(PrefsKey.RULE2, "蛋带翻");
            }
            else
            {
                ruleList.Add(47); PlayerPrefs.SetString(PrefsKey.RULE2, "蛋不翻");
            }

            if (View.Run3.GetComponent <Toggle>().isOn)
            {
                ruleList.Add(48); PlayerPrefs.SetString(PrefsKey.RULE3, "长跑3");
            }
            else if (View.Run5.GetComponent <Toggle>().isOn)
            {
                ruleList.Add(49); PlayerPrefs.SetString(PrefsKey.RULE3, "长跑5");
            }
            else
            {
                ruleList.Add(50); PlayerPrefs.SetString(PrefsKey.RULE3, "长跑10");
            }

            CheckCreateRoomC2S package = new CheckCreateRoomC2S();
            package.roomRounds = round == 40 ? 8 : 1000000;//无用
            package.roomRule   = round;
            package.playType.AddRange(ruleList);

            NetMgr.Instance.SendBuff <CheckCreateRoomC2S>(SocketType.HALL, MsgNoC2S.C2S_Hall_CREATE_ROOM.GetHashCode(), 0, package);
        }
        else
        {
            DialogMsgVO dialogVO = new DialogMsgVO();
            dialogVO.dialogType = DialogType.ALERT;
            dialogVO.title      = "创建房间失败";
            dialogVO.content    = "您的房卡不足,请充值";
            DialogView dialogView = UIManager.Instance.ShowUI(UIViewID.DIALOG_VIEW) as DialogView;
            dialogView.data = dialogVO;
        }
    }