コード例 #1
0
        public static bool Reload()
        {
            bool result;

            try
            {
                Dictionary <int, ItemTemplateInfo> tempProp = new Dictionary <int, ItemTemplateInfo>();
                if (PropItemMgr.LoadProps(tempProp))
                {
                    PropItemMgr.m_lock.AcquireWriterLock(-1);
                    try
                    {
                        PropItemMgr._allProp = tempProp;
                        result = true;
                        return(result);
                    }
                    catch
                    {
                    }
                    finally
                    {
                        PropItemMgr.m_lock.ReleaseWriterLock();
                    }
                }
            }
            catch (Exception e)
            {
                //if (PropItemMgr.log.IsErrorEnabled)
                {
                    PropItemMgr.log.Error("ReloadProps", e);
                }
            }
            result = false;
            return(result);
        }
コード例 #2
0
 public static bool Reload()
 {
     try
     {
         Dictionary <int, ItemTemplateInfo> allProp = new Dictionary <int, ItemTemplateInfo>();
         if (PropItemMgr.LoadProps(allProp))
         {
             PropItemMgr.m_lock.AcquireWriterLock(15000);
             try
             {
                 PropItemMgr._allProp = allProp;
                 return(true);
             }
             catch
             {
             }
             finally
             {
                 PropItemMgr.m_lock.ReleaseWriterLock();
             }
         }
     }
     catch (Exception exception)
     {
         if (PropItemMgr.log.IsErrorEnabled)
         {
             PropItemMgr.log.Error("ReloadProps", exception);
         }
     }
     return(false);
 }
コード例 #3
0
        public static bool Init()
        {
            bool result;

            try
            {
                PropItemMgr.m_lock   = new ReaderWriterLock();
                PropItemMgr._allProp = new Dictionary <int, ItemTemplateInfo>();
                result = PropItemMgr.LoadProps(PropItemMgr._allProp);
            }
            catch (Exception e)
            {
                //if (PropItemMgr.log.IsErrorEnabled)
                {
                    PropItemMgr.log.Error("InitProps", e);
                }
                result = false;
            }
            return(result);
        }