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()); } } }
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)); }
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); } } } }