Пример #1
0
        /// <summary>
        /// 玩家上线初始化时获取玩家翅膀数据
        /// </summary>
        /// <param name="roleId"></param>
        /// <returns></returns>
        public void onPlayerLogin(int roleId, string strRoleName)
        {
            WingRankingInfo data = null;

            lock (playerWingDatas)
            {
                if (playerWingDatas.TryGetValue(roleId, out data))
                {
                    return;
                }
            }

            if (null == data)
            {
                data = WingPaiHangDBController.getInstance().getWingDataById(roleId);
                if (null != data)
                {
                    // 添加更新翅膀排行榜数据
                    ModifyWingPaihangData(data, true);

                    lock (playerWingDatas)
                    {
                        playerWingDatas.Add(data.nRoleID, data);
                    }
                }
            }
        }
Пример #2
0
        internal void OnChangeName(int roleid, string oldName, string newName)
        {
            WingRankingInfo info = this.getWingData(roleid);

            if (info != null)
            {
                info.strRoleName = newName;
            }
            WingPaiHangDBController.getInstance().OnChangeName(roleid, oldName, newName);
        }
Пример #3
0
        private void initData()
        {
            List <WingRankingInfo> playerWingDataList = WingPaiHangDBController.getInstance().getPlayerWingDataList();

            if (null != playerWingDataList)
            {
                foreach (WingRankingInfo data in playerWingDataList)
                {
                    this.playerWingDatas.Add(data.nRoleID, data);
                    this.rankingDatas.Add(data.getPlayerWingRankingData());
                }
            }
        }
Пример #4
0
        public WingRankingInfo getWingData(int nRoleID)
        {
            WingRankingInfo data = null;

            lock (this.playerWingDatas)
            {
                if (this.playerWingDatas.TryGetValue(nRoleID, out data))
                {
                    return(data);
                }
            }
            return(WingPaiHangDBController.getInstance().getWingDataById(nRoleID));
        }
Пример #5
0
        /// <summary>
        /// 初始化数据
        /// </summary>
        private void initData()
        {
            // 初始化翅膀数据,排行榜数据
            List <WingRankingInfo> playerWingDataList = WingPaiHangDBController.getInstance().getPlayerWingDataList();

            if (null == playerWingDataList)
            {
                return;
            }

            foreach (WingRankingInfo data in playerWingDataList)
            {
                playerWingDatas.Add(data.nRoleID, data);
                rankingDatas.Add(data.getPlayerWingRankingData());
            }
        }
Пример #6
0
        /// <summary>
        /// 创建翅膀数据
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public WingRankingInfo getWingData(int nRoleID)
        {
            WingRankingInfo data = null;

            lock (playerWingDatas)
            {
                if (playerWingDatas.TryGetValue(nRoleID, out data))
                {
                    return(data);
                }
            }

            // 没有找到的话直接返回空
            // 因为在登录时有处理,这里不找重复处理
            return(WingPaiHangDBController.getInstance().getWingDataById(nRoleID));
        }