Changed plugins so they get Init-d before the sandbox game is created.

Changed NLog to dump Keen errors to Torch log too
Added some debug info
This commit is contained in:
Westin Miller
2018-01-24 17:24:08 -08:00
parent e6928b6ab1
commit 1e6b3faff8
7 changed files with 139 additions and 53 deletions

View File

@@ -99,14 +99,6 @@ namespace Torch.Managers.PatchManager
public const string RESULT_PARAMETER = "__result";
public const string PREFIX_SKIPPED_PARAMETER = "__prefixSkipped";
#pragma warning disable 649
[ReflectedStaticMethod(Type = typeof(RuntimeHelpers), Name = "_CompileMethod", OverrideTypeNames = new[] { "System.IRuntimeMethodInfo" })]
private static Action<object> _compileDynamicMethod;
[ReflectedMethod(Name = "GetMethodInfo")]
private static Func<RuntimeMethodHandle, object> _getMethodInfo;
[ReflectedMethod(Name = "GetMethodDescriptor")]
private static Func<DynamicMethod, RuntimeMethodHandle> _getMethodHandle;
#pragma warning restore 649
public DynamicMethod ComposePatchedMethod()
{
@@ -124,10 +116,7 @@ namespace Torch.Managers.PatchManager
try
{
// Force it to compile
RuntimeMethodHandle handle = _getMethodHandle.Invoke(method);
object runtimeMethodInfo = _getMethodInfo.Invoke(handle);
_compileDynamicMethod.Invoke(runtimeMethodInfo);
PatchUtilities.Compile(method);
}
catch
{