diff --git a/BepInEx.Preloader/Entrypoint.cs b/BepInEx.Preloader/Entrypoint.cs index c60cb994..4356401d 100644 --- a/BepInEx.Preloader/Entrypoint.cs +++ b/BepInEx.Preloader/Entrypoint.cs @@ -57,10 +57,6 @@ internal static class Entrypoint /// /// The main entrypoint of BepInEx, called from Doorstop. /// - /// - /// The arguments passed in from Doorstop. First argument is the path of the currently executing - /// process. - /// public static void Main() { // We set it to the current directory first as a fallback, but try to use the same location as the .exe file. diff --git a/BepInEx.Preloader/Logger/PreloaderConsoleListener.cs b/BepInEx.Preloader/Logger/PreloaderConsoleListener.cs index 664dd516..e905c654 100644 --- a/BepInEx.Preloader/Logger/PreloaderConsoleListener.cs +++ b/BepInEx.Preloader/Logger/PreloaderConsoleListener.cs @@ -4,10 +4,17 @@ namespace BepInEx.Preloader { + /// + /// Log listener that listens to logs during preloading time and buffers messages for output in Unity logs later. + /// public class PreloaderConsoleListener : ILogListener { + /// + /// + /// public static List LogEvents { get; } = new List(); + /// public void LogEvent(object sender, LogEventArgs eventArgs) { if ((eventArgs.Level & ConfigConsoleDisplayedLevel.Value) == 0) @@ -21,6 +28,7 @@ public void LogEvent(object sender, LogEventArgs eventArgs) LogLevel.Fatal | LogLevel.Error | LogLevel.Message | LogLevel.Info | LogLevel.Warning, "Which log levels to show in the console output."); + /// public void Dispose() { } } } \ No newline at end of file diff --git a/BepInEx.Preloader/Patching/AssemblyPatcher.cs b/BepInEx.Preloader/Patching/AssemblyPatcher.cs index 94f151a6..ad65a711 100644 --- a/BepInEx.Preloader/Patching/AssemblyPatcher.cs +++ b/BepInEx.Preloader/Patching/AssemblyPatcher.cs @@ -27,6 +27,9 @@ public static class AssemblyPatcher { private const BindingFlags ALL = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.IgnoreCase; + /// + /// List of all patcher plugins to be applied + /// public static List PatcherPlugins { get; } = new List(); private static readonly string DumpedAssembliesPath = Path.Combine(Paths.BepInExRootPath, "DumpedAssemblies"); @@ -76,7 +79,6 @@ private static PatcherPlugin ToPatcherPlugin(TypeDefinition type) /// Adds all patchers from all managed assemblies specified in a directory. /// /// Directory to search patcher DLLs from. - /// A function that locates assembly patchers in a given managed assembly. public static void AddPatchersFromDirectory(string directory) { if (!Directory.Exists(directory)) @@ -195,7 +197,7 @@ private static string GetAssemblyName(string fullName) { return new AssemblyName(fullName).Name; } - catch (Exception e) + catch (Exception) { return fullName; } @@ -344,6 +346,7 @@ public static void PatchAndLoad(string directory) /// Loads an individual assembly definition into the CLR. /// /// The assembly to load. + /// File name of the assembly being loaded. public static void Load(AssemblyDefinition assembly, string filename) { if (ConfigLoadDumpedAssemblies.Value) diff --git a/BepInEx.Preloader/Patching/PatcherPlugin.cs b/BepInEx.Preloader/Patching/PatcherPlugin.cs index 510b1904..9e830f80 100644 --- a/BepInEx.Preloader/Patching/PatcherPlugin.cs +++ b/BepInEx.Preloader/Patching/PatcherPlugin.cs @@ -35,11 +35,13 @@ public class PatcherPlugin : ICacheable /// public string TypeName { get; set; } = string.Empty; + /// public void Save(BinaryWriter bw) { bw.Write(TypeName); } + /// public void Load(BinaryReader br) { TypeName = br.ReadString(); diff --git a/BepInEx.Preloader/RuntimeFixes/UnityPatches.cs b/BepInEx.Preloader/RuntimeFixes/UnityPatches.cs index 821175b5..e10ad8ea 100644 --- a/BepInEx.Preloader/RuntimeFixes/UnityPatches.cs +++ b/BepInEx.Preloader/RuntimeFixes/UnityPatches.cs @@ -14,7 +14,7 @@ internal static class UnityPatches public static void Apply() { - HarmonyInstance = HarmonyWrapper.PatchAll(typeof(UnityPatches), HarmonyInstance); + HarmonyInstance = HarmonyLib.Harmony.CreateAndPatchAll(typeof(UnityPatches)); try {