예제 #1
0
 public static bool ReLoad()
 {
     try
     {
         Dictionary <int, RuneTemplateInfo> dictionary = new Dictionary <int, RuneTemplateInfo>();
         if (RuneMgr.LoadItem(dictionary))
         {
             RuneMgr.m_lock.AcquireWriterLock(15000);
             try
             {
                 RuneMgr._items = dictionary;
                 return(true);
             }
             catch
             {
             }
             finally
             {
                 RuneMgr.m_lock.ReleaseWriterLock();
             }
         }
     }
     catch (Exception exception)
     {
         if (RuneMgr.log.IsErrorEnabled)
         {
             RuneMgr.log.Error("ReLoad", exception);
         }
     }
     return(false);
 }
예제 #2
0
        public static bool Init()
        {
            bool result;

            try
            {
                RuneMgr.m_lock = new ReaderWriterLock();
                RuneMgr._items = new Dictionary <int, RuneTemplateInfo>();
                result         = RuneMgr.LoadItem(RuneMgr._items);
            }
            catch (Exception exception)
            {
                if (RuneMgr.log.IsErrorEnabled)
                {
                    RuneMgr.log.Error("Init", exception);
                }
                result = false;
            }
            return(result);
        }
예제 #3
0
 public static RuneTemplateInfo FindRuneTemplateID(int templateID)
 {
     if (RuneMgr._items == null)
     {
         RuneMgr.Init();
     }
     RuneMgr.m_lock.AcquireReaderLock(15000);
     try
     {
         foreach (RuneTemplateInfo current in RuneMgr._items.Values)
         {
             if (current.TemplateID == templateID)
             {
                 return(current);
             }
         }
     }
     finally
     {
         RuneMgr.m_lock.ReleaseReaderLock();
     }
     return(null);
 }
예제 #4
0
 public static List <RuneTemplateInfo> OpenPackageLv4()
 {
     return(RuneMgr.OpenPackage(13, 15));
 }
예제 #5
0
 public static List <RuneTemplateInfo> OpenPackageLv3()
 {
     return(RuneMgr.OpenPackage(9, 11));
 }
예제 #6
0
 public static List <RuneTemplateInfo> OpenPackageLv2()
 {
     return(RuneMgr.OpenPackage(3, 9));
 }