protected static void FinishInit() { Trace.WriteLine("Finished loading all WZ data in " + (DateTime.Now - startTime).TotalMilliseconds + " ms"); pOverride.ForEach(x => x.Dispose()); pOverride.Clear(); pOverride = null; pFile.Dispose(); pFile = null; // do some cleanup GC.Collect(GC.MaxGeneration, GCCollectionMode.Forced, true, true); GC.WaitForPendingFinalizers(); }
public void DisposeFile() { _nxFile.Dispose(); _nxFile = null; }
public void Load(string pPath) { DateTime Start = DateTime.Now; Logger.WriteLog(Logger.LogTypes.NX, "Caching NX files..."); Equips = new Dictionary<int, EquipData>(); Maps = new Dictionary<int, Map>(); Mobs = new Dictionary<int, MobData>(); TamingMobs = new Dictionary<int, TamingMobData>(); CharacterNX = new NXFile(pPath + "\\Character.NX"); //EtcNX = new NXFile("\\Etc.NX"); //ItemNX = new NXFile("\\Item.NX"); MobNX = new NXFile(pPath + "\\Mob.NX"); MapNX = new NXFile(pPath + "\\Map.NX"); //QuestNX = new NXFile("\\Quest.NX"); //ReactorNX = new NXFile("\\Reactor.NX"); //SkillNX = new NXFile("\\Skill.NX"); //StringNX = new NXFile("\\String.NX"); //TamingMobNX = new NXFile("\\TamingMob.NX"); LoadMobs(); LoadMaps(); LoadEquips(); LoadTamingMobs(); CharacterNX.Dispose(); MapNX.Dispose(); MobNX.Dispose(); DateTime Finish = DateTime.Now; Logger.WriteLog(Logger.LogTypes.NX, "Cached NX files in {0}ms.", (Finish-Start).Milliseconds); }