示例#1
0
 public static bool ReLoad()
 {
     try
     {
         ItemBoxInfo[] array = ItemBoxMgr.LoadItemBoxDb();
         Dictionary <int, List <ItemBoxInfo> > value = ItemBoxMgr.LoadItemBoxs(array);
         if (array != null)
         {
             Interlocked.Exchange <ItemBoxInfo[]>(ref ItemBoxMgr.m_itemBox, array);
             Interlocked.Exchange <Dictionary <int, List <ItemBoxInfo> > >(ref ItemBoxMgr.m_itemBoxs, value);
         }
     }
     catch (Exception exception)
     {
         if (ItemBoxMgr.log.IsErrorEnabled)
         {
             ItemBoxMgr.log.Error("ReLoad", exception);
         }
         return(false);
     }
     return(true);
 }
示例#2
0
 public static bool ReLoad()
 {
     try
     {
         ItemBoxInfo[] itemBoxs = ItemBoxMgr.LoadItemBoxDb();
         Dictionary <int, List <ItemBoxInfo> > dictionary = ItemBoxMgr.LoadItemBoxs(itemBoxs);
         if (itemBoxs != null)
         {
             Interlocked.Exchange <ItemBoxInfo[]>(ref ItemBoxMgr.m_itemBox, itemBoxs);
             Interlocked.Exchange <Dictionary <int, List <ItemBoxInfo> > >(ref ItemBoxMgr.m_itemBoxs, dictionary);
         }
     }
     catch (Exception ex)
     {
         if (ItemBoxMgr.log.IsErrorEnabled)
         {
             ItemBoxMgr.log.Error((object)"ReLoad", ex);
         }
         return(false);
     }
     return(true);
 }
示例#3
0
        public static bool ReLoad()
        {
            bool result;

            try
            {
                ItemBoxInfo[] tempItemBox = ItemBoxMgr.LoadItemBoxDb();
                Dictionary <int, List <ItemBoxInfo> > tempItemBoxs = ItemBoxMgr.LoadItemBoxs(tempItemBox);
                if (tempItemBox != null)
                {
                    Interlocked.Exchange <ItemBoxInfo[]>(ref ItemBoxMgr.m_itemBox, tempItemBox);
                    Interlocked.Exchange <Dictionary <int, List <ItemBoxInfo> > >(ref ItemBoxMgr.m_itemBoxs, tempItemBoxs);
                }
            }
            catch (Exception e)
            {
                ItemBoxMgr.log.Error("ReLoad", e);

                result = false;
                return(result);
            }
            result = true;
            return(result);
        }