diff --git a/Modules/DebugMenu.cs b/Modules/DebugMenu.cs index 5f1d49a..547edb7 100644 --- a/Modules/DebugMenu.cs +++ b/Modules/DebugMenu.cs @@ -228,7 +228,7 @@ public class DebugMenu : MonoBehaviour public void Toggle() { - if (!GameStates.IsDev) return; + if (!GameStates.IsDev || Main.ReleaseBuildType != ReleaseTypes.Dev) return; WindowEnabled = !WindowEnabled; } diff --git a/Modules/ExtendedPlayerControl.cs b/Modules/ExtendedPlayerControl.cs index 344dac1..57203cd 100644 --- a/Modules/ExtendedPlayerControl.cs +++ b/Modules/ExtendedPlayerControl.cs @@ -142,7 +142,7 @@ static class ExtendedPlayerControl public static Vector2 GetCustomPosition(this PlayerControl player) => new(player.transform.position.x, player.transform.position.y); // Check if player is a dev - public static bool IsDev(this PlayerControl player) => player != null && Main.DevUser.Contains(Utils.GetHashPuid(player)); + public static bool IsDev(this PlayerControl player) => player != null && Main.DevUser.Contains($"{Utils.GetHashPuid(player)}+{player.Data.FriendCode}"); // Check if player is alive public static bool IsAlive(this PlayerControl player) => player?.Data != null && !player.Data.IsDead; // Check if player is in a vent diff --git a/Modules/GameState.cs b/Modules/GameState.cs index e2532e9..6baa41c 100644 --- a/Modules/GameState.cs +++ b/Modules/GameState.cs @@ -8,7 +8,7 @@ namespace BetterAmongUs; public static class GameStates { /**********Check Game Status***********/ - public static bool IsDev => EOSManager.Instance?.userId != null && Main.DevUser.Contains(Utils.GetHashPuid(EOSManager.Instance.userId.ToString())); + public static bool IsDev => EOSManager.Instance?.userId != null && Main.DevUser.Contains($"{Utils.GetHashPuid(EOSManager.Instance.userId.ToString())}+{EOSManager.Instance.friendCode}"); public static bool InGame => Main.AllPlayerControls.Any(); public static bool IsNormalGame => GameOptionsManager.Instance.CurrentGameOptions.GameMode is GameModes.Normal or GameModes.NormalFools; public static bool IsHideNSeek => GameOptionsManager.Instance.CurrentGameOptions.GameMode is GameModes.HideNSeek or GameModes.SeekFools; diff --git a/Patches/CommandsPatch.cs b/Patches/CommandsPatch.cs index 28defe9..15dfe78 100644 --- a/Patches/CommandsPatch.cs +++ b/Patches/CommandsPatch.cs @@ -266,7 +266,7 @@ class CommandsPatch } break; default: - if (GameStates.IsDev) + if (GameStates.IsDev && Main.ReleaseBuildType == ReleaseTypes.Dev) { checkDebugCommand = true; break; @@ -633,7 +633,7 @@ class CommandsPatch { var closestCommand = CommandListHelper.FirstOrDefault(c => c.StartsWith(typedCommand, StringComparison.OrdinalIgnoreCase)); - if (closestCommand == null && PlayerControl.LocalPlayer.IsDev()) + if (closestCommand == null && GameStates.IsDev && Main.ReleaseBuildType == ReleaseTypes.Dev) closestCommand = DebugCommandListHelper.FirstOrDefault(c => c.StartsWith(typedCommand, StringComparison.OrdinalIgnoreCase)); return closestCommand ?? string.Empty; diff --git a/Patches/PlayerJoinAndLeftPatch.cs b/Patches/PlayerJoinAndLeftPatch.cs index 5088832..40bd8e2 100644 --- a/Patches/PlayerJoinAndLeftPatch.cs +++ b/Patches/PlayerJoinAndLeftPatch.cs @@ -33,6 +33,7 @@ class OnGameJoinedPatch MessageWriter messageWriter = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.BetterCheck, SendOption.None, -1); messageWriter.Write((byte)PlayerControl.LocalPlayer.NetId); messageWriter.Write(flag); + messageWriter.Write(Main.GetVersionText().Replace(" ", "")); AmongUsClient.Instance.FinishRpcImmediately(messageWriter); } }, 1.5f, "OnGameJoinedPatch");