Пример #1
0
 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
        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);
        }
Пример #5
0
        public static int GetTotemProp(int id, string typeOf)
        {
            int num = 0;

            for (int ID = 10001; ID <= id; ++ID)
            {
                TotemInfo totemInfo = TotemMgr.FindTotemInfo(ID);
                switch (typeOf)
                {
                case "att":
                    num += totemInfo.AddAttack;
                    break;

                case "agi":
                    num += totemInfo.AddAgility;
                    break;

                case "def":
                    num += totemInfo.AddDefence;
                    break;

                case "luc":
                    num += totemInfo.AddLuck;
                    break;

                case "blo":
                    num += totemInfo.AddBlood;
                    break;

                case "dam":
                    num += totemInfo.AddDamage;
                    break;

                case "gua":
                    num += totemInfo.AddGuard;
                    break;
                }
            }
            return(num);
        }