コード例 #1
0
ファイル: BoxMgr.cs プロジェクト: SkelletonX/DDTServer
        public static bool ReLoad()
        {
            bool result;

            try
            {
                Dictionary <int, BoxInfo> tempTimeBoxInfo = new Dictionary <int, BoxInfo>();
                if (BoxMgr.LoadStrengthen(tempTimeBoxInfo))
                {
                    BoxMgr.m_lock.AcquireWriterLock(-1);
                    try
                    {
                        BoxMgr.m_BoxInfo = tempTimeBoxInfo;
                        result           = true;
                        return(result);
                    }
                    catch
                    {
                    }
                    finally
                    {
                        BoxMgr.m_lock.ReleaseWriterLock();
                    }
                }
            }
            catch (Exception e)
            {
                //if (BoxMgr.log.IsErrorEnabled)
                {
                    BoxMgr.log.Error("BoxMgr", e);
                }
            }
            result = false;
            return(result);
        }
コード例 #2
0
ファイル: BoxMgr.cs プロジェクト: SkelletonX/DDTServer
        public static bool Init()
        {
            bool result;

            try
            {
                BoxMgr.m_lock    = new ReaderWriterLock();
                BoxMgr.m_BoxInfo = new Dictionary <int, BoxInfo>();
                result           = BoxMgr.LoadStrengthen(BoxMgr.m_BoxInfo);
            }
            catch (Exception e)
            {
                //if (BoxMgr.log.IsErrorEnabled)
                {
                    BoxMgr.log.Error("BoxMgr", e);
                }
                result = false;
            }
            return(result);
        }