Ejemplo n.º 1
0
        public override void Initialize(string gameExePath = null)
        {
            base.Initialize(gameExePath);
            Instance = this;

            HarmonyInstance = new Harmony("BepInEx.Hacknet.Chainloader");

            HarmonyInstance.PatchAll(typeof(ExtensionPluginPatches));
            LogWriteLineToDisk.LogWriter = (Logger.Listeners.FirstOrDefault(x => x is DiskLogListener) as DiskLogListener)?.LogWriter;
            HarmonyInstance.PatchAll(typeof(LogWriteLineToDisk));
        }
Ejemplo n.º 2
0
        internal static void Load()
        {
            try
            {
                Paths.SetExecutablePath(typeof(HN.Program).Assembly.GetName().Name);

                Logger.Listeners.Add(new ConsoleLogger());
                AccessTools.PropertySetter(typeof(TraceLogSource), nameof(TraceLogSource.IsListening)).Invoke(null, new object[] { true });
                ConsoleManager.Initialize(true);

                // Start chainloader for plugins
                var chainloader = new HacknetChainloader();
                chainloader.Initialize();
                chainloader.Execute();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Fatal loading exception:");
                Console.WriteLine(ex);
                Console.ReadLine();
                Environment.Exit(1);
            }
        }