From a3c59b1adb6cd4e3ccd600e46370c5086a73f2de Mon Sep 17 00:00:00 2001 From: js6pak Date: Fri, 22 Jan 2021 10:41:14 +0100 Subject: [PATCH] Update mappings --- AmongUs.props | 15 ++++++++++++--- Reactor.sln | 2 -- Reactor/Patches/ModdedHandshakePatches.cs | 8 ++++---- Reactor/Patches/SteamPatch.cs | 2 ++ build/Program.cs | 1 + 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/AmongUs.props b/AmongUs.props index 926417c..5c84ddf 100644 --- a/AmongUs.props +++ b/AmongUs.props @@ -1,11 +1,20 @@ - + 2020.12.9s - NuclearPowered/Mappings:0.1.0-alpha.2 + $(DefineConstants);STEAM + + + + 2020.11.17i + $(DefineConstants);ITCH + + + + NuclearPowered/Mappings:0.1.0 - + diff --git a/Reactor.sln b/Reactor.sln index 02763bb..3cada7a 100644 --- a/Reactor.sln +++ b/Reactor.sln @@ -24,9 +24,7 @@ Global {68589B4D-9EF5-40DD-8D6D-10977ED07259}.Release|Any CPU.ActiveCfg = Release|Any CPU {68589B4D-9EF5-40DD-8D6D-10977ED07259}.Release|Any CPU.Build.0 = Release|Any CPU {58AC4924-AC3D-45EA-80D7-E9F860FD1DD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {58AC4924-AC3D-45EA-80D7-E9F860FD1DD2}.Debug|Any CPU.Build.0 = Debug|Any CPU {58AC4924-AC3D-45EA-80D7-E9F860FD1DD2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {58AC4924-AC3D-45EA-80D7-E9F860FD1DD2}.Release|Any CPU.Build.0 = Release|Any CPU {26A83466-26FE-4383-A35C-B8629902F909}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {26A83466-26FE-4383-A35C-B8629902F909}.Debug|Any CPU.Build.0 = Debug|Any CPU {26A83466-26FE-4383-A35C-B8629902F909}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/Reactor/Patches/ModdedHandshakePatches.cs b/Reactor/Patches/ModdedHandshakePatches.cs index 1429b36..b90430d 100644 --- a/Reactor/Patches/ModdedHandshakePatches.cs +++ b/Reactor/Patches/ModdedHandshakePatches.cs @@ -49,7 +49,7 @@ namespace Reactor.Patches { var serverBrand = reader.ReadString(); - __instance.Field_23.State = ConnectionState.Connected; + __instance.connection.State = ConnectionState.Connected; PluginSingleton.Instance.Log.LogDebug($"Connected to modded server ({serverBrand})"); @@ -65,7 +65,7 @@ namespace Reactor.Patches { public static void Prefix(UdpConnection __instance, byte sendOption, ref Il2CppSystem.Action ackCallback) { - if (sendOption != 8 || AmongUsClient.Instance == null || AmongUsClient.Instance.Field_23 == null || !AmongUsClient.Instance.Field_23.Equals(__instance)) + if (sendOption != 8 || AmongUsClient.Instance == null || AmongUsClient.Instance.connection == null || !AmongUsClient.Instance.connection.Equals(__instance)) { return; } @@ -95,7 +95,7 @@ namespace Reactor.Patches var client = AmongUsClient.Instance; - if (client != null && client.Field_23 != null && client.Field_23.State == ConnectionState.Connecting) + if (client != null && client.connection != null && client.connection.State == ConnectionState.Connecting) { client.LastDisconnectReason = DisconnectReasons.Custom; client.LastCustomDisconnect = "Server didn't respond to modded handshake"; @@ -112,7 +112,7 @@ namespace Reactor.Patches ModdedHandshakeC2S.Serialize( handshake, - Constants.GetBroadcastVersion(), + Constants.GetBroadcastVersionBytes(), SaveManager.PlayerName, ModList.GetCurrent() ); diff --git a/Reactor/Patches/SteamPatch.cs b/Reactor/Patches/SteamPatch.cs index 1c4532b..133ff7f 100644 --- a/Reactor/Patches/SteamPatch.cs +++ b/Reactor/Patches/SteamPatch.cs @@ -1,3 +1,4 @@ +#if STEAM using System.IO; using HarmonyLib; using Steamworks; @@ -23,3 +24,4 @@ namespace Reactor.Patches } } } +#endif diff --git a/build/Program.cs b/build/Program.cs index 4af3563..b4548e7 100644 --- a/build/Program.cs +++ b/build/Program.cs @@ -122,6 +122,7 @@ public sealed class BuildTask : FrostingTask Configuration = "Release", EnvironmentVariables = { + ["GamePlatform"] = "Steam", ["AmongUs"] = Path.GetFullPath(context.AmongUsPath) } });