Beispiel #1
0
 public void InitConfig()
 {
     if (!this._Config.Load(KuaFuServerManager.GetResourcePath("Config\\Match.xml", KuaFuServerManager.ResourcePathTypes.GameRes), KuaFuServerManager.GetResourcePath("Config\\Sustain.xml", KuaFuServerManager.ResourcePathTypes.GameRes), KuaFuServerManager.GetResourcePath("Config\\MatchBirthPoint.xml", KuaFuServerManager.ResourcePathTypes.GameRes)))
     {
         LogManager.WriteLog(LogTypes.Error, "ZhengBaManagerK.InitConfig failed!", null, true);
     }
 }
Beispiel #2
0
        private void InitLangHunLingYuConfig()
        {
            string fileName = "";

            lock (this.Mutex)
            {
                try
                {
                    Dictionary <int, CityLevelInfo> cityLevelInfoDict = new Dictionary <int, CityLevelInfo>();
                    fileName = "Config/MU_City.xml";
                    string   fullPathFileName = KuaFuServerManager.GetResourcePath(fileName, KuaFuServerManager.ResourcePathTypes.GameRes);
                    XElement xml = ConfigHelper.Load(fullPathFileName);
                    IEnumerable <XElement> nodes = xml.Elements();
                    foreach (XElement t in nodes)
                    {
                        string type = ConfigHelper.GetElementAttributeValue(t, "TypeID", "");
                        if (string.Compare(type, KuaFuServerManager.platformType.ToString(), true) == 0)
                        {
                            foreach (XElement node in t.Elements())
                            {
                                CityLevelInfo item = new CityLevelInfo();
                                item.ID        = (int)ConfigHelper.GetElementAttributeValueLong(node, "ID", 0L);
                                item.CityLevel = (int)ConfigHelper.GetElementAttributeValueLong(node, "CityLevel", 0L);
                                item.CityNum   = (int)ConfigHelper.GetElementAttributeValueLong(node, "CityNum", 0L);
                                item.MaxNum    = (int)ConfigHelper.GetElementAttributeValueLong(node, "MaxNum", 0L);
                                string strAttackWeekDay = ConfigHelper.GetElementAttributeValue(node, "AttackWeekDay", "");
                                item.AttackWeekDay = ConfigHelper.String2IntArray(strAttackWeekDay, ',');
                                if (!ConfigHelper.ParserTimeRangeListWithDay(item.BaoMingTime, ConfigHelper.GetElementAttributeValue(node, "BaoMingTime", "").Replace(';', '|'), true, '|', '-', ','))
                                {
                                    LogManager.WriteLog(LogTypes.Fatal, string.Format("解析文件{0}的BaoMingTime出错", fileName), null, true);
                                    KuaFuServerManager.LoadConfigSuccess = false;
                                }
                                if (!ConfigHelper.ParserTimeRangeList(item.AttackTime, ConfigHelper.GetElementAttributeValue(node, "AttackTime", ""), true, '|', '-'))
                                {
                                    LogManager.WriteLog(LogTypes.Fatal, string.Format("解析文件{0}的BaoMingTime出错", fileName), null, true);
                                    KuaFuServerManager.LoadConfigSuccess = false;
                                }
                                cityLevelInfoDict[item.CityLevel] = item;
                            }
                            break;
                        }
                    }
                    this.CityLevelInfoDict = cityLevelInfoDict;
                    if (this.CityLevelInfoDict.Count == 0)
                    {
                        LogManager.WriteLog(LogTypes.Fatal, string.Format("读取配置{0}失败,读取到的城池配置数为0", new object[0]), null, true);
                        KuaFuServerManager.LoadConfigSuccess = false;
                    }
                }
                catch (Exception ex)
                {
                    LogManager.WriteLog(LogTypes.Fatal, string.Format("加载xml配置文件:{0}, 失败。{1}", fileName, ex.ToString()), null, true);
                    KuaFuServerManager.LoadConfigSuccess = false;
                }
            }
        }
        private void InitLangHunLingYuConfig()
        {
            string fileName         = "";
            string fullPathFileName = "";
            IEnumerable <XElement> nodes;

            lock (Mutex)
            {
                try
                {
                    Dictionary <int, CityLevelInfo> cityLevelInfoDict = new Dictionary <int, CityLevelInfo>();

                    fileName         = "Config/MU_City.xml";
                    fullPathFileName = KuaFuServerManager.GetResourcePath(fileName, KuaFuServerManager.ResourcePathTypes.GameRes);
                    XElement xml = ConfigHelper.Load(fullPathFileName);

                    nodes = xml.Elements();
                    int cityId = 0;
                    foreach (var t in nodes)
                    {
                        string type = ConfigHelper.GetElementAttributeValue(t, "TypeID");
                        if (string.Compare(type, KuaFuServerManager.platformType.ToString(), true) == 0)
                        {
                            foreach (var node in t.Elements())
                            {
                                CityLevelInfo item = new CityLevelInfo();
                                item.ID        = (int)ConfigHelper.GetElementAttributeValueLong(node, "ID");
                                item.CityLevel = (int)ConfigHelper.GetElementAttributeValueLong(node, "CityLevel");
                                item.CityNum   = (int)ConfigHelper.GetElementAttributeValueLong(node, "CityNum");
                                item.MaxNum    = (int)ConfigHelper.GetElementAttributeValueLong(node, "MaxNum");

                                string strAttackWeekDay = ConfigHelper.GetElementAttributeValue(node, "AttackWeekDay");
                                item.AttackWeekDay = ConfigHelper.String2IntArray(strAttackWeekDay);

                                cityLevelInfoDict[item.CityLevel] = item;
                            }

                            break;
                        }
                    }

                    CityLevelInfoDict = cityLevelInfoDict;
                    if (CityLevelInfoDict.Count == 0)
                    {
                        LogManager.WriteLog(LogTypes.Fatal, string.Format("读取配置{0}失败,读取到的城池配置数为0"));
                        KuaFuServerManager.LoadConfigSuccess = false;
                    }
                }
                catch (Exception ex)
                {
                    LogManager.WriteLog(LogTypes.Fatal, string.Format("加载xml配置文件:{0}, 失败。{1}", fileName, ex.ToString()));
                    KuaFuServerManager.LoadConfigSuccess = false;
                }
            }
        }
Beispiel #4
0
		public void InitConfig()
		{
			if (!this._config.Load(KuaFuServerManager.GetResourcePath("Config\\PlunderLands.xml", KuaFuServerManager.ResourcePathTypes.GameRes), KuaFuServerManager.GetResourcePath("Config\\PlunderLandsMonster.xml", KuaFuServerManager.ResourcePathTypes.GameRes), KuaFuServerManager.GetResourcePath("Config\\PlunderLandsRebirth.xml", KuaFuServerManager.ResourcePathTypes.GameRes)))
			{
				LogManager.WriteLog(LogTypes.Error, string.Format("加载[{0}]时出错!!!", "争夺之地"), null, true);
			}
			else
			{
				this.LoadDBConfig();
			}
		}
Beispiel #5
0
 public void InitConfig()
 {
     try
     {
         lock (this.Mutex)
         {
             string fileName         = "Config/RebornBoss.xml";
             string fullPathFileName = KuaFuServerManager.GetResourcePath(fileName, KuaFuServerManager.ResourcePathTypes.GameRes);
             this.RebornBossConfigDict.Clear();
             XElement xml = ConfigHelper.Load(fullPathFileName);
             IEnumerable <XElement> xmlItems = xml.Elements();
             foreach (XElement xmlItem in xmlItems)
             {
                 int MapCodeID = (int)ConfigHelper.GetElementAttributeValueLong(xmlItem, "MapID", 0L);
                 List <RebornBossConfig> bossList;
                 if (!this.RebornBossConfigDict.TryGetValue(MapCodeID, out bossList))
                 {
                     bossList = new List <RebornBossConfig>();
                     this.RebornBossConfigDict[MapCodeID] = bossList;
                 }
                 RebornBossConfig myData = new RebornBossConfig();
                 myData.ID         = (int)ConfigHelper.GetElementAttributeValueLong(xmlItem, "ID", 0L);
                 myData.MapID      = (int)ConfigHelper.GetElementAttributeValueLong(xmlItem, "MapID", 0L);
                 myData.MonstersID = (int)ConfigHelper.GetElementAttributeValueLong(xmlItem, "MonstersID", 0L);
                 bossList.Add(myData);
             }
             foreach (List <RebornBossConfig> value in this.RebornBossConfigDict.Values)
             {
                 value.Sort(delegate(RebornBossConfig left, RebornBossConfig right)
                 {
                     int result;
                     if (left.ID < right.ID)
                     {
                         result = -1;
                     }
                     else if (left.ID > right.ID)
                     {
                         result = 1;
                     }
                     else
                     {
                         result = 0;
                     }
                     return(result);
                 });
             }
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteExceptionUseCache(ex.ToString());
     }
 }
 public void StartUp()
 {
     try
     {
         this._Config.Load(KuaFuServerManager.GetResourcePath(CoupleWishConsts.RankAwardCfgFile, KuaFuServerManager.ResourcePathTypes.GameRes), KuaFuServerManager.GetResourcePath(CoupleWishConsts.WishTypeCfgFile, KuaFuServerManager.ResourcePathTypes.GameRes), KuaFuServerManager.GetResourcePath(CoupleWishConsts.YanHuiCfgFile, KuaFuServerManager.ResourcePathTypes.GameRes));
         this.ReloadSyncData();
         this.WishRecordMgr = new CoupleWishRecordManager(this.SyncData.ThisWeek.Week);
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Error, "CoupleWishService.StartUp failed!", ex, true);
     }
 }
Beispiel #7
0
        public void InitConfig()
        {
            bool bOk = _Config.Load(
                KuaFuServerManager.GetResourcePath(ZhengBaConsts.MatchConfigFile, KuaFuServerManager.ResourcePathTypes.GameRes),
                KuaFuServerManager.GetResourcePath(ZhengBaConsts.SupportConfigFile, KuaFuServerManager.ResourcePathTypes.GameRes),
                KuaFuServerManager.GetResourcePath(ZhengBaConsts.BirthPointConfigFile, KuaFuServerManager.ResourcePathTypes.GameRes)
                );

            if (!bOk)
            {
                LogManager.WriteLog(LogTypes.Error, "ZhengBaManagerK.InitConfig failed!");
            }
        }
Beispiel #8
0
 public void InitConfig()
 {
     try
     {
         lock (this.Mutex)
         {
             string fileName         = "Config/TeQuanTiaoJian.xml";
             string fullPathFileName = KuaFuServerManager.GetResourcePath(fileName, KuaFuServerManager.ResourcePathTypes.GameRes);
             this.SpecPConditionList.Clear();
             XElement xml = ConfigHelper.Load(fullPathFileName);
             IEnumerable <XElement> xmlItems = xml.Elements();
             foreach (XElement xmlItem in xmlItems)
             {
                 SpecPConditionConfig myData = new SpecPConditionConfig();
                 myData.GroupID = (int)ConfigHelper.GetElementAttributeValueLong(xmlItem, "ID", 0L);
                 string FromDate = ConfigHelper.GetElementAttributeValue(xmlItem, "KaiQiShiJian", "");
                 if (!string.IsNullOrEmpty(FromDate))
                 {
                     myData.FromDate = DateTime.Parse(FromDate);
                 }
                 else
                 {
                     myData.FromDate = DateTime.Parse("2008-08-08 08:08:08");
                 }
                 string ToDate = ConfigHelper.GetElementAttributeValue(xmlItem, "JieShuShiJian", "");
                 if (!string.IsNullOrEmpty(ToDate))
                 {
                     myData.ToDate = DateTime.Parse(ToDate);
                 }
                 else
                 {
                     myData.ToDate = DateTime.Parse("2028-08-08 08:08:08");
                 }
                 myData.ConditionType = (SpecPConditionType)ConfigHelper.GetElementAttributeValueLong(xmlItem, "TiaoJianLeiXing", 0L);
                 this.SpecPConditionList.Add(myData);
             }
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteExceptionUseCache(ex.ToString());
     }
 }
Beispiel #9
0
        public void StartUp()
        {
            try
            {
                XElement xml  = null;
                string   file = "";

                file = @"Config\CoupleWar.xml";
                xml  = XElement.Load(KuaFuServerManager.GetResourcePath(file, KuaFuServerManager.ResourcePathTypes.GameRes));
                foreach (var xmlItem in xml.Elements())
                {
                    string[] fields = xmlItem.Attribute("TimePoints").Value.Split(new char[] { ',', '-', '|' });
                    for (int i = 0; i < fields.Length; i += 3)
                    {
                        var tp = new _CoupleArenaWarTimePoint();
                        tp.Weekday = Convert.ToInt32(fields[i]);
                        if (tp.Weekday < 1 || tp.Weekday > 7)
                        {
                            throw new Exception("weekday error!");
                        }
                        tp.DayStartTicks = DateTime.Parse(fields[i + 1]).TimeOfDay.Ticks;
                        tp.DayEndTicks   = DateTime.Parse(fields[i + 2]).TimeOfDay.Ticks;

                        _WarTimePointList.Add(tp);
                    }

                    _WarTimePointList.Sort((_l, _r) => { return(_l.Weekday - _r.Weekday); });

                    break;
                }

                file = @"Config\CoupleDuanWei.xml";
                xml  = XElement.Load(KuaFuServerManager.GetResourcePath(file, KuaFuServerManager.ResourcePathTypes.GameRes));
                foreach (var xmlItem in xml.Elements())
                {
                    var cfg = new _CoupleArenaDuanWeiCfg();
                    cfg.NeedJiFen    = Convert.ToInt32(xmlItem.Attribute("NeedCoupleDuanWeiJiFen").Value.ToString());
                    cfg.DuanWeiType  = Convert.ToInt32(xmlItem.Attribute("Type").Value.ToString());
                    cfg.DuanWeiLevel = Convert.ToInt32(xmlItem.Attribute("Level").Value.ToString());
                    cfg.WinJiFen     = Convert.ToInt32(xmlItem.Attribute("WinJiFen").Value.ToString());
                    cfg.LoseJiFen    = Convert.ToInt32(xmlItem.Attribute("LoseJiFen").Value.ToString());

                    _DuanWeiCfgList.Add(cfg);
                }
                _DuanWeiCfgList.Sort((_l, _r) => { return(_l.NeedJiFen - _r.NeedJiFen); });

                DateTime now = TimeUtil.NowDateTime();
                Persistence.CheckClearRank(CurrRankWeek(now));
                SyncData.RankList = Persistence.LoadRankFromDb();
                SyncData.BuildRoleDict();
                SyncData.ModifyTime = now;

                this.IsNeedSort = false;
                for (int i = 1; i < SyncData.RankList.Count && !this.IsNeedSort; i++)
                {
                    this.IsNeedSort |= SyncData.RankList[i].CompareTo(SyncData.RankList[i - 1]) < 0;
                    this.IsNeedSort |= this.SyncData.RankList[i].Rank != this.SyncData.RankList[i - 1].Rank + 1;
                }

                CheckRebuildRank(now);
                CheckFlushRank2Db();
            }
            catch (Exception ex)
            {
                LogManager.WriteLog(LogTypes.Error, "CoupleArenaService.InitConfig failed!", ex);
            }
        }
Beispiel #10
0
 public void InitConfig()
 {
     try
     {
         lock (this.RuntimeData.Mutex)
         {
             string fileName         = "Config/EraUI.xml";
             string fullPathFileName = KuaFuServerManager.GetResourcePath(fileName, KuaFuServerManager.ResourcePathTypes.GameRes);
             this.RuntimeData.EraUIConfigDict.Load(fullPathFileName, null);
             fileName         = "Config/EraTask.xml";
             fullPathFileName = KuaFuServerManager.GetResourcePath(fileName, KuaFuServerManager.ResourcePathTypes.GameRes);
             this.RuntimeData.EraTaskConfigDict.Clear();
             XElement xml = ConfigHelper.Load(fullPathFileName);
             IEnumerable <XElement> xmlItems = xml.Elements();
             foreach (XElement xmlItem in xmlItems)
             {
                 EraTaskConfig data = new EraTaskConfig();
                 data.ID       = (int)ConfigHelper.GetElementAttributeValueLong(xmlItem, "ID", 0L);
                 data.EraID    = (int)ConfigHelper.GetElementAttributeValueLong(xmlItem, "EraID", 0L);
                 data.EraStage = (int)ConfigHelper.GetElementAttributeValueLong(xmlItem, "EraStage", 0L);
                 data.Reward   = (int)ConfigHelper.GetElementAttributeValueLong(xmlItem, "Reward", 0L);
                 string   tempValue  = ConfigHelper.GetElementAttributeValue(xmlItem, "CompletionCondition", "");
                 string[] tempFields = tempValue.Split(new char[]
                 {
                     '|'
                 });
                 foreach (string item in tempFields)
                 {
                     string[] strkvp = item.Split(new char[]
                     {
                         ','
                     });
                     if (strkvp.Length == 2)
                     {
                         int goodsid = Convert.ToInt32(strkvp[0]);
                         int num     = Convert.ToInt32(strkvp[1]);
                         data.CompletionCondition.Add(new KeyValuePair <int, int>(goodsid, num));
                     }
                 }
                 this.RuntimeData.EraTaskConfigDict[data.ID] = data;
             }
             fileName         = "Config/EraReward.xml";
             fullPathFileName = KuaFuServerManager.GetResourcePath(fileName, KuaFuServerManager.ResourcePathTypes.GameRes);
             this.RuntimeData.EraAwardConfigDict.Clear();
             xml      = ConfigHelper.Load(fullPathFileName);
             xmlItems = xml.Elements();
             foreach (XElement xmlItem in xmlItems)
             {
                 EraAwardConfigBase data2 = new EraAwardConfigBase();
                 data2.ID        = (int)ConfigHelper.GetElementAttributeValueLong(xmlItem, "ID", 0L);
                 data2.EraID     = (int)ConfigHelper.GetElementAttributeValueLong(xmlItem, "EraID", 0L);
                 data2.AwardType = (int)ConfigHelper.GetElementAttributeValueLong(xmlItem, "Type", 0L);
                 string StartTime = ConfigHelper.GetElementAttributeValue(xmlItem, "StartTime", "");
                 if (!string.IsNullOrEmpty(StartTime))
                 {
                     DateTime.TryParse(StartTime, out data2.StartTime);
                 }
                 string EndTime = ConfigHelper.GetElementAttributeValue(xmlItem, "EndTime", "");
                 if (!string.IsNullOrEmpty(EndTime))
                 {
                     DateTime.TryParse(EndTime, out data2.EndTime);
                 }
                 this.RuntimeData.EraAwardConfigDict[data2.ID] = data2;
             }
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteExceptionUseCache(ex.ToString());
     }
 }
Beispiel #11
0
 public bool LoadConfig()
 {
     try
     {
         this.Initialiazed = false;
         XElement xml = ConfigHelper.Load(KuaFuServerManager.GetResourcePath("Config/JieRiGifts/JieRiChongZhiHongBao.xml", KuaFuServerManager.ResourcePathTypes.GameRes));
         if (null == xml)
         {
             return(false);
         }
         lock (this.Mutex)
         {
             this.ConfigDict.Clear();
             XElement args = xml.Element("Activities");
             if (null != args)
             {
                 this.FromDate       = ConfigHelper.GetElementAttributeValue(args, "FromDate", "");
                 this.ToDate         = ConfigHelper.GetElementAttributeValue(args, "ToDate", "");
                 this.ActivityType   = (int)ConfigHelper.GetElementAttributeValueLong(args, "ActivityType", 0L);
                 this.AwardStartDate = ConfigHelper.GetElementAttributeValue(args, "AwardStartDate", "");
                 this.AwardEndDate   = ConfigHelper.GetElementAttributeValue(args, "AwardEndDate", "");
                 this.StartTime      = DateTime.Parse(this.FromDate);
                 this.EndTime        = DateTime.Parse(this.ToDate);
                 this.ActivityKeyStr = string.Format("{0}_{1}", this.FromDate, this.ToDate).Replace(':', '$');
             }
             else
             {
                 this.ActivityKeyStr = "";
                 this.StartTime      = (this.EndTime = DateTime.MinValue);
             }
             this.HuoDongStartTicks = this.StartTime.Ticks / 10000000L * 1000L;
             args = xml.Element("GiftList");
             if (null != args)
             {
                 IEnumerable <XElement> xmlItems = args.Elements();
                 foreach (XElement xmlItem in xmlItems)
                 {
                     if (null != xmlItem)
                     {
                         JieRiChongZhiHongBaoInfo item = new JieRiChongZhiHongBaoInfo();
                         item.ID = (int)ConfigHelper.GetElementAttributeValueLong(xmlItem, "ID", 0L);
                         item.RechargeDifference = (int)ConfigHelper.GetElementAttributeValueLong(xmlItem, "RechargeDifference", 0L);
                         item.PlatformID         = ConfigHelper.GetElementAttributeValue(xmlItem, "PlatformID", "");
                         item.RedPacketSize      = (int)ConfigHelper.GetElementAttributeValueLong(xmlItem, "RedPacketSize", 0L);
                         item.Interval           = ConfigHelper.String2IntArray(ConfigHelper.GetElementAttributeValue(xmlItem, "Interval", ""), ',');
                         item.DurationTime       = (int)ConfigHelper.GetElementAttributeValueLong(xmlItem, "DurationTime", 0L);
                         if (string.Compare(item.PlatformID, KuaFuServerManager.platformType.ToString(), true) == 0)
                         {
                             this.ConfigDict.Add(item.ID, item);
                         }
                     }
                 }
             }
         }
         this.Initialiazed = this.InitData();
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Fatal, string.Format("{0}解析出现异常, {1}", "Config/JieRiGifts/JieRiChongZhiHongBao.xml", ex.Message), null, true);
         return(false);
     }
     return(true);
 }
Beispiel #12
0
 public void StartUp()
 {
     try
     {
         int  num;
         bool flag;
         IEnumerator <XElement> objA = XElement.Load(KuaFuServerManager.GetResourcePath(@"Config\CoupleWar.xml", KuaFuServerManager.ResourcePathTypes.GameRes)).Elements().GetEnumerator();
         try
         {
             flag = objA.MoveNext();
             if (flag)
             {
                 string[] strArray = objA.Current.Attribute("TimePoints").Value.Split(new char[] { ',', '-', '|' });
                 num = 0;
                 while (true)
                 {
                     flag = num < strArray.Length;
                     if (!flag)
                     {
                         this._WarTimePointList.Sort((_l, _r) => _l.Weekday - _r.Weekday);
                         break;
                     }
                     _CoupleArenaWarTimePoint item = new _CoupleArenaWarTimePoint
                     {
                         Weekday = Convert.ToInt32(strArray[num])
                     };
                     if ((item.Weekday < 1) || (item.Weekday > 7))
                     {
                         throw new Exception("weekday error!");
                     }
                     item.DayStartTicks = DateTime.Parse(strArray[num + 1]).TimeOfDay.Ticks;
                     item.DayEndTicks   = DateTime.Parse(strArray[num + 2]).TimeOfDay.Ticks;
                     this._WarTimePointList.Add(item);
                     num += 3;
                 }
             }
         }
         finally
         {
             if (!ReferenceEquals(objA, null))
             {
                 objA.Dispose();
             }
         }
         objA = XElement.Load(KuaFuServerManager.GetResourcePath(@"Config\CoupleDuanWei.xml", KuaFuServerManager.ResourcePathTypes.GameRes)).Elements().GetEnumerator();
         try
         {
             while (true)
             {
                 flag = objA.MoveNext();
                 if (!flag)
                 {
                     break;
                 }
                 XElement current            = objA.Current;
                 _CoupleArenaDuanWeiCfg item = new _CoupleArenaDuanWeiCfg
                 {
                     NeedJiFen    = Convert.ToInt32(current.Attribute("NeedCoupleDuanWeiJiFen").Value.ToString()),
                     DuanWeiType  = Convert.ToInt32(current.Attribute("Type").Value.ToString()),
                     DuanWeiLevel = Convert.ToInt32(current.Attribute("Level").Value.ToString()),
                     WinJiFen     = Convert.ToInt32(current.Attribute("WinJiFen").Value.ToString()),
                     LoseJiFen    = Convert.ToInt32(current.Attribute("LoseJiFen").Value.ToString())
                 };
                 this._DuanWeiCfgList.Add(item);
             }
         }
         finally
         {
             if (!ReferenceEquals(objA, null))
             {
                 objA.Dispose();
             }
         }
         this._DuanWeiCfgList.Sort((_l, _r) => _l.NeedJiFen - _r.NeedJiFen);
         DateTime time = TimeUtil.NowDateTime();
         this.Persistence.CheckClearRank(this.CurrRankWeek(time));
         this.SyncData.RankList = this.Persistence.LoadRankFromDb();
         this.SyncData.BuildRoleDict();
         this.SyncData.ModifyTime = time;
         this.IsNeedSort          = false;
         num = 1;
         while (true)
         {
             flag = (num < this.SyncData.RankList.Count) && !this.IsNeedSort;
             if (!flag)
             {
                 this.CheckRebuildRank(time);
                 this.CheckFlushRank2Db();
                 break;
             }
             this.IsNeedSort |= this.SyncData.RankList[num].CompareTo(this.SyncData.RankList[num - 1]) < 0;
             this.IsNeedSort |= this.SyncData.RankList[num].Rank != (this.SyncData.RankList[num - 1].Rank + 1);
             num++;
         }
     }
     catch (Exception exception)
     {
         LogManager.WriteLog(LogTypes.Error, "CoupleArenaService.InitConfig failed!", exception, true);
     }
 }