コード例 #1
0
ファイル: TotemMgr.cs プロジェクト: thanhtoan1196/GunnyII_r10
 public static bool ReLoad()
 {
     try
     {
         Dictionary <int, TotemInfo> totem = new Dictionary <int, TotemInfo>();
         if (TotemMgr.Load(totem))
         {
             TotemMgr.m_lock.AcquireWriterLock(15000);
             try
             {
                 TotemMgr._totem = totem;
                 return(true);
             }
             catch
             {
             }
             finally
             {
                 TotemMgr.m_lock.ReleaseWriterLock();
             }
         }
     }
     catch (Exception ex)
     {
         if (TotemMgr.log.IsErrorEnabled)
         {
             TotemMgr.log.Error((object)"TotemMgr", ex);
         }
     }
     return(false);
 }
コード例 #2
0
 public static bool ReLoad()
 {
     try
     {
         Dictionary <int, TotemInfo> consortiaLevel = new Dictionary <int, TotemInfo>();
         if (TotemMgr.Load(consortiaLevel))
         {
             TotemMgr.m_lock.AcquireWriterLock(15000);
             try
             {
                 TotemMgr._consortiaLevel = consortiaLevel;
                 return(true);
             }
             catch
             {
             }
             finally
             {
                 TotemMgr.m_lock.ReleaseWriterLock();
             }
         }
     }
     catch (Exception exception)
     {
         if (TotemMgr.log.IsErrorEnabled)
         {
             TotemMgr.log.Error("ConsortiaLevelMgr", exception);
         }
     }
     return(false);
 }
コード例 #3
0
ファイル: TotemMgr.cs プロジェクト: thanhtoan1196/GunnyII_r10
        public static bool Init()
        {
            bool flag;

            try
            {
                TotemMgr.m_lock = new ReaderWriterLock();
                TotemMgr._totem = new Dictionary <int, TotemInfo>();
                TotemMgr.rand   = new ThreadSafeRandom();
                flag            = TotemMgr.Load(TotemMgr._totem);
            }
            catch (Exception ex)
            {
                if (TotemMgr.log.IsErrorEnabled)
                {
                    TotemMgr.log.Error((object)"TotemMgr", ex);
                }
                flag = false;
            }
            return(flag);
        }
コード例 #4
0
        public static bool Init()
        {
            bool result;

            try
            {
                TotemMgr.m_lock          = new ReaderWriterLock();
                TotemMgr._consortiaLevel = new Dictionary <int, TotemInfo>();
                TotemMgr.rand            = new ThreadSafeRandom();
                result = TotemMgr.Load(TotemMgr._consortiaLevel);
            }
            catch (Exception exception)
            {
                if (TotemMgr.log.IsErrorEnabled)
                {
                    TotemMgr.log.Error("ConsortiaLevelMgr", exception);
                }
                result = false;
            }
            return(result);
        }