Exemplo n.º 1
0
        public ERoomUser PlayerAddCoins(EGameInfo gi, string userOpenId, decimal coins, decimal diff)
        {
            //队列重新排列
            GameDataHandle.ReloadPlayer();

            //获取当前玩家,并修改状态
            var player = this.GameDataHandle.PopPlayer(PlayerStauts.AddCoins);

            player.PlayerStauts = PlayerStauts.AddCoins;
            RoomUserRedis.SetPlayer(RoomCode, player);

            //加注
            ECoinDetail cd = new ECoinDetail
            {
                Coins      = coins,
                Diff       = diff,
                PileNo     = (int)gi.GameTurn,
                UserOpenId = userOpenId,
                CoinType   = CoinType.Add
            };

            GameDataHandle.AddPlayerCoins(cd);

            //重新获取和设定下一个玩家(必须有下一个玩家,没有则直接结束?)
            var nextUser = GameDataHandle.PeekAvaliblePlayer(gi);

            if (nextUser != null)
            {
                gi.CurBetUserOpenId = nextUser.UserOpenId;
                GameDataHandle.SetGameInfo(gi);
            }

            return(nextUser);
        }
Exemplo n.º 2
0
        public void PlayerFollow(EGameInfo gi, string userOpenId, decimal FollowCoins)
        {
            try
            {
                var player = this.GameDataHandle.PopPlayer(PlayerStauts.Follow);
                player.PlayerStauts = PlayerStauts.Follow;
                RoomUserRedis.SetPlayer(RoomCode, player);

                //加注
                ECoinDetail cd = new ECoinDetail
                {
                    Coins      = FollowCoins,
                    Diff       = 0,
                    PileNo     = (int)gi.GameTurn,
                    UserOpenId = userOpenId,
                    CoinType   = CoinType.Follow,
                };
                GameDataHandle.AddPlayerCoins(cd);
            }
            catch (Exception ex)
            {
                //错误需要将改玩家剔除
            }
        }
Exemplo n.º 3
0
 public void AddPlayerCoins(ECoinDetail coinDetail)
 {
     _OneGame.GameCoins.AddCoins(coinDetail);
 }