Browse Source

Fixed load order

Removed now-redundant debug logging
pull/46/head
Anairkoen Schno 5 years ago
parent
commit
8c67b56db8
2 changed files with 3 additions and 12 deletions
  1. +2
    -4
      IPA.Injector/Injector.cs
  2. +1
    -8
      IPA.Loader/Loader/LibLoader.cs

+ 2
- 4
IPA.Injector/Injector.cs View File

@ -45,8 +45,6 @@ namespace IPA.Injector
if (Environment.GetCommandLineArgs().Contains("--verbose")) if (Environment.GetCommandLineArgs().Contains("--verbose"))
WinConsole.Initialize(); WinConsole.Initialize();
Console.WriteLine("Setting up library loading");
SetupLibraryLoading(); SetupLibraryLoading();
/*var otherNewtonsoft = Path.Combine( /*var otherNewtonsoft = Path.Combine(
@ -98,8 +96,6 @@ namespace IPA.Injector
GameVersionEarly.Load(); GameVersionEarly.Load();
InstallHarmonyProtections();
pluginAsyncLoadTask = PluginLoader.LoadTask(); pluginAsyncLoadTask = PluginLoader.LoadTask();
permissionFixTask = PermissionFix.FixPermissions(new DirectoryInfo(Environment.CurrentDirectory)); permissionFixTask = PermissionFix.FixPermissions(new DirectoryInfo(Environment.CurrentDirectory));
} }
@ -311,6 +307,8 @@ namespace IPA.Injector
// need to reinit streams singe Unity seems to redirect stdout // need to reinit streams singe Unity seems to redirect stdout
StdoutInterceptor.RedirectConsole(); StdoutInterceptor.RedirectConsole();
InstallHarmonyProtections();
var bootstrapper = new GameObject("NonDestructiveBootstrapper").AddComponent<Bootstrapper>(); var bootstrapper = new GameObject("NonDestructiveBootstrapper").AddComponent<Bootstrapper>();
bootstrapper.Destroyed += Bootstrapper_Destroyed; bootstrapper.Destroyed += Bootstrapper_Destroyed;
} }


+ 1
- 8
IPA.Loader/Loader/LibLoader.cs View File

@ -53,8 +53,6 @@ namespace IPA.Loader
internal static void Configure() internal static void Configure()
{ {
Console.WriteLine("Configuring up library loading");
SetupAssemblyFilenames(true); SetupAssemblyFilenames(true);
AppDomain.CurrentDomain.AssemblyResolve -= AssemblyLibLoader; AppDomain.CurrentDomain.AssemblyResolve -= AssemblyLibLoader;
AppDomain.CurrentDomain.AssemblyResolve += AssemblyLibLoader; AppDomain.CurrentDomain.AssemblyResolve += AssemblyLibLoader;
@ -64,8 +62,6 @@ namespace IPA.Loader
{ {
if (FilenameLocations == null || force) if (FilenameLocations == null || force)
{ {
Console.WriteLine("Calculating assembly filenames");
FilenameLocations = new Dictionary<string, string>(); FilenameLocations = new Dictionary<string, string>();
foreach (var fn in TraverseTree(LibraryPath, s => s != NativeLibraryPath)) foreach (var fn in TraverseTree(LibraryPath, s => s != NativeLibraryPath))
@ -73,7 +69,6 @@ namespace IPA.Loader
Log(Logger.Level.Critical, $"Multiple instances of {fn.Name} exist in Libs! Ignoring {fn.FullName}"); Log(Logger.Level.Critical, $"Multiple instances of {fn.Name} exist in Libs! Ignoring {fn.FullName}");
else FilenameLocations.Add(fn.Name, fn.FullName); else FilenameLocations.Add(fn.Name, fn.FullName);
foreach (var kvp in FilenameLocations) Console.WriteLine(kvp);
if (!SetDefaultDllDirectories(LoadLibraryFlags.LOAD_LIBRARY_SEARCH_USER_DIRS | LoadLibraryFlags.LOAD_LIBRARY_SEARCH_SYSTEM32 if (!SetDefaultDllDirectories(LoadLibraryFlags.LOAD_LIBRARY_SEARCH_USER_DIRS | LoadLibraryFlags.LOAD_LIBRARY_SEARCH_SYSTEM32
| LoadLibraryFlags.LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LoadLibraryFlags.LOAD_LIBRARY_SEARCH_APPLICATION_DIR)) | LoadLibraryFlags.LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LoadLibraryFlags.LOAD_LIBRARY_SEARCH_APPLICATION_DIR))
@ -90,7 +85,7 @@ namespace IPA.Loader
if (retPtr == IntPtr.Zero) if (retPtr == IntPtr.Zero)
{ {
var err = new Win32Exception(); var err = new Win32Exception();
Log(Logger.Level.Warning, $"Could not add DLL directory");
Log(Logger.Level.Warning, $"Could not add DLL directory {path}");
Log(Logger.Level.Warning, err); Log(Logger.Level.Warning, err);
} }
} }
@ -124,8 +119,6 @@ namespace IPA.Loader
SetupAssemblyFilenames(); SetupAssemblyFilenames();
Console.WriteLine($"Looking for {asmName.Name} {asmName.Version} ({asmName.Name}.{asmName.Version}.dll)");
var testFile = $"{asmName.Name}.{asmName.Version}.dll"; var testFile = $"{asmName.Name}.{asmName.Version}.dll";
Log(Logger.Level.Debug, $"Looking for file {testFile}"); Log(Logger.Level.Debug, $"Looking for file {testFile}");


Loading…
Cancel
Save