Beispiel #1
0
        public static bool ReLoad()
        {
            bool result;

            try
            {
                Dictionary <int, QuestInfo> tempQuestInfo = QuestMgr.LoadQuestInfoDb();
                Dictionary <int, List <QuestConditionInfo> > tempQuestCondiction = QuestMgr.LoadQuestCondictionDb(tempQuestInfo);
                Dictionary <int, List <QuestAwardInfo> >     tempQuestGoods      = QuestMgr.LoadQuestGoodDb(tempQuestInfo);
                if (tempQuestInfo.Count > 0)
                {
                    Interlocked.Exchange <Dictionary <int, QuestInfo> >(ref QuestMgr.m_questinfo, tempQuestInfo);
                    Interlocked.Exchange <Dictionary <int, List <QuestConditionInfo> > >(ref QuestMgr.m_questcondiction, tempQuestCondiction);
                    Interlocked.Exchange <Dictionary <int, List <QuestAwardInfo> > >(ref QuestMgr.m_questgoods, tempQuestGoods);
                }
                result = true;
                return(result);
            }
            catch (Exception e)
            {
                QuestMgr.log.Error("QuestMgr", e);
            }
            result = false;
            return(result);
        }
Beispiel #2
0
 public static bool ReLoad()
 {
     try
     {
         Dictionary <int, QuestInfo> quests = QuestMgr.LoadQuestInfoDb();
         Dictionary <int, List <QuestConditionInfo> > dictionary1 = QuestMgr.LoadQuestCondictionDb(quests);
         Dictionary <int, List <QuestAwardInfo> >     dictionary2 = QuestMgr.LoadQuestGoodDb(quests);
         if (quests.Count > 0)
         {
             Interlocked.Exchange <Dictionary <int, QuestInfo> >(ref QuestMgr.m_questinfo, quests);
             Interlocked.Exchange <Dictionary <int, List <QuestConditionInfo> > >(ref QuestMgr.m_questcondiction, dictionary1);
             Interlocked.Exchange <Dictionary <int, List <QuestAwardInfo> > >(ref QuestMgr.m_questgoods, dictionary2);
         }
         return(true);
     }
     catch (Exception ex)
     {
         QuestMgr.log.Error((object)"QuestMgr", ex);
     }
     return(false);
 }
Beispiel #3
0
 public static bool ReLoad()
 {
     try
     {
         Dictionary <int, QuestInfo> dictionary              = QuestMgr.LoadQuestInfoDb();
         Dictionary <int, List <QuestConditionInfo> > value  = QuestMgr.LoadQuestCondictionDb(dictionary);
         Dictionary <int, List <QuestAwardInfo> >     value2 = QuestMgr.LoadQuestGoodDb(dictionary);
         if (dictionary.Count > 0)
         {
             Interlocked.Exchange <Dictionary <int, QuestInfo> >(ref QuestMgr.m_questinfo, dictionary);
             Interlocked.Exchange <Dictionary <int, List <QuestConditionInfo> > >(ref QuestMgr.m_questcondiction, value);
             Interlocked.Exchange <Dictionary <int, List <QuestAwardInfo> > >(ref QuestMgr.m_questgoods, value2);
         }
         return(true);
     }
     catch (Exception exception)
     {
         QuestMgr.log.Error("QuestMgr", exception);
     }
     return(false);
 }