Example #1
0
 public static bool ReLoad()
 {
     try
     {
         Dictionary <int, TreasureAwardInfo> treasureAward = new Dictionary <int, TreasureAwardInfo>();
         if (TreasureAwardMgr.Load(treasureAward))
         {
             TreasureAwardMgr.m_lock.AcquireWriterLock(15000);
             try
             {
                 TreasureAwardMgr._treasureAward = treasureAward;
                 return(true);
             }
             catch
             {
             }
             finally
             {
                 TreasureAwardMgr.m_lock.ReleaseWriterLock();
             }
         }
     }
     catch (Exception ex)
     {
         if (TreasureAwardMgr.log.IsErrorEnabled)
         {
             TreasureAwardMgr.log.Error((object)"TreasureAwardMgr", ex);
         }
     }
     return(false);
 }
Example #2
0
        public static bool Init()
        {
            bool flag;

            try
            {
                TreasureAwardMgr.m_lock         = new ReaderWriterLock();
                TreasureAwardMgr._treasureAward = new Dictionary <int, TreasureAwardInfo>();
                TreasureAwardMgr.rand           = new ThreadSafeRandom();
                flag = TreasureAwardMgr.Load(TreasureAwardMgr._treasureAward);
            }
            catch (Exception ex)
            {
                if (TreasureAwardMgr.log.IsErrorEnabled)
                {
                    TreasureAwardMgr.log.Error((object)"TreasureAwardMgr", ex);
                }
                flag = false;
            }
            return(flag);
        }