|
@ -16,6 +16,7 @@ using MethodAttributes = Mono.Cecil.MethodAttributes; |
|
|
#if NET3
|
|
|
#if NET3
|
|
|
using Net3_Proxy; |
|
|
using Net3_Proxy; |
|
|
using Path = Net3_Proxy.Path; |
|
|
using Path = Net3_Proxy.Path; |
|
|
|
|
|
using File = Net3_Proxy.File; |
|
|
using Directory = Net3_Proxy.Directory; |
|
|
using Directory = Net3_Proxy.Directory; |
|
|
#endif
|
|
|
#endif
|
|
|
|
|
|
|
|
@ -29,6 +30,7 @@ namespace IPA.Injector |
|
|
{ |
|
|
{ |
|
|
private static Task pluginAsyncLoadTask; |
|
|
private static Task pluginAsyncLoadTask; |
|
|
private static Task permissionFixTask; |
|
|
private static Task permissionFixTask; |
|
|
|
|
|
private static string otherNewtonsoftJson = null; |
|
|
|
|
|
|
|
|
// ReSharper disable once UnusedParameter.Global
|
|
|
// ReSharper disable once UnusedParameter.Global
|
|
|
internal static void Main(string[] args) |
|
|
internal static void Main(string[] args) |
|
@ -45,6 +47,16 @@ namespace IPA.Injector |
|
|
|
|
|
|
|
|
SetupLibraryLoading(); |
|
|
SetupLibraryLoading(); |
|
|
|
|
|
|
|
|
|
|
|
var otherNewtonsoft = Path.Combine( |
|
|
|
|
|
Directory.EnumerateDirectories(Environment.CurrentDirectory, "*_Data").First(), |
|
|
|
|
|
"Managed", |
|
|
|
|
|
"Newtonsoft.Json.dll"); |
|
|
|
|
|
if (File.Exists(otherNewtonsoft)) |
|
|
|
|
|
{ // this game ships its own Newtonsoft; force load ours and flag loading theirs
|
|
|
|
|
|
LibLoader.LoadLibrary(new AssemblyName("Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed")); |
|
|
|
|
|
otherNewtonsoftJson = otherNewtonsoft; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
EnsureDirectories(); |
|
|
EnsureDirectories(); |
|
|
|
|
|
|
|
|
// this is weird, but it prevents Mono from having issues loading the type.
|
|
|
// this is weird, but it prevents Mono from having issues loading the type.
|
|
@ -259,6 +271,9 @@ namespace IPA.Injector |
|
|
if (bootstrapped) return; |
|
|
if (bootstrapped) return; |
|
|
bootstrapped = true; |
|
|
bootstrapped = true; |
|
|
|
|
|
|
|
|
|
|
|
if (otherNewtonsoftJson != null) |
|
|
|
|
|
Assembly.LoadFrom(otherNewtonsoftJson); |
|
|
|
|
|
|
|
|
Application.logMessageReceived += delegate (string condition, string stackTrace, LogType type) |
|
|
Application.logMessageReceived += delegate (string condition, string stackTrace, LogType type) |
|
|
{ |
|
|
{ |
|
|
var level = UnityLogRedirector.LogTypeToLevel(type); |
|
|
var level = UnityLogRedirector.LogTypeToLevel(type); |
|
|