get net7 working

This commit is contained in:
zznty
2022-11-20 23:02:20 +07:00
parent d4f4f95769
commit d58c3c74f8
5 changed files with 3 additions and 21 deletions

View File

@@ -11,7 +11,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="HarmonyX" Version="2.10.1-prerelease" />
<PackageReference Include="HarmonyX" Version="2.10.2-prerelease" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" />
<PackageReference Include="NLog" Version="5.0.5" />
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.201.13" IncludeAssets="compile" PrivateAssets="all" />

View File

@@ -1,13 +0,0 @@
using HarmonyLib;
using Sandbox.Game.World;
namespace CringeLauncher.Patches;
[HarmonyPatch(typeof(MySession), "RegisterComponentsFromAssemblies")]
public static class HarmonyAssemblyFuckery
{
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
return new[] { CodeInstruction.CallClosure(() => typeof(MySession).Assembly) }.Concat(instructions.Skip(1));
}
}

View File

@@ -1,16 +1,11 @@
using System.Diagnostics;
using System.Runtime.CompilerServices;
using CringeLauncher;
using VRage.Serialization;
#if DEBUG
while (!Debugger.IsAttached)
Thread.Sleep(100);
#endif
// harmony is fun
RuntimeHelpers.RunClassConstructor(typeof(MyFactory).TypeHandle);
using var launcher = new Launcher();
launcher.Initialize(args);

View File

@@ -62,7 +62,7 @@ public class Main : IHandleInputPlugin
Splash.SetText("Patching...");
LogFile.WriteLine("Patching");
new Harmony("avaness.PluginLoader").PatchAll(typeof(Main).Assembly);
new Harmony("avaness.PluginLoader").PatchAll(Assembly.GetExecutingAssembly());
Splash.SetText("Instantiating plugins...");
LogFile.WriteLine("Instantiating plugins");

View File

@@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="HarmonyX" Version="2.10.1-prerelease" />
<PackageReference Include="HarmonyX" Version="2.10.2-prerelease" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0" IncludeAssets="compile" PrivateAssets="all" />
<PackageReference Include="SpaceEngineersDedicated.ReferenceAssemblies" Version="1.201.13" IncludeAssets="compile" PrivateAssets="all" />
<PackageReference Include="Steamworks.NET" Version="15.0.1" IncludeAssets="compile" PrivateAssets="all" />