Files
MMOKitchen/MMOKitchen/Patches/DiscordPlatform_Patch.cs
T
Lachlan Leone cc0ced82f9 v0.1.7
2023-03-13 18:31:52 +11:00

26 lines
658 B
C#

using HarmonyLib;
using Kitchen.NetworkSupport;
using System.Collections.Generic;
using System.Reflection.Emit;
namespace MMOKitchenReborn.Patches
{
/*
* This patch is used to change how many players can join the lobby using Discord.
*/
[HarmonyPatch(typeof(DiscordPlatform), "CreateNewLobby")]
public static class DiscordPlatform_Patch
{
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
var codes = new List<CodeInstruction>(instructions);
for (var i = 0; i < codes.Count; i++)
if (codes[i].opcode == OpCodes.Ldc_I4_4)
codes[i].opcode = OpCodes.Ldc_I4_8;
return codes;
}
}
}