private static void OnLoad() { LoadLocalFile(); LoadHelpFile(); LoadFilterFile(); Data.Load(); Channel.Load(); GumpInfo.Load(); if (Data.IrcAutoConnect) { IrcConnection.Connection.Connect(); } }
public static void Load() { try { if (!File.Exists(Path.Combine(General.SavePath, "Gumps.bin"))) return; using (FileStream bin = new FileStream(Path.Combine(General.SavePath, "Gumps.bin"), FileMode.Open, FileAccess.Read, FileShare.Read)) { GenericReader reader = new BinaryFileReader(new BinaryReader(bin)); int version = reader.ReadInt(); if (version >= 0) { s_ForceMenu = reader.ReadBool(); int count = reader.ReadInt(); GumpInfo info; for (int i = 0; i < count; ++i) { info = new GumpInfo(); info.Load(reader); if (info.Type == null) continue; s_ForceInfos[info.Type] = info; } count = reader.ReadInt(); for (int i = 0; i < count; ++i) { info = new GumpInfo(); info.Load(reader); if (info.Mobile == null || info.Type == null) continue; if (s_Infos[info.Mobile] == null) s_Infos[info.Mobile] = new Hashtable(); ((Hashtable)s_Infos[info.Mobile])[info.Type] = info; } } reader.End(); } } catch (Exception e) { Errors.Report(General.Local(198)); Console.WriteLine(e.Message); Console.WriteLine(e.Source); Console.WriteLine(e.StackTrace); } }
public static void Load() { try { if (!File.Exists(Path.Combine(General.SavePath, "Gumps.bin"))) { return; } using (FileStream bin = new FileStream(Path.Combine(General.SavePath, "Gumps.bin"), FileMode.Open, FileAccess.Read, FileShare.Read)) { GenericReader reader = new BinaryFileReader(new BinaryReader(bin)); int version = reader.ReadInt(); if (version >= 0) { s_ForceMenu = reader.ReadBool(); int count = reader.ReadInt(); GumpInfo info; for (int i = 0; i < count; ++i) { info = new GumpInfo(); info.Load(reader); if (info.Type == null) { continue; } s_ForceInfos[info.Type] = info; } count = reader.ReadInt(); for (int i = 0; i < count; ++i) { info = new GumpInfo(); info.Load(reader); if (info.Mobile == null || info.Type == null) { continue; } if (s_Infos[info.Mobile] == null) { s_Infos[info.Mobile] = new Hashtable(); } ((Hashtable)s_Infos[info.Mobile])[info.Type] = info; } } reader.End(); } } catch (Exception e) { Errors.Report(General.Local(198)); Console.WriteLine(e.Message); Console.WriteLine(e.Source); Console.WriteLine(e.StackTrace); } }