This commit is contained in:
Lachlan Leone
2024-10-09 16:41:33 +11:00
parent 9f4ef51d41
commit 4259b35697
10 changed files with 177 additions and 4 deletions
+23
View File
@@ -0,0 +1,23 @@
using System.Collections.Generic;
using System.Reflection.Emit;
using HarmonyLib;
using Kitchen;
namespace MMOKitchen.Patches
{
[HarmonyPatch(typeof(Session), "GetInvite")]
public class SessionPatch
{
[HarmonyTranspiler]
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
CodeMatcher matcher = new(instructions);
matcher.MatchForward(false, new CodeMatch(OpCodes.Ldloca_S), new CodeMatch(OpCodes.Ldc_I4_3), new CodeMatch(OpCodes.Ldc_I4_4))
.Advance(2)
.Set(OpCodes.Ldc_I4, Mod.MaxPlayers);
return matcher.InstructionEnumeration();
}
}
}