コード例 #1
0
 public static bool ReLoad()
 {
     try
     {
         Dictionary <int, WindInfo> winds = new Dictionary <int, WindInfo>();
         if (WindMgr.LoadWinds(winds))
         {
             WindMgr.m_lock.AcquireWriterLock(-1);
             try
             {
                 WindMgr._winds = winds;
                 return(true);
             }
             catch
             {
             }
             finally
             {
                 WindMgr.m_lock.ReleaseWriterLock();
             }
         }
     }
     catch (Exception exception)
     {
         if (WindMgr.log.IsErrorEnabled)
         {
             WindMgr.log.Error("WindMgr", exception);
         }
     }
     return(false);
 }
コード例 #2
0
        public static bool Init()
        {
            bool result;

            try
            {
                WindMgr.m_lock = new ReaderWriterLock();
                WindMgr._winds = new Dictionary <int, WindInfo>();
                WindMgr.rand   = new ThreadSafeRandom();
                result         = WindMgr.LoadWinds(WindMgr._winds);
            }
            catch (Exception exception)
            {
                if (WindMgr.log.IsErrorEnabled)
                {
                    WindMgr.log.Error("WindInfoMgr", exception);
                }
                result = false;
            }
            return(result);
        }