Exemple #1
1
        /// <summary>
        /// 初始化用户信息
        /// </summary>
        /// <param name="gameInfo"></param>
        public void InitUser(ISFSObject gameInfo)
        {
            if (gameInfo.ContainsKey("user"))
            {
                InitUserGameState(gameInfo.GetSFSObject("user"));
            }

            //初始化其他玩家信息
            if (gameInfo.ContainsKey("users"))
            {
                //初始化每个玩家的信息
                ISFSArray users = gameInfo.GetSFSArray(RequestKey.KeyUserList);
                foreach (ISFSObject user in users)
                {
                    InitUserGameState(user);
                }

                ResultMgr.DoResult();
            }
            var gdata = App.GetGameData <SssGameData>();

            gdata.GetPlayer <SelfPanel>().SetReadyBtnActive(!gdata.IsPlaying);

            //初始化庄家标识
            if (gameInfo.ContainsKey("banker"))
            {
                int bankerSeat = gameInfo.GetInt("banker");
                gdata.BankerSeat    = bankerSeat;
                gdata.IsBankerModel = true;
                gdata.GetPlayer <SssPlayer>(bankerSeat, true).SetBankerMarkActive();
            }
        }
Exemple #2
-1
        /// <summary>
        /// 初始化用户信息
        /// </summary>
        /// <param name="gameInfo"></param>
        public void InitUser(ISFSObject gameInfo)
        {
            if (gameInfo.ContainsKey("user"))
            {
                var data = gameInfo.GetSFSObject("user");
                InitUserGameState(data);
                bool selfReadyState = data.ContainsKey("state") && data.GetBool("state");
                SettingMenu.OnSelfReady(selfReadyState);
            }

            //初始化其他玩家信息
            if (gameInfo.ContainsKey("users"))
            {
                //初始化每个玩家的信息
                ISFSArray users = gameInfo.GetSFSArray(RequestKey.KeyUserList);
                foreach (ISFSObject user in users)
                {
                    InitUserGameState(user);
                }

                ResultMgr.DoResult();
            }
            var gdata = App.GetGameData <SssGameData>();

            //初始化庄家标识
            if (gameInfo.ContainsKey("banker"))
            {
                int bankerSeat = gameInfo.GetInt("banker");
                gdata.BankerSeat    = bankerSeat;
                gdata.IsBankerModel = true;
                gdata.GetPlayer <SssPlayer>(bankerSeat, true).SetBankerMarkActive();
            }

            if (gdata.ShowAutoReadyTime)
            {
                int lastTime = GetRemainingTime(gdata.ReadyTime, gameInfo);
                gdata.GetPlayer <SelfPanel>().CountDownReadyTime(lastTime);
            }
        }