From 9380d71f22c4db3ecfde0254e8e4ffdb0e0bdbf7 Mon Sep 17 00:00:00 2001 From: Viktor Ferenczi Date: Fri, 24 May 2024 01:05:00 +0200 Subject: [PATCH] 1.11.8 (#63) - Harmony 2.3.3 - Disabled `FixGridGroups` due to inability to patch generics (methods of `MyGroups`) - Disabled patching generics in `DEBUG` only code (no effect on functionality) - Accepted code change in `MyCharacter.RigidBody_ContactPointCallback` --- ClientPlugin/ClientPlugin.csproj | 4 +- ClientPlugin/GUI/PluginConfigDialog.cs | 8 +- ClientPlugin/Properties/AssemblyInfo.cs | 4 +- ClientPlugin/packages.config | 2 +- DedicatedPlugin/DedicatedPlugin.csproj | 4 +- DedicatedPlugin/Properties/AssemblyInfo.cs | 4 +- DedicatedPlugin/packages.config | 2 +- Shared/Patches/Character/MyCharacterPatch.cs | 2 +- ...RigidBody_ContactPointCallback.original.il | 97 ++++++++---- .../RigidBody_ContactPointCallback.patched.il | 97 ++++++++---- .../MyPathFindingSystemEnumeratorPatch.cs | 13 +- .../Conveyor/MyPathFindingSystemPatch.cs | 10 +- Shared/Patches/MergeAndPaste/MyGroupsPatch.cs | 7 +- .../MyResourceDistributorComponentPatch.cs | 7 +- Shared/Patches/PatchHelpers.cs | 4 +- Tests/App.config | 146 ++++++++++++++++++ Tests/Tests.csproj | 10 +- Tests/packages.config | 1 + TorchPlugin/Commands.cs | 4 +- TorchPlugin/ConfigView.xaml | 5 +- TorchPlugin/Plugin.cs | 2 +- TorchPlugin/PluginConfig.cs | 3 +- TorchPlugin/Properties/AssemblyInfo.cs | 4 +- TorchPlugin/TorchPlugin.csproj | 4 +- TorchPlugin/manifest.xml | 2 +- TorchPlugin/packages.config | 2 +- 26 files changed, 336 insertions(+), 112 deletions(-) create mode 100644 Tests/App.config diff --git a/ClientPlugin/ClientPlugin.csproj b/ClientPlugin/ClientPlugin.csproj index e655d94..ed9fe87 100644 --- a/ClientPlugin/ClientPlugin.csproj +++ b/ClientPlugin/ClientPlugin.csproj @@ -33,8 +33,8 @@ 4 - - ..\packages\Lib.Harmony.2.2.2\lib\net48\0Harmony.dll + + ..\packages\Lib.Harmony.2.3.3\lib\net48\0Harmony.dll ..\Bin64\DirectShowLib.dll diff --git a/ClientPlugin/GUI/PluginConfigDialog.cs b/ClientPlugin/GUI/PluginConfigDialog.cs index 33e0019..00f32ca 100644 --- a/ClientPlugin/GUI/PluginConfigDialog.cs +++ b/ClientPlugin/GUI/PluginConfigDialog.cs @@ -31,8 +31,10 @@ public class PluginConfigDialog : MyGuiScreenBase private MyGuiControlLabel fixGarbageCollectionLabel; private MyGuiControlCheckbox fixGarbageCollectionCheckbox; + /* Disabled due to inability to patch generics (methods of MyGroups) private MyGuiControlLabel fixGridGroupsLabel; private MyGuiControlCheckbox fixGridGroupsCheckbox; + */ private MyGuiControlLabel cacheModsLabel; private MyGuiControlCheckbox cacheModsCheckbox; @@ -131,7 +133,7 @@ private void CreateControls() CreateCheckbox(out fixGridPasteLabel, out fixGridPasteCheckbox, config.FixGridPaste, value => config.FixGridPaste = value, "Fix grid paste", "Disable updates during grid paste (MyCubeGrid.PasteBlocksServer)"); CreateCheckbox(out fixP2PUpdateStatsLabel, out fixP2PUpdateStatsCheckbox, config.FixP2PUpdateStats, value => config.FixP2PUpdateStats = value, "Fix P2P update stats", "Eliminate 98% of EOS P2P network statistics updates (VRage.EOS.MyP2PQoSAdapter.UpdateStats)"); CreateCheckbox(out fixGarbageCollectionLabel, out fixGarbageCollectionCheckbox, config.FixGarbageCollection, value => config.FixGarbageCollection = value, "Fix garbage collection", "Eliminate long pauses on starting and stopping large worlds by disabling selected GC.Collect calls"); - CreateCheckbox(out fixGridGroupsLabel, out fixGridGroupsCheckbox, config.FixGridGroups, value => config.FixGridGroups = value, "Fix grid groups", "Disable resource updates while grids are being moved between groups"); + // CreateCheckbox(out fixGridGroupsLabel, out fixGridGroupsCheckbox, config.FixGridGroups, value => config.FixGridGroups = value, "Fix grid groups", "Disable resource updates while grids are being moved between groups"); CreateCheckbox(out cacheModsLabel, out cacheModsCheckbox, config.CacheMods, value => config.CacheMods = value, "Cache compiled mods", "Caches compiled mods for faster world load"); CreateCheckbox(out cacheScriptsLabel, out cacheScriptsCheckbox, config.CacheScripts, value => config.CacheScripts = value, "Cache compiled scripts", "Caches compiled in-game scripts (PB programs) to reduce lag"); CreateCheckbox(out disableModApiStatisticsLabel, out disableModApiStatisticsCheckbox, config.DisableModApiStatistics, value => config.DisableModApiStatistics = value, "Disable Mod API statistics", "Disable the collection of Mod API call statistics to eliminate the overhead (affects only world loading)"); @@ -203,7 +205,7 @@ private void EnableDisableFixes(MyGuiControlCheckbox _ = null) fixGridPasteCheckbox.Enabled = enabled; fixP2PUpdateStatsCheckbox.Enabled = enabled; fixGarbageCollectionCheckbox.Enabled = enabled; - fixGridGroupsCheckbox.Enabled = enabled; + // fixGridGroupsCheckbox.Enabled = enabled; cacheModsCheckbox.Enabled = enabled; cacheScriptsCheckbox.Enabled = enabled; disableModApiStatisticsCheckbox.Enabled = enabled; @@ -252,9 +254,11 @@ private void LayoutControls() layoutTable.Add(fixGarbageCollectionLabel, MyAlignH.Left, MyAlignV.Center, row, 1); row++; + /* Disabled due to inability to patch generics (methods of MyGroups) layoutTable.Add(fixGridGroupsCheckbox, MyAlignH.Left, MyAlignV.Center, row, 0); layoutTable.Add(fixGridGroupsLabel, MyAlignH.Left, MyAlignV.Center, row, 1); row++; + */ layoutTable.Add(cacheModsCheckbox, MyAlignH.Left, MyAlignV.Center, row, 0); layoutTable.Add(cacheModsLabel, MyAlignH.Left, MyAlignV.Center, row, 1); diff --git a/ClientPlugin/Properties/AssemblyInfo.cs b/ClientPlugin/Properties/AssemblyInfo.cs index 960668e..8eb1530 100644 --- a/ClientPlugin/Properties/AssemblyInfo.cs +++ b/ClientPlugin/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.11.7.0")] -[assembly: AssemblyFileVersion("1.11.7.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.11.8.0")] +[assembly: AssemblyFileVersion("1.11.8.0")] \ No newline at end of file diff --git a/ClientPlugin/packages.config b/ClientPlugin/packages.config index f89be6e..90ca77a 100644 --- a/ClientPlugin/packages.config +++ b/ClientPlugin/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/DedicatedPlugin/DedicatedPlugin.csproj b/DedicatedPlugin/DedicatedPlugin.csproj index 18455a1..2f8b951 100644 --- a/DedicatedPlugin/DedicatedPlugin.csproj +++ b/DedicatedPlugin/DedicatedPlugin.csproj @@ -33,8 +33,8 @@ 4 - - ..\packages\Lib.Harmony.2.2.2\lib\net48\0Harmony.dll + + ..\packages\Lib.Harmony.2.3.3\lib\net48\0Harmony.dll ..\Torch\DedicatedServer64\DirectShowLib.dll diff --git a/DedicatedPlugin/Properties/AssemblyInfo.cs b/DedicatedPlugin/Properties/AssemblyInfo.cs index 250bf9b..2e15505 100644 --- a/DedicatedPlugin/Properties/AssemblyInfo.cs +++ b/DedicatedPlugin/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.11.7.0")] -[assembly: AssemblyFileVersion("1.11.7.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.11.8.0")] +[assembly: AssemblyFileVersion("1.11.8.0")] \ No newline at end of file diff --git a/DedicatedPlugin/packages.config b/DedicatedPlugin/packages.config index f89be6e..90ca77a 100644 --- a/DedicatedPlugin/packages.config +++ b/DedicatedPlugin/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/Shared/Patches/Character/MyCharacterPatch.cs b/Shared/Patches/Character/MyCharacterPatch.cs index 16817d6..b8aeae5 100644 --- a/Shared/Patches/Character/MyCharacterPatch.cs +++ b/Shared/Patches/Character/MyCharacterPatch.cs @@ -25,7 +25,7 @@ public static void Configure() // ReSharper disable once UnusedMember.Local [HarmonyTranspiler] [HarmonyPatch("RigidBody_ContactPointCallback")] - [EnsureCode("230531d5|c1e4183d")] + [EnsureCode("c1e4183d")] private static IEnumerable RigidBody_ContactPointCallbackTranspiler(IEnumerable instructions) { if (!enabled) diff --git a/Shared/Patches/Character/RigidBody_ContactPointCallback.original.il b/Shared/Patches/Character/RigidBody_ContactPointCallback.original.il index d442e5e..ff9891f 100644 --- a/Shared/Patches/Character/RigidBody_ContactPointCallback.original.il +++ b/Shared/Patches/Character/RigidBody_ContactPointCallback.original.il @@ -1,9 +1,9 @@ -// 230531d5 -newobj System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::.ctor() +// c1e4183d +newobj System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::.ctor() stloc.0 ldloc.0 ldarg.0 -stfld Sandbox.Game.Entities.Character.MyCharacter Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::<>4__this +stfld Sandbox.Game.Entities.Character.MyCharacter Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::<>4__this ldarg.0 call System.Boolean Sandbox.Game.Entities.Character.MyCharacter::get_IsDead() brfalse.s L0 @@ -63,27 +63,27 @@ ldarg.0 call static VRage.ModAPI.IMyEntity Sandbox.Engine.Physics.MyPhysicsExtensions::GetOtherEntity(Havok.HkContactPointEvent eventInfo, VRage.ModAPI.IMyEntity sourceEntity) callvirt abstract virtual VRage.Game.Components.MyPhysicsComponentBase VRage.ModAPI.IMyEntity::get_Physics() isinst Sandbox.Engine.Voxels.MyVoxelPhysicsBody -stfld Sandbox.Engine.Voxels.MyVoxelPhysicsBody Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::otherPhysicsBody +stfld Sandbox.Engine.Voxels.MyVoxelPhysicsBody Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::otherPhysicsBody ldloc.0 ldarg.1 ldfld Havok.HkContactPoint Havok.HkContactPointEvent::ContactPoint stloc.s 24 (Havok.HkContactPoint) ldloca.s 24 (Havok.HkContactPoint) call VRageMath.Vector3 Havok.HkContactPoint::get_Position() -stfld VRageMath.Vector3 Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::contactPointPosition +stfld VRageMath.Vector3 Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::contactPointPosition ldloc.0 ldarg.1 ldfld Havok.HkContactPoint Havok.HkContactPointEvent::ContactPoint stloc.s 24 (Havok.HkContactPoint) ldloca.s 24 (Havok.HkContactPoint) call VRageMath.Vector3 Havok.HkContactPoint::get_Normal() -stfld VRageMath.Vector3 Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::contactPointNormal +stfld VRageMath.Vector3 Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::contactPointNormal ldloc.0 -ldfld Sandbox.Engine.Voxels.MyVoxelPhysicsBody Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::otherPhysicsBody +ldfld Sandbox.Engine.Voxels.MyVoxelPhysicsBody Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::otherPhysicsBody brfalse L8 ldsfld Sandbox.MySandboxGame Sandbox.MySandboxGame::Static ldloc.0 -ldftn System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::b__0() +ldftn System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::b__0() newobj System.Void System.Action::.ctor(System.Object object, System.IntPtr method) ldstr "MyCharacter.RigidBody_ContactPointCallback.TrySpawnWalkingParticles" ldc.i4.m1 @@ -153,7 +153,7 @@ ldloc.0 ldloc.3 callvirt VRage.ModAPI.IMyEntity VRage.Game.Components.MyPhysicsComponentBase::get_Entity() isinst VRage.Game.Entity.MyEntity -stfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::other +stfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::other ldloc.1 stloc.s 6 (Havok.HkRigidBody) ldarg.1 @@ -163,7 +163,7 @@ ldloca.s 24 (Havok.HkContactPoint) call VRageMath.Vector3 Havok.HkContactPoint::get_Normal() stloc.s 7 (VRageMath.Vector3) ldloc.0 -ldfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::other +ldfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::other ldarg.0 bne.un.s L11 ldc.i4.1 @@ -172,7 +172,7 @@ ldloc.0 ldloc.s 4 (Sandbox.Engine.Physics.MyPhysicsBody) callvirt VRage.ModAPI.IMyEntity VRage.Game.Components.MyPhysicsComponentBase::get_Entity() isinst VRage.Game.Entity.MyEntity -stfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::other +stfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::other ldloc.2 stloc.s 6 (Havok.HkRigidBody) ldloc.s 7 (VRageMath.Vector3) @@ -180,7 +180,7 @@ call static VRageMath.Vector3 VRageMath.Vector3::op_UnaryNegation(VRageMath.Vect stloc.s 7 (VRageMath.Vector3) L11: ldloc.0 -ldfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::other +ldfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::other isinst Sandbox.Game.Entities.Character.MyCharacter stloc.s 8 (Sandbox.Game.Entities.Character.MyCharacter) ldloc.s 8 (Sandbox.Game.Entities.Character.MyCharacter) @@ -213,7 +213,7 @@ L14: L16: L17: ldloc.0 -ldfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::other +ldfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::other isinst Sandbox.Game.Entities.MyCubeGrid stloc.s 9 (Sandbox.Game.Entities.MyCubeGrid) ldloc.s 9 (Sandbox.Game.Entities.MyCubeGrid) @@ -383,15 +383,15 @@ ldarg.0 ldfld System.Single Sandbox.Game.Entities.Character.MyCharacter::m_canPlayImpact ldc.r4 0 bgt.un L38 -newobj System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass463_1::.ctor() +newobj System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass469_1::.ctor() ldarg.0 ldc.r4 0.3 stfld System.Single Sandbox.Game.Entities.Character.MyCharacter::m_canPlayImpact dup ldarg.1 ldobj Havok.HkContactPointEvent -stfld Havok.HkContactPointEvent Sandbox.Game.Entities.Character.<>c__DisplayClass463_1::hkContactPointEvent -ldftn System.Boolean Sandbox.Game.Entities.Character.<>c__DisplayClass463_1::b__1() +stfld Havok.HkContactPointEvent Sandbox.Game.Entities.Character.<>c__DisplayClass469_1::hkContactPointEvent +ldftn System.Boolean Sandbox.Game.Entities.Character.<>c__DisplayClass469_1::b__1() newobj System.Void System.Func`1::.ctor(System.Object object, System.IntPtr method) stloc.s 35 (System.Func`1[System.Boolean]) ldarg.0 @@ -517,42 +517,42 @@ ldloc.s 19 (System.Single) mul ldc.r4 2 div -stfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +stfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact ldloc.s 14 (System.Single) ldc.r4 2 ble.un.s L48 ldloc.0 ldloc.0 -ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact ldc.r4 400 sub -stfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +stfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact br.s L49 L48: ldloc.s 14 (System.Single) ldc.r4 0 bne.un.s L50 ldloc.0 -ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact ldc.r4 100 ble.un.s L51 ldloc.0 ldloc.0 -ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact ldc.r4 80 div -stfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +stfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact L49: L50: L51: ldloc.0 ldloc.0 -ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact ldc.r4 10 div -stfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +stfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact ldloc.0 -ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact ldc.r4 1 blt.un L52 call static System.Boolean Sandbox.Game.Multiplayer.Sync::get_IsServer() @@ -573,24 +573,56 @@ call static Sandbox.Engine.Physics.MyPhysicsBody Sandbox.Engine.Physics.MyPhysic callvirt VRage.ModAPI.IMyEntity VRage.Game.Components.MyPhysicsComponentBase::get_Entity() stloc.s 39 (VRage.ModAPI.IMyEntity) L54: -call static Sandbox.Game.World.MySession Sandbox.Game.World.MySession::get_Static() -ldfld VRage.Game.MyObjectBuilder_SessionSettings Sandbox.Game.World.MySession::Settings -ldfld System.Boolean VRage.Game.MyObjectBuilder_SessionSettings::EnableFriendlyFire -brtrue.s L55 ldloc.s 39 (VRage.ModAPI.IMyEntity) isinst Sandbox.Game.Weapons.MyMissile dup stloc.s 40 (Sandbox.Game.Weapons.MyMissile) +brfalse L55 +call static Sandbox.Game.World.MySession Sandbox.Game.World.MySession::get_Static() +ldfld VRage.Game.MyObjectBuilder_SessionSettings Sandbox.Game.World.MySession::Settings +ldfld System.Boolean VRage.Game.MyObjectBuilder_SessionSettings::EnableFriendlyFire brfalse.s L56 ldloc.s 40 (Sandbox.Game.Weapons.MyMissile) ldarg.0 call Sandbox.Game.World.MyIdentity Sandbox.Game.Entities.Character.MyCharacter::GetIdentity() callvirt System.Int64 Sandbox.Game.World.MyIdentity::get_IdentityId() callvirt virtual System.Boolean Sandbox.Game.Weapons.MyMissile::IsCharacterIdFriendly(System.Int64 charId) -brtrue.s L57 +brtrue L57 +newobj System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass469_2::.ctor() +stloc.s 41 (Sandbox.Game.Entities.Character.MyCharacter+<>c__DisplayClass469_2) +ldloc.s 41 (Sandbox.Game.Entities.Character.MyCharacter+<>c__DisplayClass469_2) +ldloc.0 +stfld Sandbox.Game.Entities.Character.<>c__DisplayClass469_0 Sandbox.Game.Entities.Character.<>c__DisplayClass469_2::CS$<>8__locals1 +ldloc.s 41 (Sandbox.Game.Entities.Character.MyCharacter+<>c__DisplayClass469_2) +ldloc.s 40 (Sandbox.Game.Weapons.MyMissile) +callvirt virtual VRage.Game.MyDefinitionBase Sandbox.Game.Weapons.MyMissile::get_AmmoDefinition() +ldflda VRage.Game.MyDefinitionId VRage.Game.MyDefinitionBase::Id +ldfld VRage.Utils.MyStringHash VRage.Game.MyDefinitionId::SubtypeId +stfld VRage.Utils.MyStringHash Sandbox.Game.Entities.Character.<>c__DisplayClass469_2::sn ldsfld Sandbox.MySandboxGame Sandbox.MySandboxGame::Static +ldloc.s 41 (Sandbox.Game.Entities.Character.MyCharacter+<>c__DisplayClass469_2) +ldftn System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass469_2::b__3() +newobj System.Void System.Action::.ctor(System.Object object, System.IntPtr method) +ldstr "MyCharacter.DoDamage" +ldc.i4.m1 +ldc.i4.0 +callvirt System.Void Sandbox.MySandboxGame::Invoke(System.Action action, System.String invokerName, System.Int32 startAtFrame, System.Int32 repeatTimes) +ret +L56: +newobj System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass469_3::.ctor() +stloc.s 42 (Sandbox.Game.Entities.Character.MyCharacter+<>c__DisplayClass469_3) +ldloc.s 42 (Sandbox.Game.Entities.Character.MyCharacter+<>c__DisplayClass469_3) ldloc.0 -ldftn System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::b__2() +stfld Sandbox.Game.Entities.Character.<>c__DisplayClass469_0 Sandbox.Game.Entities.Character.<>c__DisplayClass469_3::CS$<>8__locals2 +ldloc.s 42 (Sandbox.Game.Entities.Character.MyCharacter+<>c__DisplayClass469_3) +ldloc.s 40 (Sandbox.Game.Weapons.MyMissile) +callvirt virtual VRage.Game.MyDefinitionBase Sandbox.Game.Weapons.MyMissile::get_AmmoDefinition() +ldflda VRage.Game.MyDefinitionId VRage.Game.MyDefinitionBase::Id +ldfld VRage.Utils.MyStringHash VRage.Game.MyDefinitionId::SubtypeId +stfld VRage.Utils.MyStringHash Sandbox.Game.Entities.Character.<>c__DisplayClass469_3::sn +ldsfld Sandbox.MySandboxGame Sandbox.MySandboxGame::Static +ldloc.s 42 (Sandbox.Game.Entities.Character.MyCharacter+<>c__DisplayClass469_3) +ldftn System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass469_3::b__4() newobj System.Void System.Action::.ctor(System.Object object, System.IntPtr method) ldstr "MyCharacter.DoDamage" ldc.i4.m1 @@ -598,10 +630,9 @@ ldc.i4.0 callvirt System.Void Sandbox.MySandboxGame::Invoke(System.Action action, System.String invokerName, System.Int32 startAtFrame, System.Int32 repeatTimes) ret L55: -L56: ldsfld Sandbox.MySandboxGame Sandbox.MySandboxGame::Static ldloc.0 -ldftn System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::b__3() +ldftn System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::b__2() newobj System.Void System.Action::.ctor(System.Object object, System.IntPtr method) ldstr "MyCharacter.DoDamage" ldc.i4.m1 diff --git a/Shared/Patches/Character/RigidBody_ContactPointCallback.patched.il b/Shared/Patches/Character/RigidBody_ContactPointCallback.patched.il index 99dd83a..472305e 100644 --- a/Shared/Patches/Character/RigidBody_ContactPointCallback.patched.il +++ b/Shared/Patches/Character/RigidBody_ContactPointCallback.patched.il @@ -1,9 +1,9 @@ -// 7b68e0c9 -newobj System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::.ctor() +// 94c97f4c +newobj System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::.ctor() stloc.0 ldloc.0 ldarg.0 -stfld Sandbox.Game.Entities.Character.MyCharacter Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::<>4__this +stfld Sandbox.Game.Entities.Character.MyCharacter Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::<>4__this ldarg.0 call System.Boolean Sandbox.Game.Entities.Character.MyCharacter::get_IsDead() brfalse.s L0 @@ -63,29 +63,29 @@ ldarg.0 call static VRage.ModAPI.IMyEntity Sandbox.Engine.Physics.MyPhysicsExtensions::GetOtherEntity(Havok.HkContactPointEvent eventInfo, VRage.ModAPI.IMyEntity sourceEntity) callvirt abstract virtual VRage.Game.Components.MyPhysicsComponentBase VRage.ModAPI.IMyEntity::get_Physics() isinst Sandbox.Engine.Voxels.MyVoxelPhysicsBody -stfld Sandbox.Engine.Voxels.MyVoxelPhysicsBody Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::otherPhysicsBody +stfld Sandbox.Engine.Voxels.MyVoxelPhysicsBody Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::otherPhysicsBody ldloc.0 ldarg.1 ldfld Havok.HkContactPoint Havok.HkContactPointEvent::ContactPoint stloc.s 24 (Havok.HkContactPoint) ldloca.s 24 (Havok.HkContactPoint) call VRageMath.Vector3 Havok.HkContactPoint::get_Position() -stfld VRageMath.Vector3 Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::contactPointPosition +stfld VRageMath.Vector3 Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::contactPointPosition ldloc.0 ldarg.1 ldfld Havok.HkContactPoint Havok.HkContactPointEvent::ContactPoint stloc.s 24 (Havok.HkContactPoint) ldloca.s 24 (Havok.HkContactPoint) call VRageMath.Vector3 Havok.HkContactPoint::get_Normal() -stfld VRageMath.Vector3 Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::contactPointNormal +stfld VRageMath.Vector3 Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::contactPointNormal call static System.Boolean Sandbox.Game.Multiplayer.Sync::get_IsDedicated() brtrue L8 ldloc.0 -ldfld Sandbox.Engine.Voxels.MyVoxelPhysicsBody Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::otherPhysicsBody +ldfld Sandbox.Engine.Voxels.MyVoxelPhysicsBody Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::otherPhysicsBody brfalse L8 ldsfld Sandbox.MySandboxGame Sandbox.MySandboxGame::Static ldloc.0 -ldftn System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::b__0() +ldftn System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::b__0() newobj System.Void System.Action::.ctor(System.Object object, System.IntPtr method) ldstr "MyCharacter.RigidBody_ContactPointCallback.TrySpawnWalkingParticles" ldc.i4.m1 @@ -155,7 +155,7 @@ ldloc.0 ldloc.3 callvirt VRage.ModAPI.IMyEntity VRage.Game.Components.MyPhysicsComponentBase::get_Entity() isinst VRage.Game.Entity.MyEntity -stfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::other +stfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::other ldloc.1 stloc.s 6 (Havok.HkRigidBody) ldarg.1 @@ -165,7 +165,7 @@ ldloca.s 24 (Havok.HkContactPoint) call VRageMath.Vector3 Havok.HkContactPoint::get_Normal() stloc.s 7 (VRageMath.Vector3) ldloc.0 -ldfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::other +ldfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::other ldarg.0 bne.un.s L11 ldc.i4.1 @@ -174,7 +174,7 @@ ldloc.0 ldloc.s 4 (Sandbox.Engine.Physics.MyPhysicsBody) callvirt VRage.ModAPI.IMyEntity VRage.Game.Components.MyPhysicsComponentBase::get_Entity() isinst VRage.Game.Entity.MyEntity -stfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::other +stfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::other ldloc.2 stloc.s 6 (Havok.HkRigidBody) ldloc.s 7 (VRageMath.Vector3) @@ -182,7 +182,7 @@ call static VRageMath.Vector3 VRageMath.Vector3::op_UnaryNegation(VRageMath.Vect stloc.s 7 (VRageMath.Vector3) L11: ldloc.0 -ldfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::other +ldfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::other isinst Sandbox.Game.Entities.Character.MyCharacter stloc.s 8 (Sandbox.Game.Entities.Character.MyCharacter) ldloc.s 8 (Sandbox.Game.Entities.Character.MyCharacter) @@ -215,7 +215,7 @@ L14: L16: L17: ldloc.0 -ldfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::other +ldfld VRage.Game.Entity.MyEntity Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::other isinst Sandbox.Game.Entities.MyCubeGrid stloc.s 9 (Sandbox.Game.Entities.MyCubeGrid) ldloc.s 9 (Sandbox.Game.Entities.MyCubeGrid) @@ -387,15 +387,15 @@ ldarg.0 ldfld System.Single Sandbox.Game.Entities.Character.MyCharacter::m_canPlayImpact ldc.r4 0 bgt.un L38 -newobj System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass463_1::.ctor() +newobj System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass469_1::.ctor() ldarg.0 ldc.r4 0.3 stfld System.Single Sandbox.Game.Entities.Character.MyCharacter::m_canPlayImpact dup ldarg.1 ldobj Havok.HkContactPointEvent -stfld Havok.HkContactPointEvent Sandbox.Game.Entities.Character.<>c__DisplayClass463_1::hkContactPointEvent -ldftn System.Boolean Sandbox.Game.Entities.Character.<>c__DisplayClass463_1::b__1() +stfld Havok.HkContactPointEvent Sandbox.Game.Entities.Character.<>c__DisplayClass469_1::hkContactPointEvent +ldftn System.Boolean Sandbox.Game.Entities.Character.<>c__DisplayClass469_1::b__1() newobj System.Void System.Func`1::.ctor(System.Object object, System.IntPtr method) stloc.s 35 (System.Func`1[System.Boolean]) ldarg.0 @@ -521,42 +521,42 @@ ldloc.s 19 (System.Single) mul ldc.r4 2 div -stfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +stfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact ldloc.s 14 (System.Single) ldc.r4 2 ble.un.s L48 ldloc.0 ldloc.0 -ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact ldc.r4 400 sub -stfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +stfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact br.s L49 L48: ldloc.s 14 (System.Single) ldc.r4 0 bne.un.s L50 ldloc.0 -ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact ldc.r4 100 ble.un.s L51 ldloc.0 ldloc.0 -ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact ldc.r4 80 div -stfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +stfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact L49: L50: L51: ldloc.0 ldloc.0 -ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact ldc.r4 10 div -stfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +stfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact ldloc.0 -ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::impact +ldfld System.Single Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::impact ldc.r4 1 blt.un L52 call static System.Boolean Sandbox.Game.Multiplayer.Sync::get_IsServer() @@ -577,24 +577,56 @@ call static Sandbox.Engine.Physics.MyPhysicsBody Sandbox.Engine.Physics.MyPhysic callvirt VRage.ModAPI.IMyEntity VRage.Game.Components.MyPhysicsComponentBase::get_Entity() stloc.s 39 (VRage.ModAPI.IMyEntity) L54: -call static Sandbox.Game.World.MySession Sandbox.Game.World.MySession::get_Static() -ldfld VRage.Game.MyObjectBuilder_SessionSettings Sandbox.Game.World.MySession::Settings -ldfld System.Boolean VRage.Game.MyObjectBuilder_SessionSettings::EnableFriendlyFire -brtrue.s L55 ldloc.s 39 (VRage.ModAPI.IMyEntity) isinst Sandbox.Game.Weapons.MyMissile dup stloc.s 40 (Sandbox.Game.Weapons.MyMissile) +brfalse L55 +call static Sandbox.Game.World.MySession Sandbox.Game.World.MySession::get_Static() +ldfld VRage.Game.MyObjectBuilder_SessionSettings Sandbox.Game.World.MySession::Settings +ldfld System.Boolean VRage.Game.MyObjectBuilder_SessionSettings::EnableFriendlyFire brfalse.s L56 ldloc.s 40 (Sandbox.Game.Weapons.MyMissile) ldarg.0 call Sandbox.Game.World.MyIdentity Sandbox.Game.Entities.Character.MyCharacter::GetIdentity() callvirt System.Int64 Sandbox.Game.World.MyIdentity::get_IdentityId() callvirt virtual System.Boolean Sandbox.Game.Weapons.MyMissile::IsCharacterIdFriendly(System.Int64 charId) -brtrue.s L57 +brtrue L57 +newobj System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass469_2::.ctor() +stloc.s 41 (Sandbox.Game.Entities.Character.MyCharacter+<>c__DisplayClass469_2) +ldloc.s 41 (Sandbox.Game.Entities.Character.MyCharacter+<>c__DisplayClass469_2) +ldloc.0 +stfld Sandbox.Game.Entities.Character.<>c__DisplayClass469_0 Sandbox.Game.Entities.Character.<>c__DisplayClass469_2::CS$<>8__locals1 +ldloc.s 41 (Sandbox.Game.Entities.Character.MyCharacter+<>c__DisplayClass469_2) +ldloc.s 40 (Sandbox.Game.Weapons.MyMissile) +callvirt virtual VRage.Game.MyDefinitionBase Sandbox.Game.Weapons.MyMissile::get_AmmoDefinition() +ldflda VRage.Game.MyDefinitionId VRage.Game.MyDefinitionBase::Id +ldfld VRage.Utils.MyStringHash VRage.Game.MyDefinitionId::SubtypeId +stfld VRage.Utils.MyStringHash Sandbox.Game.Entities.Character.<>c__DisplayClass469_2::sn ldsfld Sandbox.MySandboxGame Sandbox.MySandboxGame::Static +ldloc.s 41 (Sandbox.Game.Entities.Character.MyCharacter+<>c__DisplayClass469_2) +ldftn System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass469_2::b__3() +newobj System.Void System.Action::.ctor(System.Object object, System.IntPtr method) +ldstr "MyCharacter.DoDamage" +ldc.i4.m1 +ldc.i4.0 +callvirt System.Void Sandbox.MySandboxGame::Invoke(System.Action action, System.String invokerName, System.Int32 startAtFrame, System.Int32 repeatTimes) +ret +L56: +newobj System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass469_3::.ctor() +stloc.s 42 (Sandbox.Game.Entities.Character.MyCharacter+<>c__DisplayClass469_3) +ldloc.s 42 (Sandbox.Game.Entities.Character.MyCharacter+<>c__DisplayClass469_3) ldloc.0 -ldftn System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::b__2() +stfld Sandbox.Game.Entities.Character.<>c__DisplayClass469_0 Sandbox.Game.Entities.Character.<>c__DisplayClass469_3::CS$<>8__locals2 +ldloc.s 42 (Sandbox.Game.Entities.Character.MyCharacter+<>c__DisplayClass469_3) +ldloc.s 40 (Sandbox.Game.Weapons.MyMissile) +callvirt virtual VRage.Game.MyDefinitionBase Sandbox.Game.Weapons.MyMissile::get_AmmoDefinition() +ldflda VRage.Game.MyDefinitionId VRage.Game.MyDefinitionBase::Id +ldfld VRage.Utils.MyStringHash VRage.Game.MyDefinitionId::SubtypeId +stfld VRage.Utils.MyStringHash Sandbox.Game.Entities.Character.<>c__DisplayClass469_3::sn +ldsfld Sandbox.MySandboxGame Sandbox.MySandboxGame::Static +ldloc.s 42 (Sandbox.Game.Entities.Character.MyCharacter+<>c__DisplayClass469_3) +ldftn System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass469_3::b__4() newobj System.Void System.Action::.ctor(System.Object object, System.IntPtr method) ldstr "MyCharacter.DoDamage" ldc.i4.m1 @@ -602,10 +634,9 @@ ldc.i4.0 callvirt System.Void Sandbox.MySandboxGame::Invoke(System.Action action, System.String invokerName, System.Int32 startAtFrame, System.Int32 repeatTimes) ret L55: -L56: ldsfld Sandbox.MySandboxGame Sandbox.MySandboxGame::Static ldloc.0 -ldftn System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass463_0::b__3() +ldftn System.Void Sandbox.Game.Entities.Character.<>c__DisplayClass469_0::b__2() newobj System.Void System.Action::.ctor(System.Object object, System.IntPtr method) ldstr "MyCharacter.DoDamage" ldc.i4.m1 diff --git a/Shared/Patches/Conveyor/MyPathFindingSystemEnumeratorPatch.cs b/Shared/Patches/Conveyor/MyPathFindingSystemEnumeratorPatch.cs index 1856570..df76346 100644 --- a/Shared/Patches/Conveyor/MyPathFindingSystemEnumeratorPatch.cs +++ b/Shared/Patches/Conveyor/MyPathFindingSystemEnumeratorPatch.cs @@ -1,9 +1,10 @@ #if DEBUG +// Patching generics does not work anymore +#if DISABLED + using HarmonyLib; using Sandbox.Game.GameSystems.Conveyors; -using Shared.Config; -using Shared.Plugin; using Shared.Tools; using VRage.Algorithms; @@ -13,18 +14,13 @@ namespace Shared.Patches [HarmonyPatch(typeof(MyPathFindingSystem.Enumerator))] public static class MyPathFindingSystemEnumeratorPatch { - private static IPluginConfig Config => Common.Config; - -#if DEBUG private static readonly ConveyorStat Stat = new ConveyorStat(); public static string Report(int period) => Stat.CountReport(period); -#endif // ReSharper disable once UnusedMember.Local // ReSharper disable once InconsistentNaming [HarmonyPrefix] [HarmonyPatch(nameof(MyPathFindingSystem.Enumerator.MoveNext))] - [EnsureCode("05a0ee2c")] private static bool MoveNextPrefix( // object __instance, // ref bool __result, @@ -35,12 +31,11 @@ private static bool MoveNextPrefix( // object ___m_edgeTraversable ) { -#if DEBUG Stat.CountCall(); -#endif return true; } } } #endif +#endif diff --git a/Shared/Patches/Conveyor/MyPathFindingSystemPatch.cs b/Shared/Patches/Conveyor/MyPathFindingSystemPatch.cs index 3089697..2545e0e 100644 --- a/Shared/Patches/Conveyor/MyPathFindingSystemPatch.cs +++ b/Shared/Patches/Conveyor/MyPathFindingSystemPatch.cs @@ -1,5 +1,8 @@ #if DEBUG +// Patching generics does not work anymore +#if DISABLED + using HarmonyLib; using Sandbox.Game.GameSystems.Conveyors; using Shared.Config; @@ -15,10 +18,8 @@ public static class MyPathFindingSystemPatch { private static IPluginConfig Config => Common.Config; -#if DEBUG private static readonly ConveyorStat Stat = new ConveyorStat(); public static string Report(int period) => Stat.FullReport(period); -#endif // ReSharper disable once UnusedMember.Local // ReSharper disable once InconsistentNaming @@ -27,9 +28,7 @@ public static class MyPathFindingSystemPatch [EnsureCode("d804599b")] private static bool ReachablePrefix() { -#if DEBUG Stat.CountCall(); -#endif return true; } @@ -40,14 +39,13 @@ private static bool ReachablePrefix() [EnsureCode("d804599b")] private static void ReachablePostfix(bool __result) { -#if DEBUG if (!__result) { Stat.CountFailure(); } -#endif } } } +#endif #endif \ No newline at end of file diff --git a/Shared/Patches/MergeAndPaste/MyGroupsPatch.cs b/Shared/Patches/MergeAndPaste/MyGroupsPatch.cs index 8f3d2e7..8f05597 100644 --- a/Shared/Patches/MergeAndPaste/MyGroupsPatch.cs +++ b/Shared/Patches/MergeAndPaste/MyGroupsPatch.cs @@ -1,3 +1,6 @@ +// Disabled due to inability to patch generics (methods of MyGroups) +#if DISABLED + using System.Runtime.CompilerServices; using System.Threading; using HarmonyLib; @@ -60,4 +63,6 @@ private static void BreakLinkPostfix() BreakLinkCallDepth.Value--; } } -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/Shared/Patches/MergeAndPaste/MyResourceDistributorComponentPatch.cs b/Shared/Patches/MergeAndPaste/MyResourceDistributorComponentPatch.cs index 11f29c0..fe3087a 100644 --- a/Shared/Patches/MergeAndPaste/MyResourceDistributorComponentPatch.cs +++ b/Shared/Patches/MergeAndPaste/MyResourceDistributorComponentPatch.cs @@ -1,3 +1,6 @@ +// Disabled due to inability to patch generics (methods of MyGroups) +#if DISABLED + using HarmonyLib; using Sandbox.Game.EntityComponents; using Shared.Config; @@ -29,4 +32,6 @@ private static bool UpdateBeforeSimulation(MyResourceDistributorComponent __inst return false; } } -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/Shared/Patches/PatchHelpers.cs b/Shared/Patches/PatchHelpers.cs index 1d85cda..3bff9fd 100644 --- a/Shared/Patches/PatchHelpers.cs +++ b/Shared/Patches/PatchHelpers.cs @@ -107,8 +107,8 @@ public static void PatchUpdates() log.Info($"- MySafeZonePatch IsActionAllowed: {MySafeZonePatch.IsActionAllowedCacheReport}"); log.Info($"- MySessionComponentSafeZonesPatch: {MySessionComponentSafeZonesPatch.CacheReport}"); log.Info($"- MyWindTurbinePatch: {MyWindTurbinePatch.CacheReport}"); - log.Info($"- MyPathFindingSystemPatch: {MyPathFindingSystemPatch.Report(period)}"); - log.Info($"- MyPathFindingSystemEnumeratorPatch: {MyPathFindingSystemEnumeratorPatch.Report(period)}"); + // log.Info($"- MyPathFindingSystemPatch: {MyPathFindingSystemPatch.Report(period)}"); + // log.Info($"- MyPathFindingSystemEnumeratorPatch: {MyPathFindingSystemEnumeratorPatch.Report(period)}"); log.Info($"- MyGridConveyorSystemPatch: {MyGridConveyorSystemPatch.PullItemReports}"); foreach (var report in MyGridConveyorSystemPatch.CacheReports) { diff --git a/Tests/App.config b/Tests/App.config new file mode 100644 index 0000000..8727690 --- /dev/null +++ b/Tests/App.config @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index 50dace7..6c6a96c 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -34,12 +34,12 @@ 4 + + ..\packages\Lib.Harmony.2.3.3\lib\net48\0Harmony.dll + ..\packages\NUnit.3.5.0\lib\net45\nunit.framework.dll - - ..\packages\Lib.Harmony.2.2.2\lib\net48\0Harmony.dll - ..\Bin64\DirectShowLib.dll @@ -501,6 +501,10 @@ + + + + @@ -197,8 +199,7 @@ - - + diff --git a/TorchPlugin/Plugin.cs b/TorchPlugin/Plugin.cs index 3f88120..6a7c2d7 100644 --- a/TorchPlugin/Plugin.cs +++ b/TorchPlugin/Plugin.cs @@ -86,7 +86,7 @@ public override void Init(ITorchBase torch) } #endif - sessionManager = torch.Managers.GetManager(); + sessionManager = (TorchSessionManager) torch.Managers.GetManager(typeof(TorchSessionManager)); sessionManager.SessionStateChanged += SessionStateChanged; initialized = true; diff --git a/TorchPlugin/PluginConfig.cs b/TorchPlugin/PluginConfig.cs index f3f1a05..d770dd5 100644 --- a/TorchPlugin/PluginConfig.cs +++ b/TorchPlugin/PluginConfig.cs @@ -78,7 +78,8 @@ public bool FixGarbageCollection set => SetValue(ref fixGarbageCollection, value); } - [Display(Order = 7, GroupName = "Fixes", Name = "Fix grid groups", Description = "Disable resource updates while grids are being moved between groups")] + // Disabled due to inability to patch generics (methods of MyGroups) + [Display(Order = 7, GroupName = "Fixes", Name = "Fix grid groups", Description = "Disable resource updates while grids are being moved between groups", Enabled = false)] public bool FixGridGroups { get => fixGridGroups; diff --git a/TorchPlugin/Properties/AssemblyInfo.cs b/TorchPlugin/Properties/AssemblyInfo.cs index a5bb7d2..a8f0179 100644 --- a/TorchPlugin/Properties/AssemblyInfo.cs +++ b/TorchPlugin/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.11.7.0")] -[assembly: AssemblyFileVersion("1.11.7.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.11.8.0")] +[assembly: AssemblyFileVersion("1.11.8.0")] \ No newline at end of file diff --git a/TorchPlugin/TorchPlugin.csproj b/TorchPlugin/TorchPlugin.csproj index 15124cf..fd36eee 100644 --- a/TorchPlugin/TorchPlugin.csproj +++ b/TorchPlugin/TorchPlugin.csproj @@ -33,8 +33,8 @@ 4 - - ..\packages\Lib.Harmony.2.2.2\lib\net48\0Harmony.dll + + ..\packages\Lib.Harmony.2.3.3\lib\net48\0Harmony.dll ..\Torch\ControlzEx.dll diff --git a/TorchPlugin/manifest.xml b/TorchPlugin/manifest.xml index 5d82716..7671e14 100644 --- a/TorchPlugin/manifest.xml +++ b/TorchPlugin/manifest.xml @@ -3,5 +3,5 @@ PerformanceImprovements c2cf3ed2-c6ac-4dbd-ab9a-613a1ef67784 PerformanceImprovements - v1.11.7.0 + v1.11.8.0 \ No newline at end of file diff --git a/TorchPlugin/packages.config b/TorchPlugin/packages.config index f89be6e..90ca77a 100644 --- a/TorchPlugin/packages.config +++ b/TorchPlugin/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file