diff --git a/Changelogs/Github/v0.3.3.MD b/Changelogs/Github/v0.3.3.MD new file mode 100644 index 0000000..faae933 --- /dev/null +++ b/Changelogs/Github/v0.3.3.MD @@ -0,0 +1,3 @@ +# Release Notes v0.3.3 + +- *Hopefully* Fixed for PlateUp! 1.3.0 \ No newline at end of file diff --git a/Changelogs/Workshop/v0.3.3.MD b/Changelogs/Workshop/v0.3.3.MD new file mode 100644 index 0000000..7c5f512 --- /dev/null +++ b/Changelogs/Workshop/v0.3.3.MD @@ -0,0 +1,3 @@ +[h1]Release Notes v0.3.3[/h1] + +- *Hopefully* Fixed for PlateUp! 1.3.0 \ No newline at end of file diff --git a/Mod.cs b/Mod.cs index 57d1248..23a396a 100644 --- a/Mod.cs +++ b/Mod.cs @@ -13,7 +13,7 @@ namespace MMOKitchen { public const string MOD_GUID = "com.starfluxgames.mmokitchen"; public const string MOD_NAME = "MMO Kitchen"; - public const string MOD_VERSION = "0.3.2"; + public const string MOD_VERSION = "0.3.3"; public const string MOD_AUTHOR = "StarFluxGames"; public const string MOD_GAMEVERSION = ">=1.2.0"; diff --git a/Patches/SteamPlatformPatch.cs b/Patches/SteamPlatformPatch.cs index bf8c707..ebbcfc1 100644 --- a/Patches/SteamPlatformPatch.cs +++ b/Patches/SteamPlatformPatch.cs @@ -1,30 +1,44 @@ using HarmonyLib; -using Kitchen.NetworkSupport; using System; using System.Collections.Generic; using System.Reflection; using System.Reflection.Emit; +using UnityEngine; +using SteamNetworkService = Kitchen.NetworkSupport.SteamNetworkService; namespace MMOKitchen.Patches { /* * This patch is used to change how many players can join the lobby using Steam. */ - [HarmonyPatch(typeof(SteamPlatform))] + [HarmonyPatch(typeof(SteamNetworkService))] public class SteamPlatformPatch - { + { private static MethodBase TargetMethod() { - Type type = AccessTools.FirstInner(typeof(SteamPlatform), t => t.Name.Contains("d__26")); + Type type = AccessTools.FirstInner(typeof(SteamNetworkService), t => t.Name.Contains("d__31")); return AccessTools.FirstMethod(type, method => method.Name.Contains("MoveNext")); } + [HarmonyTranspiler] private static IEnumerable Transpiler(IEnumerable instructions) { CodeMatcher matcher = new(instructions); - - matcher.MatchForward(false, new CodeMatch(OpCodes.Ldc_I4_2), new CodeMatch(OpCodes.Bne_Un), new CodeMatch(OpCodes.Ldc_I4_4)) - .Advance(2) + + foreach (var instruction in matcher.InstructionEnumeration()) + { + if (instruction.operand != null) + { + Debug.Log($"{instruction.opcode} : {instruction.operand}"); + } + else + { + Debug.Log($"{instruction.opcode}"); + } + + } + + matcher.MatchForward(false, new CodeMatch(OpCodes.Ldc_I4_4), new CodeMatch(OpCodes.Call), new CodeMatch(OpCodes.Callvirt), new CodeMatch(OpCodes.Stloc_S), new CodeMatch(OpCodes.Ldloca_S), new CodeMatch(OpCodes.Call), new CodeMatch(OpCodes.Brtrue)) .Set(OpCodes.Ldc_I4, Mod.MaxPlayers); return matcher.InstructionEnumeration();