Example #1
0
        private void initData()
        {
            List <MerlinRankingInfo> playerMerlinDataList = MerlinRankDBController.getInstance().getPlayerMerlinDataList();

            if (null != playerMerlinDataList)
            {
                foreach (MerlinRankingInfo data in playerMerlinDataList)
                {
                    this.playerMerlinDatas.Add(data.nRoleID, data);
                    this.rankingDatas.Add(data.getPlayerMerlinRankingData());
                }
            }
        }
Example #2
0
        public MerlinRankingInfo getMerlinData(int nRoleID)
        {
            MerlinRankingInfo data = null;

            lock (this.playerMerlinDatas)
            {
                if (this.playerMerlinDatas.TryGetValue(nRoleID, out data))
                {
                    return(data);
                }
            }
            return(MerlinRankDBController.getInstance().getMerlinDataByRoleID(nRoleID));
        }
Example #3
0
        public void onPlayerLogin(int roleId, string strRoleName)
        {
            MerlinRankingInfo data = null;

            lock (this.playerMerlinDatas)
            {
                if (this.playerMerlinDatas.TryGetValue(roleId, out data))
                {
                    return;
                }
            }
            if (null == data)
            {
                data = MerlinRankDBController.getInstance().getMerlinDataByRoleID(roleId);
                if (null != data)
                {
                    this.ModifyMerlinRankData(data, true);
                    lock (this.playerMerlinDatas)
                    {
                        this.playerMerlinDatas.Add(data.nRoleID, data);
                    }
                }
            }
        }