From 3229475361be30ad41cf7b365b8e6d8f039bc906 Mon Sep 17 00:00:00 2001 From: XtraCube <72575280+XtraCube@users.noreply.github.com> Date: Wed, 21 May 2025 15:23:14 -0400 Subject: [PATCH] Fix bug (bad code) in SpawnGameDataMessage patch --- Reactor.Benchmarks/packages.lock.json | 2 +- Reactor.Debugger/packages.lock.json | 2 +- Reactor.Example/packages.lock.json | 2 +- Reactor/Networking/Patches/ClientPatches.cs | 10 +++------- Reactor/packages.lock.json | 2 +- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Reactor.Benchmarks/packages.lock.json b/Reactor.Benchmarks/packages.lock.json index 326ed14..7bd651f 100644 --- a/Reactor.Benchmarks/packages.lock.json +++ b/Reactor.Benchmarks/packages.lock.json @@ -1143,4 +1143,4 @@ } } } -} +} \ No newline at end of file diff --git a/Reactor.Debugger/packages.lock.json b/Reactor.Debugger/packages.lock.json index abf00a0..ecb081e 100644 --- a/Reactor.Debugger/packages.lock.json +++ b/Reactor.Debugger/packages.lock.json @@ -908,4 +908,4 @@ } } } -} +} \ No newline at end of file diff --git a/Reactor.Example/packages.lock.json b/Reactor.Example/packages.lock.json index abf00a0..ecb081e 100644 --- a/Reactor.Example/packages.lock.json +++ b/Reactor.Example/packages.lock.json @@ -908,4 +908,4 @@ } } } -} +} \ No newline at end of file diff --git a/Reactor/Networking/Patches/ClientPatches.cs b/Reactor/Networking/Patches/ClientPatches.cs index 6b83e14..333c440 100644 --- a/Reactor/Networking/Patches/ClientPatches.cs +++ b/Reactor/Networking/Patches/ClientPatches.cs @@ -238,13 +238,13 @@ internal static class ClientPatches } [HarmonyPatch(typeof(SpawnGameDataMessage), nameof(SpawnGameDataMessage.SerializeValues))] - public static class WriteSpawnMessagePatch + public static class SpawnGameDataMessagePatch { - public static bool Prefix(SpawnGameDataMessage __instance, MessageWriter msg) + public static void Postfix(SpawnGameDataMessage __instance, MessageWriter msg) { if (ReactorConnection.Instance!.Syncer != Syncer.Host) { - return true; + return; } // PATCH - Inject ReactorHandshakeS2C @@ -254,10 +254,6 @@ internal static class ClientPatches ReactorHeader.Write(msg); ModdedHandshakeS2C.Serialize(msg, "Among Us", Application.version, 0); // TODO } - - msg.EndMessage(); - - return false; } } diff --git a/Reactor/packages.lock.json b/Reactor/packages.lock.json index 3aae1c6..9200e86 100644 --- a/Reactor/packages.lock.json +++ b/Reactor/packages.lock.json @@ -902,4 +902,4 @@ } } } -} +} \ No newline at end of file