コード例 #1
0
        /// <summary>
        /// 投票解散房间
        /// </summary>
        private void DismissRoom()
        {
            //用于测试
            //YxDebug.Log(" ============= DismissRoom ========== ");
            //App.GetRServer<DuifenGameServer>().DismissRoom(2);
            //return;
            //

            DismissRoomMgr dismissRoomMgr = App.GetGameManager <PaiJiuGameManager>().DismissRoomMgr;

            //游戏开始了就需要发起投票,否则玩家可以自主决定
            if (App.GetGameData <PaiJiuGameData>().IsPlayed)
            {
                YxMessageBox.Show(new YxMessageBoxData()
                {
                    Msg       = "确定要发起投票,解散房间么?",
                    BtnStyle  = YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle,
                    IsTopShow = true,
                    Listener  = (box, btnName) =>
                    {
                        if (btnName == YxMessageBox.BtnLeft)
                        {
                            if (!dismissRoomMgr.Container.activeSelf)
                            {
                                App.GetRServer <PaiJiuGameServer>().DismissRoom(2);
                                App.GetRServer <PaiJiuGameServer>().DismissRoom(3);
                            }
                            else
                            {
                                Debug.Log("投票已发起!");
                                YxMessageBox.Show(new YxMessageBoxData
                                {
                                    Msg     = "投票已发起!",
                                    Delayed = 5,
                                });
                                dismissRoomMgr.Container.transform.GetChild(0).gameObject.SetActive(true);
                            }
                        }
                    },
                });
            }
            else
            {
                //房主可以解散房间,玩家则是自己退出房间
                if (App.GameData.SelfSeat == 0)
                {
                    YxMessageBox.Show(new YxMessageBoxData()
                    {
                        Msg       = "确定要解散房间吗?",
                        BtnStyle  = YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle,
                        IsTopShow = true,
                        Listener  = (box, btnName) =>
                        {
                            if (btnName == YxMessageBox.BtnLeft)
                            {
                                IRequest req = new ExtensionRequest("dissolve", new SFSObject());
                                App.GetRServer <PaiJiuGameServer>().SendRequest(req);
                            }
                        },
                    });
                }
                else
                {
                    YxMessageBox.Show(new YxMessageBoxData()
                    {
                        Msg       = "确定要退出房间么?",
                        BtnStyle  = YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle,
                        IsTopShow = true,
                        Listener  = (box, btnName) =>
                        {
                            if (btnName == YxMessageBox.BtnLeft)
                            {
                                App.QuitGame();
                            }
                        },
                    });
                }
            }
        }
コード例 #2
0
 private void OnSuccess(object msg)
 {
     CallBack(msg);
     YxMessageBox.Show("提交成功!");
     Close();
 }
コード例 #3
0
        protected override void OnClickListener(GameObject gob)
        {
            var btnid = (MenuBtn)UIEventListener.Get(gob).parameter;
            var gdata = App.GetGameData <TexasGameData>();

            switch (btnid)
            {
            case MenuBtn.Menu_Btn:
                MenuFather.SetActive(true);

                foreach (var tween in BtnTweens)
                {
                    tween.GetComponent <TweenColor>().ResetToBeginning();
                    tween.GetComponent <TweenScale>().ResetToBeginning();
                }

                if (gdata.IsRoomGame)
                {
                    //房卡没有换房
                    var changeBtn = Tools.GobSelectName(Buttons, MenuBtn.Change_Btn.ToString());
                    if (changeBtn != null)
                    {
                        changeBtn.SetActive(false);
                    }
                    MenuPanelGrid.cellHeight = 100;

                    //解散房间
                    if (gdata.IsRoomOwner || gdata.IsPlayed)
                    {
                        var backBtn = Tools.GobSelectName(Buttons, MenuBtn.Back_Btn.ToString());
                        if (backBtn != null)
                        {
                            var sprName = "dismiss";
                            var btn     = backBtn.GetComponent <UIButton>();
                            btn.normalSprite   = sprName + "_up";
                            btn.pressedSprite  = sprName + "_over";
                            btn.hoverSprite    = sprName + "_over";
                            btn.disabledSprite = sprName + "_up";
                        }
                    }
                }

                MenuBgTween.PlayForward();
                break;

            case MenuBtn.Back_Btn:

                //开放模式下,走解散房间,否则更换房间
                if (gdata.IsRoomGame)
                {
                    DismissRoom();
                }
                else
                {
                    QuitRoom();
                }
                CloseMenu();
                break;

            case MenuBtn.Change_Btn:
                ChangeRoom();
                CloseMenu();
                break;

            case MenuBtn.PokerType_Btn:
                if (HelpPanel != null)
                {
                    HelpPanel.SetActive(true);
                }
                CloseMenu();
                break;

            case MenuBtn.Close_Btn:
                CloseMenu();
                break;

            case MenuBtn.AddGold_Btn:
            {
                var selfInfo = gdata.GetPlayerInfo();
                if (gdata.GStatus > YxEGameStatus.Over && selfInfo.State)
                {
                    YxMessageBox.Show(new YxMessageBoxData
                        {
                            Msg       = "正在游戏中,不能添加筹码!",
                            IsTopShow = true,
                            Delayed   = 5,
                        });
                }
                else
                {
                    //打开选择携带钱界面
                    App.GetGameManager <TexasGameManager>().GetGoldMagr.OpenPanel(selfInfo);
                }
            }
            break;

            case MenuBtn.Setting_Btn:
                OnClickSettingBtn();
                CloseMenu();
                break;

            case MenuBtn.History_Btn:
                var historyResultMgr = App.GetGameManager <TexasGameManager>().HistoryResultMgr;
                if (historyResultMgr != null)
                {
                    historyResultMgr.ShowHistoryView();
                }
                CloseMenu();
                break;

            case MenuBtn.HelpBtn:

                break;
            }
        }
コード例 #4
0
        public void OnClickExtractView()
        {
            string platform = "";
            float  value    = 0;
            string password = "";

            if (PlatformId)
            {
                platform = PlatformId.value;
            }
            if (CostNumber)
            {
                value = float.Parse(CostNumber.value);
            }
            if (Password)
            {
                password = Password.value;
            }
            if (string.IsNullOrEmpty(platform))
            {
                YxMessageBox.Show("账号不能为空");
                return;
            }
            if (string.IsNullOrEmpty(password))
            {
                YxMessageBox.Show("密码不能为空");
                return;
            }
            long realValue = YxUtiles.RecoverShowNumber(value);

            if (realValue < 1)
            {
                YxMessageBox.Show("输入金额过小,请重新输入!!!");
                return;
            }
            YxDebug.Log("Real value is:" + realValue);
            YxDebug.Log("show value is :" + value);
            var returnValue = YxUtiles.RecoverShowNumber(value);

            YxDebug.Log("Real exchange value is :" + returnValue);
            YxMessageBox.Show(
                string.Format(SureNoticeFormat, _curCostType, value, _extractValue),
                null,
                (window, btnname) =>
            {
                switch (btnname)
                {
                case YxMessageBox.BtnLeft:
                    Facade.Instance <TwManger>().SendAction(
                        ExtractAciton,
                        new Dictionary <string, object>()
                    {
                        { _keyExtractPlatformType, _curCostData.CostType },
                        { _keyExtractCostType, _curCostData.CostType },
                        { _keyExtractAccount, platform },
                        { _keyExtractValue, returnValue },
                        { _keyPassword, password },
                    },
                        delegate(object msg)
                    {
                        StartCoroutine(YxTools.WaitExcuteCalls(OnExtractSuccess));
                        Clear();
                    }
                        );
                    break;

                case YxMessageBox.BtnRight:
                    break;
                }
            },
                true,
                YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle
                );
        }
コード例 #5
0
        protected virtual void OnClickListener(GameObject gob)
        {
            var btnid = (MenuBtn)UIEventListener.Get(gob).parameter;
            var gdata = App.GetGameData <TexasGameData>();

            switch (btnid)
            {
            case MenuBtn.Menu_Btn:
                MenuFather.SetActive(true);
                foreach (GameObject tween in BtnTweens)
                {
                    tween.GetComponent <TweenColor>().ResetToBeginning();
                    tween.GetComponent <TweenScale>().ResetToBeginning();
                }
                MenuBgTween.PlayForward();
                break;

            case MenuBtn.Back_Btn:

                //分清开房模式和非开放模式
                if (gdata.IsRoomGame)
                {
                    //游戏开始了就需要发起投票,否则玩家可以自主决定
                    if (gdata.IsPlayed)
                    {
                        YxMessageBox.Show(new YxMessageBoxData
                        {
                            Msg      = "确定要发起投票,解散房间么?",
                            Listener = (box, btnName) =>
                            {
                                if (btnName == YxMessageBox.BtnLeft)
                                {
                                    var gMgr     = App.GetGameManager <TexasGameManager>();
                                    var rmodeMgr = gMgr.RModelMagr;
                                    Debug.Log("RModelMgr.GetInstance().DismissRoom" + rmodeMgr.DismissRoom.activeSelf);
                                    if (!rmodeMgr.DismissRoom.activeSelf)
                                    {
                                        App.GetRServer <TexasGameServer>().DismissRoom(2);
                                        App.GetRServer <TexasGameServer>().DismissRoom(3);
                                    }
                                    else
                                    {
                                        Debug.Log("确定要发起投票,解散房间么?");
                                        YxMessageBox.Show("请不要频繁发出解散请求!!", 5);
                                        rmodeMgr.DismissRoom.transform.GetChild(0).gameObject.SetActive(true);
                                    }
                                }
                            },
                            BtnStyle  = YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle,
                            IsTopShow = true
                        });
                    }
                    else
                    {
                        //房主可以解散房间,玩家则是自己退出房间
                        if (gdata.SelfSeat == 0)
                        {
                            YxMessageBox.Show("确定要解散房间吗?", "", (box, btnName) =>
                            {
                                if (btnName == YxMessageBox.BtnLeft)
                                {
                                    App.GetRServer <TexasGameServer>().DismissRoom();
                                }
                            }, true, YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle
                                              );
                        }
                        else
                        {
                            YxMessageBox.Show("确定要退出房间么?", "", (box, btnName) =>
                            {
                                if (btnName == YxMessageBox.BtnLeft)
                                {
                                    App.QuitGame();
                                }
                            }, true, YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle
                                              );
                        }
                    }
                }
                else
                {
                    var selfInfo = gdata.GetPlayerInfo();
                    if (gdata.GStatus == YxEGameStatus.PlayAndConfine && selfInfo.State)
                    {
                        YxMessageBox.Show("正在游戏中,结束后再退出!!!", 5);
                    }
                    else
                    {
                        YxMessageBox.Show("确定要退出游戏吗?", "", (box, btnName) =>
                        {
                            if (btnName == YxMessageBox.BtnLeft)
                            {
                                App.QuitGame();
                            }
                        }, true, YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle, null, 5);
                    }
                }

                CloseMenu();
                break;

            case MenuBtn.Change_Btn:
            {
                var selfInfo = gdata.GetPlayerInfo();
                if (gdata.GStatus == YxEGameStatus.PlayAndConfine && selfInfo.State)
                {
                    YxMessageBox.Show("正在游戏中,不能换房间!!!", 5);
                }
                else
                {
                    var gMgr = App.GetGameManager <TexasGameManager>();
                    if (gMgr.IsResultDone)
                    {
                        gMgr.ResultDone();
                    }
                    gMgr.Reset();
                    gMgr.BetMagr.Reset();
                    App.GetRServer <TexasGameServer>().OnAllowEnter();
                    YxWindowManager.ShowWaitFor();
                }
                CloseMenu();
            }
            break;

            case MenuBtn.PokerType_Btn:
                HelpPanel.SetActive(true);
                CloseMenu();
                break;

            case MenuBtn.Close_Btn:
                CloseMenu();
                break;

            case MenuBtn.AddGold_Btn:
            {
                var selfInfo = gdata.GetPlayerInfo();
                if (gdata.GStatus == YxEGameStatus.PlayAndConfine && selfInfo.State)
                {
                    YxMessageBox.Show("正在游戏中,不能添加筹码!", 5);
                }
                else
                {
                    //打开选择携带钱界面
                    var gMgr = App.GetGameManager <TexasGameManager>();
                    gMgr.GetGoldMagr.OpenPanel(selfInfo);
                }
            }
            break;
            }
        }
コード例 #6
0
        /// <summary>
        /// 投票解散房间
        /// </summary>
        private void DismissRoom()
        {
            var gdata = App.GetGameData <TexasGameData>();

            //游戏开始了就需要发起投票,否则玩家可以自主决定
            if (gdata.IsPlayed)
            {
                YxMessageBox.Show(new YxMessageBoxData
                {
                    Msg       = "确定要发起投票,解散房间么?",
                    BtnStyle  = YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle,
                    IsTopShow = true,
                    Listener  = (box, btnName) =>
                    {
                        if (btnName == YxMessageBox.BtnLeft)
                        {
                            var gMgr = App.GetGameManager <TexasGameManager>();
                            if (!gMgr.RModelMagr.DismissRoom.activeSelf)
                            {
                                App.GetRServer <TexasGameServer>().DismissRoom(2);
                                App.GetRServer <TexasGameServer>().DismissRoom(3);
                            }
                            else
                            {
                                Debug.Log("确定要发起投票,解散房间么?");
                                YxMessageBox.Show(new YxMessageBoxData
                                {
                                    Msg     = "确定要发起投票,解散房间么?",
                                    Delayed = 5,
                                });
                                gMgr.RModelMagr.DismissRoom.transform.GetChild(0).gameObject.SetActive(true);
                            }
                        }
                    },
                });
            }
            else
            {
                //房主可以解散房间,玩家则是自己退出房间
                if (gdata.IsRoomOwner)
                {
                    YxMessageBox.Show(new YxMessageBoxData
                    {
                        Msg       = "确定要解散房间吗?",
                        BtnStyle  = YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle,
                        IsTopShow = true,
                        Listener  = (box, btnName) =>
                        {
                            if (btnName == YxMessageBox.BtnLeft)
                            {
                                App.GetRServer <TexasGameServer>().DismissRoom();
                            }
                        },
                    });
                }
                else
                {
                    YxMessageBox.Show(new YxMessageBoxData
                    {
                        Msg       = "确定要退出房间么?",
                        BtnStyle  = YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle,
                        IsTopShow = true,
                        Listener  = (box, btnName) =>
                        {
                            if (btnName == YxMessageBox.BtnLeft)
                            {
                                App.QuitGame();
                            }
                        },
                    });
                }
            }
        }
コード例 #7
0
        /// <summary>
        /// 设置解散房间按钮的事件,将此方法引入到解散房间按钮的OnClick事件中即可
        /// </summary>
        public void SetDismissRoomBtn()
        {
            var gdata = App.GetGameData <SssGameData>();

            //房间模式下
            if (gdata.IsRoomGame)
            {
                //如果正在游戏,则需要发起投票,否则玩家自主决定
                if (gdata.IsPlayed)
                {
                    if (gameObject.activeSelf)
                    {
                        transform.GetChild(0).gameObject.SetActive(true);
                    }
                    else
                    {
                        YxMessageBox.Show(new YxMessageBoxData()
                        {
                            Msg      = "确定要发起投票,解散房间么?",
                            Listener = (box, btnName) =>
                            {
                                if (btnName == YxMessageBox.BtnLeft)
                                {
                                    //如果没有显示,则发送消息,否则不发送
                                    if (!gameObject.activeSelf)
                                    {
                                        DismissRoom(2);
                                    }
                                    else
                                    {
                                        //为不重复发送解散房间信息,在其下设置子层级用于屏蔽
                                        YxMessageBox.Show(new YxMessageBoxData()
                                        {
                                            Msg = "请不要频繁发出解散请求",
                                        });

                                        transform.GetChild(0).gameObject.SetActive(true);
                                    }
                                }
                            },
                            IsTopShow = true,
                            BtnStyle  = YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle
                        });
                    }
                }
                //非游戏状态下
                else
                {
                    //房主可以直接解散房间
                    if (App.GameData.SelfSeat == 0)
                    {
                        YxMessageBox.Show(new YxMessageBoxData()
                        {
                            Msg      = "确定要解散房间吗?",
                            Listener = (box, btnName) =>
                            {
                                if (btnName == YxMessageBox.BtnLeft)
                                {
                                    IRequest req = new ExtensionRequest("dissolve", new SFSObject());
                                    App.GetRServer <SssGameServer>().SendRequest(req);
                                }
                            },
                            IsTopShow = true,
                            BtnStyle  = YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle
                        });
                    }
                    //普通玩家则退出房间
                    else
                    {
                        YxMessageBox.Show(new YxMessageBoxData()
                        {
                            Msg      = "确定要退出房间么?",
                            Listener = (box, btnName) =>
                            {
                                if (btnName == YxMessageBox.BtnLeft)
                                {
                                    App.QuitGame();
                                }
                            },
                            IsTopShow = true,
                            BtnStyle  = YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle
                        });
                    }
                }
            }

            //非开放模式下
            else
            {
                YxMessageBox.Show(new YxMessageBoxData()
                {
                    Msg      = "确定要退出房间么?",
                    Listener = (box, btnName) =>
                    {
                        if (btnName == YxMessageBox.BtnLeft)
                        {
                            App.QuitGame();
                        }
                    },
                    IsTopShow = true,
                    BtnStyle  = YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle
                });
            }
        }
コード例 #8
0
 private void OnShareFailed(string obj)
 {
     YxMessageBox.Show("非常抱歉,分享失败了!");
 }
コード例 #9
0
        public override void GameResponseStatus(int type, ISFSObject response)
        {
            var gdata = App.GetGameData <MdxGameData>();

            switch (type)
            {
            case RequestType.ChangeBanker:
                int bankSeat = response.GetInt("banker");

                int maxBet = bankSeat < 0 ? int.MaxValue : response.GetInt("allowTotal");
                SetBankerInfo(bankSeat, maxBet);
                ShowNumCtrl.OnChangeBanker(maxBet);

                if (_showBankerTip)
                {
                    BankerTip.ShowBankerTip();
                    _showBankerTip = false;
                }
                break;

            case RequestType.Reward:
                var self = gdata.GetPlayer();
                self.Coin -= 100;
                break;

            case RequestType.Bet:
                BetCtrl.Bet(response);
                PlayerBetListCtrl.AddBetInfo(response);
                RoomInfo.OnPlayerBet();
                ShowNumCtrl.SetOneBet(response);
                break;

            case RequestType.BeginBet:
                gdata.SetGameStatus(YxEGameStatus.Play);
                gdata.BeginBet = true;
                ProgressCtrl.PlayClock("开始下注", response.ContainsKey("cd") ? response.GetInt("cd") : 12, SetStopBet);

                if (gdata.CurrentBanker != null)
                {
                    if (gdata.SelfSeat != gdata.BankSeat)
                    {
                        BetCtrl.ShowChipBtns();
                    }
                    else
                    {
                        BetCtrl.ShowBankerMark();
                        YxMessageBox.Show(new YxMessageBoxData {
                            Msg = TipStringFormat.IsBankerNoBet, Delayed = 2
                        });
                    }
                }
                else
                {
                    BetCtrl.ShowChip();
                }

                ResetGame();            //重置了庄家信息后,重置游戏
                break;

            case RequestType.EndBet:
                SetStopBet();
                gdata.BeginBet = false;
                BetCtrl.HideChip();
                ProgressCtrl.PlayClock("停止下注", 0);
                break;

            case RequestType.RockDices:
                ProgressCtrl.Hide();
                gdata.DiceVals = response.GetIntArray("dices");
                RockDices.ShowRockDices();
                ResultWin.Hide();
                ProgressCtrl.PlayClock("正在摇奖", response.GetInt("cd"));
                break;

            case RequestType.Result:
                //游戏状态设置
                gdata.SetGameStatus(YxEGameStatus.Normal);
                gdata.IsGaming = false;
                ProgressCtrl.PlayClock("正在结算", 0);

                //显示结算
                ResultWin.UpdateView(response);
                ResultWin.Show();

                ResultListCtrl.AddResult(response);
                //刷新玩家
                gdata.GetPlayerInfo <MdxUserInfo>().SimpleParse(response);
                gdata.GetPlayer().UpdateView();
                //隐藏动画
                RockDices.Hide();
                //添加结算数据
                PlayerBetListCtrl.GetResultPlayerInfo(response);
                StartCoroutine(MoveAllChip(response.GetInt("win")));
                break;

            case RequestType.BankerList:
                ProgressCtrl.PlayClock("正在摇奖", response.GetInt("cd"));
                break;

            case RequestType.GroupBet:
                BetCtrl.GroupBet(response);
                PlayerBetListCtrl.AddGroupBetInfo(response);
                RoomInfo.OnGroupBet(response);
                ShowNumCtrl.SetGroupBet(response);
                break;

            case RequestType.WinBankerTime:
                _showBankerTip = true;
                ProgressCtrl.PlayClock("开始抢庄", response.GetInt("cd"));
                BetCtrl.ShowBankerMark();
                break;

            default:
                YxDebug.Log("RequestType : " + type);
                break;
            }
        }
コード例 #10
0
        void AddOnClick()
        {
            //添加返回大厅按钮的OnClick事件
            _bcakButton.onClick.Add(new EventDelegate(() =>
            {
                YxMessageBox.Show(new YxMessageBoxData()
                {
                    Msg       = "确定要退出大厅么?",
                    BtnStyle  = YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle,
                    IsTopShow = true,
                    Listener  = (box, btnName) =>
                    {
                        if (btnName == YxMessageBox.BtnLeft)
                        {
                            App.QuitGame();
                        }
                    },
                });
            }

                                                      ));


            //微信邀请
            _invitButton.onClick.Add(new EventDelegate(() =>
            {
                YxTools.ShareFriend(_roomId.ToString(), _ruleInfo);
            }));

            //分享战绩
            _shareButton.onClick.Add(new EventDelegate(() =>
            {
                YxWindowManager.ShowWaitFor();

                Facade.Instance <WeChatApi>().InitWechat();

                UserController.Instance.GetShareInfo(info =>
                {
                    YxWindowManager.HideWaitFor();

                    var img = GetComponent <CompressImg>() ?? gameObject.AddComponent <CompressImg>();

                    img.DoScreenShot(new Rect(0, 0, Screen.width, Screen.height), imageUrl =>
                    {
                        YxDebug.Log("Url == " + imageUrl);
                        if (Application.platform == RuntimePlatform.Android)
                        {
                            imageUrl = "file://" + imageUrl;
                        }
                        info.ImageUrl  = imageUrl;
                        info.ShareType = ShareType.Image;
                        Facade.Instance <WeChatApi>().ShareContent(info);
                    });
                });
            }));

            //港五暂无开房模式
            _agreeBtn.onClick.Add(new EventDelegate(() => { App.GetRServer <GangWuGameServer>().DismissRoom(3); SetMannerBtn(false); }));

            _disagreeBtn.onClick.Add(new EventDelegate(() => { App.GetRServer <GangWuGameServer>().DismissRoom(-1); SetMannerBtn(false); }));

            _closeBtn.onClick.Add(new EventDelegate(() => { DismissRoom.transform.GetChild(0).gameObject.SetActive(false); }));
        }
コード例 #11
0
        public override void GameResponseStatus(int type, ISFSObject response)
        {
            var gdata = App.GetGameData <BjlGameData>();

            switch (type)
            {
            case RequestType.BeginBet:
                Reset();
                if (App.GameKey.Equals("bjlb"))
                {
                    BankerCtrl.SetApplyBankerBtnActive(true);
                }
                gdata.BeginBet = true;
                ((ProgressCtrl02)ProgressCtrl).PlayClock(response.ContainsKey("cd") ? response.GetInt("cd") : 12, RequestType.BeginBet, SetStopBet);
                //重新设置注的层
                if (gdata.CurrentBanker != null)
                {
                    var curBanekr = gdata.CurrentBanker;
                    curBanekr.TotalCount++;
                    curBanekr.UpdateView();
                    //限制自己为庄家时下注
                    if (gdata.BankSeat < 0)
                    {
                        var bankerInfo = new BjlUserInfo
                        {
                            NickM        = "系统庄",
                            Seat         = -1,
                            CoinA        = long.MaxValue,
                            TotalCount   = 0,
                            WinTotalCoin = 0
                        };
                        gdata.CurrentBanker.Info = bankerInfo;
                        curBanekr.UpdateView();
                    }

                    BankerCtrl.RefreshBanker();

                    if (gdata.SelfSeat != gdata.BankSeat)
                    {
                        BetCtrl.ShowChip();
                    }
                    else
                    {
                        YxMessageBox.Show(new YxMessageBoxData {
                            Msg = "您是本局的庄家!", Delayed = 2
                        });
                    }
                }
                else
                {
                    BetCtrl.ShowChip();
                }

                if (response.ContainsKey("bankRound"))
                {
                    BankerTime.SetBankerTime(response.GetInt("bankRound"));
                }
                else
                {
                    BankerTime.HideBankerTime();
                }
                WaitWin.Hide();
                Facade.Instance <MusicManager>().Play("BeginBet");
                break;

            case RequestType.EndBet:
                base.GameResponseStatus(type, response);

                ProgressCtrl.StopClock(RequestType.EndBet);
                Facade.Instance <MusicManager>().Play("StopBet");

                if (App.GameKey.Equals("bjlb"))
                {
                    BankerCtrl.SetApplyBankerBtnActive(false);
                }
                break;

            case RequestType.Result:
                gdata.SetGameStatus(YxEGameStatus.Normal);
                gdata.IsGaming = false;
                var hisData = gdata.TrendConfig.HistoryData;
                int count   = hisData.Count;
                if (count > 0)
                {
                    int winIndex = GetMenIndex(hisData[count - 1]);
                    var bpg      = response.GetIntArray("bpg");
                    ResultBet(winIndex, bpg);
                    StartCoroutine(ResultMoveChip(winIndex, bpg));
                }


                ProgressCtrl.StopClock(RequestType.Result);
                UserListCtrl.RefreshBanker(response);
                RefreshSelf(response);
                TableResultInfo.ShowTableResultInfo(response);
                CardsCtrl02.SetCardCtrlActive(false);
                break;

            case RequestType.GiveCards:

                if (response.ContainsKey("cd"))
                {
                    ((ProgressCtrl02)ProgressCtrl).PlayClock(response.ContainsKey("cd") ? response.GetInt("cd") : 12, RequestType.GiveCards);
                }
                else
                {
                    ProgressCtrl.Hide();
                }

                CardsCtrl02.BeginGiveCards(response);
                ShowNumCtrl.GroupRefreshNum(response);
                WaitWin.Hide();

                break;

            default:
                base.GameResponseStatus(type, response);
                break;
            }
        }
コード例 #12
0
        public void OnFindRoom()
        {
            string roomCId = GetCurRoomId();//MahNum

            if (roomCId.Equals("") && !MahNum.Equals(""))
            {
                roomCId = MahNum;
            }
            var dic = new Dictionary <string, object>();

            if (_roomState == 1)
            {
                dic["mah_id"]  = _roomNum;
                dic["comm_id"] = roomCId;
            }
            else
            {
                dic["mah_id"] = roomCId;
            }
            Facade.Instance <TwManager>().SendAction("mahjongwm.findWmRoom", dic, info =>
            {
                var data = info as IDictionary <string, object>;
                if (data == null)
                {
                    YxMessageBox.Show(_roomState == 1 ? "您输入的密码不正确!!" : "没有找到麻将馆!!");
                    return;
                }
                var str = data.ContainsKey(RequestKey.KeyMessage) ? data[RequestKey.KeyMessage] : null;
                if (str != null)
                {
                    YxMessageBox.Show(str.ToString());
                    return;
                }
                if (_roomState != 1)
                {
                    var dataInfo = data["data"] as Dictionary <string, object>;
                    if (dataInfo != null && (dataInfo.ContainsKey("is_usepwd") && int.Parse(dataInfo["is_usepwd"].ToString()) == 1))
                    {
                        _roomNum         = roomCId;
                        RoomAction.text  = "输入麻将馆密码";
                        RoomIdLabel.text = "";
                        _roomState       = 1;
                    }
                    else
                    {
                        var win = (MahStadiumCreatGameWindow)CreateOtherWindow("MahStadiumCreatGameWindow");
                        win.UpdateView(info);
                        Close();
                    }
                }
                else
                {
                    var win = (MahStadiumCreatGameWindow)CreateOtherWindow("MahStadiumCreatGameWindow");
                    win.UpdateView(info);
                    Close();

                    RoomIdLabel.text = "";
                    RoomAction.text  = "输入麻将馆号";
                    _roomState       = 0;
                }
            });
        }
コード例 #13
0
ファイル: MenuMgr.cs プロジェクト: da1fanshu/yizhe
        protected void OnClickListener(GameObject gob)
        {
            MenuBtn btnid = (MenuBtn)UIEventListener.Get(gob).parameter;
            var     mgr   = App.GetGameManager <GangWuGameManager>();
            var     gdata = App.GetGameData <GangwuGameData>();

            switch (btnid)
            {
            case MenuBtn.OpenMenu:
                Vector3 v = MenuBgTween.transform.localPosition;
                MoveMenuBg(v, new Vector3(-8, v.y, v.z));
                CloseBtn.SetActive(true);
                break;

            case MenuBtn.BackBtn:
                ////退出游戏按钮事件

                if (CouldOut())
                {
                    YxMessageBox.Show(new YxMessageBoxData()
                    {
                        Msg       = "确定要退出游戏么?",
                        BtnStyle  = YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle,
                        IsTopShow = true,
                        Listener  = (box, btnName) =>
                        {
                            if (btnName == YxMessageBox.BtnLeft)
                            {
                                if (CouldOut())
                                {
                                    App.QuitGame();
                                }
                                else
                                {
                                    YxMessageBox.Show(new YxMessageBoxData()
                                    {
                                        Msg          = "游戏已经开始,请在游戏结束后退出!",
                                        ShowBtnNames = new[] { YxMessageBox.BtnMiddle },
                                        IsTopShow    = true,
                                    });
                                }
                            }
                        }
                    });
                }

                CloseMenu();
                break;


            case MenuBtn.ChangeRoomBtn:

                if (CouldOut())
                {
                    foreach (var yxBaseGamePlayer in gdata.PlayerList)
                    {
                        var player = (PlayerPanel)yxBaseGamePlayer;
                        player.Reset();
                        player.RefreshPanel();
                        player.gameObject.SetActive(false);
                    }

                    App.GetRServer <GangWuGameServer>().ChangeRoom();
                    YxWindowManager.ShowWaitFor();
                }
                else
                {
                    YxDebug.Log("正在游戏中,不能更换房间!");
                    YxMessageBox.Show(new YxMessageBoxData()
                    {
                        Msg       = "正在游戏中,不能更换房间!",
                        IsTopShow = true,
                    });
                }
                CloseMenu();
                break;

            case MenuBtn.HelpBtn:         //显示牌类按钮
                HelpPanel.SetActive(true);
                CloseMenu();
                break;

            case MenuBtn.CloseBtn:
                CloseMenu();
                break;

            case MenuBtn.SettingBtn:
                SettingView.SetActive(true);
                CloseMenu();
                break;

            case MenuBtn.DismissRoomBtn:
                if (gdata.IsRoomGame && (gdata.IsPlayed || gdata.IsGameStart))
                {
                    YxMessageBox.Show(new YxMessageBoxData
                    {
                        Msg      = "确定要发起投票,解散房间么?",
                        BtnStyle = YxMessageBox.LeftBtnStyle | YxMessageBox.RightBtnStyle,
                        Listener = (box, btnName) =>
                        {
                            if (btnName == YxMessageBox.BtnRight)
                            {
                                App.GetRServer <GangWuGameServer>().StartHandsUp(2);
                            }
                        },
                    });
                }
                CloseMenu();
                break;

            case MenuBtn.HistoryBtn:

                mgr.HistoryResultMgr.ShowHistoryView();
                CloseMenu();
                break;
            }
        }