Files
se-launcher/CringeLauncher/Patches/EosInitPatch.cs
pas2704 530e05875f
All checks were successful
Build / Compute Version (push) Successful in 6s
Build / Build Nuget package (CringeBootstrap.Abstractions) (push) Successful in 3m57s
Build / Build Nuget package (NuGet) (push) Successful in 3m21s
Build / Build Nuget package (CringePlugins) (push) Successful in 4m8s
Build / Build Nuget package (SharedCringe) (push) Successful in 2m57s
Build / Build Launcher (push) Successful in 5m39s
minor cleanup
2024-11-24 02:28:57 -05:00

30 lines
889 B
C#

using System.Reflection;
using System.Reflection.Emit;
using HarmonyLib;
namespace CringeLauncher.Patches;
// eos is disabled
// [HarmonyPatch]
public static class EosInitPatch
{
private static MethodInfo TargetMethod() =>
AccessTools.Method(Type.GetType("VRage.EOS.MyEOSNetworking, VRage.EOS", true), "Init");
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
var ins = instructions.ToList();
var stIndex = ins.FindIndex(b => b.opcode == OpCodes.Stloc_1);
ins.InsertRange(stIndex, new []
{
new CodeInstruction(OpCodes.Dup),
new(OpCodes.Ldc_I4_2), // PlatformFlags.DisableOverlay
new(OpCodes.Conv_I8),
CodeInstruction.Call("Epic.OnlineServices.Platform.Options:set_Flags"),
});
return ins;
}
}