Esempio n. 1
0
 public void FreshDatas(NbjlOnLinePlayerData data)
 {
     AccumulateBet = data.AccumulateBet;
     AccumulateWin = data.AccumulateWin;
     WinCount      = data.WinCount;
     Seat          = data.Seat;
     CoinA         = data.TotalGold;
     NickM         = data.UserName;
 }
Esempio n. 2
0
        /// <summary>
        /// 在线玩家列表信息(玩家信息同步)
        /// </summary>
        /// <param name="data"></param>
        /// <param name="freshRound"></param>
        public void GetOnLinePlayerList(ISFSObject data, bool freshRound)
        {
            var list = data.GetSFSArray(ConstantData.KeyPlayerList);

            if (list != null)
            {
                var count       = list.Count;
                var onLineDatas = new List <NbjlOnLinePlayerData>();
                for (int i = 0; i < count; i++)
                {
                    var item = list.GetSFSObject(i);
                    var info = new NbjlOnLinePlayerData();
                    info.Parse(item);
                    onLineDatas.Add(info);
                }
                if (onLineDatas.Count >= 0)
                {
                    foreach (var player in Players)
                    {
                        if (player != null)
                        {
                            var id = player.Id;
                            NbjlOnLinePlayerData infodata = onLineDatas.Find(item => item.UserId == id);
                            if (infodata != null)
                            {
                                player.FreshDatas(infodata);
                            }
                        }
                    }
                    if (freshRound)
                    {
                        foreach (var player in RoundPlayers)
                        {
                            if (player != null)
                            {
                                var id = player.Id;
                                NbjlOnLinePlayerData infodata = onLineDatas.Find(item => item.UserId == id);
                                if (infodata != null)
                                {
                                    player.FreshDatas(infodata);
                                }
                            }
                        }
                    }
                }
            }
        }