Exemplo n.º 1
0
 public static bool ReLoad()
 {
     try
     {
         Dictionary <int, ConsortiaLevelInfo> consortiaLevel = new Dictionary <int, ConsortiaLevelInfo>();
         if (ConsortiaLevelMgr.Load(consortiaLevel))
         {
             ConsortiaLevelMgr.m_lock.AcquireWriterLock(15000);
             try
             {
                 ConsortiaLevelMgr._consortiaLevel = consortiaLevel;
                 return(true);
             }
             catch
             {
             }
             finally
             {
                 ConsortiaLevelMgr.m_lock.ReleaseWriterLock();
             }
         }
     }
     catch (Exception exception)
     {
         if (ConsortiaLevelMgr.log.IsErrorEnabled)
         {
             ConsortiaLevelMgr.log.Error("ConsortiaLevelMgr", exception);
         }
     }
     return(false);
 }
Exemplo n.º 2
0
        public static bool ReLoad()
        {
            bool result;

            try
            {
                Dictionary <int, ConsortiaLevelInfo> tempConsortiaLevel = new Dictionary <int, ConsortiaLevelInfo>();
                if (ConsortiaLevelMgr.Load(tempConsortiaLevel))
                {
                    ConsortiaLevelMgr.m_lock.AcquireWriterLock(-1);
                    try
                    {
                        ConsortiaLevelMgr._consortiaLevel = tempConsortiaLevel;
                        result = true;
                        return(result);
                    }
                    catch
                    {
                    }
                    finally
                    {
                        ConsortiaLevelMgr.m_lock.ReleaseWriterLock();
                    }
                }
            }
            catch (Exception e)
            {
                ConsortiaLevelMgr.log.Error("ConsortiaLevelMgr", e);
            }
            result = false;
            return(result);
        }
Exemplo n.º 3
0
        public static bool Init()
        {
            bool result;

            try
            {
                ConsortiaLevelMgr.m_lock          = new ReaderWriterLock();
                ConsortiaLevelMgr._consortiaLevel = new Dictionary <int, ConsortiaLevelInfo>();
                result = ConsortiaLevelMgr.Load(ConsortiaLevelMgr._consortiaLevel);
            }
            catch (Exception e)
            {
                ConsortiaLevelMgr.log.Error("ConsortiaLevelMgr", e);

                result = false;
            }
            return(result);
        }
Exemplo n.º 4
0
        public static bool Init()
        {
            bool result;

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