public static bool Reload()
        {
            bool result;

            try
            {
                AchievementMgr.LoadItemRecordTypeInfoDB();
                Dictionary <int, AchievementInfo> tempAchievementInfo = AchievementMgr.LoadAchievementInfoDB();
                Dictionary <int, List <AchievementConditionInfo> > tempAchievementConditionInfo = AchievementMgr.LoadAchievementConditionInfoDB(tempAchievementInfo);
                Dictionary <int, List <AchievementRewardInfo> >    tempAchievementRewardInfo    = AchievementMgr.LoadAchievementRewardInfoDB(tempAchievementInfo);
                if (tempAchievementInfo.Count > 0)
                {
                    Interlocked.Exchange <Dictionary <int, AchievementInfo> >(ref AchievementMgr.m_achievement, tempAchievementInfo);
                    Interlocked.Exchange <Dictionary <int, List <AchievementConditionInfo> > >(ref AchievementMgr.m_achievementCondition, tempAchievementConditionInfo);
                    Interlocked.Exchange <Dictionary <int, List <AchievementRewardInfo> > >(ref AchievementMgr.m_achievementReward, tempAchievementRewardInfo);
                }
                result = true;
                return(result);
            }
            catch (Exception ex)
            {
                AchievementMgr.log.Error("AchievementMgr", ex);
            }
            result = false;
            return(result);
        }
Exemple #2
0
 public static bool Reload()
 {
     try
     {
         AchievementMgr.LoadItemRecordTypeInfoDB();
         Dictionary <int, AchievementInfo> dictionary              = AchievementMgr.LoadAchievementInfoDB();
         Dictionary <int, List <AchievementConditionInfo> > value  = AchievementMgr.LoadAchievementConditionInfoDB(dictionary);
         Dictionary <int, List <AchievementRewardInfo> >    value2 = AchievementMgr.LoadAchievementRewardInfoDB(dictionary);
         if (dictionary.Count > 0)
         {
             Interlocked.Exchange <Dictionary <int, AchievementInfo> >(ref AchievementMgr.m_achievement, dictionary);
             Interlocked.Exchange <Dictionary <int, List <AchievementConditionInfo> > >(ref AchievementMgr.m_achievementCondition, value);
             Interlocked.Exchange <Dictionary <int, List <AchievementRewardInfo> > >(ref AchievementMgr.m_achievementReward, value2);
         }
         return(true);
     }
     catch (Exception exception)
     {
         AchievementMgr.log.Error("AchievementMgr", exception);
     }
     return(false);
 }
Exemple #3
0
 public static bool Reload()
 {
     try
     {
         AchievementMgr.LoadItemRecordTypeInfoDB();
         Dictionary <int, AchievementInfo> achievementInfos             = AchievementMgr.LoadAchievementInfoDB();
         Dictionary <int, List <AchievementConditionInfo> > dictionary1 = AchievementMgr.LoadAchievementConditionInfoDB(achievementInfos);
         Dictionary <int, List <AchievementRewardInfo> >    dictionary2 = AchievementMgr.LoadAchievementRewardInfoDB(achievementInfos);
         if (achievementInfos.Count > 0)
         {
             Interlocked.Exchange <Dictionary <int, AchievementInfo> >(ref AchievementMgr.m_achievement, achievementInfos);
             Interlocked.Exchange <Dictionary <int, List <AchievementConditionInfo> > >(ref AchievementMgr.m_achievementCondition, dictionary1);
             Interlocked.Exchange <Dictionary <int, List <AchievementRewardInfo> > >(ref AchievementMgr.m_achievementReward, dictionary2);
         }
         return(true);
     }
     catch (Exception ex)
     {
         AchievementMgr.log.Error((object)"AchievementMgr", ex);
     }
     return(false);
 }