Example #1
0
        public TianTiRankData GetRankingData()
        {
            TianTiRankData tianTiRankData;
            ITianTiService kuaFuService = GetKuaFuService();

            if (null != kuaFuService)
            {
                try
                {
                    DateTime modifyTime;
                    lock (Mutex)
                    {
                        modifyTime = RankData.ModifyTime;
                    }

                    tianTiRankData = kuaFuService.GetRankingData(modifyTime);
                    lock (Mutex)
                    {
                        if (tianTiRankData != null && tianTiRankData.ModifyTime > RankData.ModifyTime)
                        {
                            RankData = tianTiRankData;
                        }

                        tianTiRankData                = new TianTiRankData();
                        tianTiRankData.ModifyTime     = RankData.ModifyTime;
                        tianTiRankData.MaxPaiMingRank = RankData.MaxPaiMingRank;
                        if (RankData.TianTiRoleInfoDataList != null && RankData.TianTiRoleInfoDataList.Count > 0)
                        {
                            tianTiRankData.TianTiRoleInfoDataList = new List <TianTiRoleInfoData>(RankData.TianTiRoleInfoDataList);
                        }
                        if (RankData.TianTiMonthRoleInfoDataList != null && RankData.TianTiMonthRoleInfoDataList.Count > 0)
                        {
                            tianTiRankData.TianTiMonthRoleInfoDataList = new List <TianTiRoleInfoData>(RankData.TianTiMonthRoleInfoDataList);
                        }

                        return(tianTiRankData);
                    }
                }
                catch (System.Exception ex)
                {
                    ResetKuaFuService();
                }
            }

            return(null);
        }