From 133d4907b804fa111da6fe558aa5422fa2ac8b76 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sat, 17 Aug 2024 12:44:18 -0500 Subject: [PATCH 01/18] UseBannedPlayerAndName option --- Patches/ClientOptionsPatch.cs | 6 +++ Patches/PlayerJoinAndLeftPatch.cs | 71 ++++++++++++++++--------------- main.cs | 6 ++- 3 files changed, 47 insertions(+), 36 deletions(-) diff --git a/Patches/ClientOptionsPatch.cs b/Patches/ClientOptionsPatch.cs index 5702c0f..56ce3ba 100644 --- a/Patches/ClientOptionsPatch.cs +++ b/Patches/ClientOptionsPatch.cs @@ -12,6 +12,7 @@ public static class OptionsMenuBehaviourPatch private static ClientOptionItem BetterHost; private static ClientOptionItem BetterRoleAlgorithma; private static ClientOptionItem BetterNotifications; + private static ClientOptionItem UseBannedPlayerAndName; private static ClientOptionItem LobbyPlayerInfo; private static ClientOptionItem DisableLobbyTheme; private static ClientOptionItem UnlockFPS; @@ -73,6 +74,11 @@ public static class OptionsMenuBehaviourPatch BetterNotificationManager.Notifying = false; } } + + if (UseBannedPlayerAndName == null || UseBannedPlayerAndName.ToggleButton == null) + { + UseBannedPlayerAndName = ClientOptionItem.Create("Use Banned Player & Name List", Main.UseBannedPlayerAndName, __instance); + } if (LobbyPlayerInfo == null || LobbyPlayerInfo.ToggleButton == null) { diff --git a/Patches/PlayerJoinAndLeftPatch.cs b/Patches/PlayerJoinAndLeftPatch.cs index 6fa34fa..e322bd8 100644 --- a/Patches/PlayerJoinAndLeftPatch.cs +++ b/Patches/PlayerJoinAndLeftPatch.cs @@ -50,45 +50,48 @@ public static class OnPlayerJoinedPatch client.Character.RpcSendHostChat(HudManagerPatch.WelcomeMessage, sendToBetterUser: false); // Auto ban player on ban list - var player = Utils.PlayerFromClientId(client.Id); - if (player != null) + if (Main.UseBannedPlayerAndName.Value) { - string banPlayerListContent = File.ReadAllText(BetterDataManager.banPlayerListFile); - - string[] listPlayerArray = banPlayerListContent.Split(new[] { Environment.NewLine }, StringSplitOptions.None); - - foreach (string text in listPlayerArray) + var player = Utils.PlayerFromClientId(client.Id); + if (player != null) { - if (!string.IsNullOrEmpty(player.Data.FriendCode) && text.Contains(player.Data.FriendCode) - || !string.IsNullOrEmpty(Utils.GetHashPuid(player)) && text.Contains(Utils.GetHashPuid(player))) + string banPlayerListContent = File.ReadAllText(BetterDataManager.banPlayerListFile); + + string[] listPlayerArray = banPlayerListContent.Split(new[] { Environment.NewLine }, StringSplitOptions.None); + + foreach (string text in listPlayerArray) { - player.Kick(true, $"{player.Data.PlayerName} has been banned due to being on the ban player list!"); - break; + if (!string.IsNullOrEmpty(player.Data.FriendCode) && text.Contains(player.Data.FriendCode) + || !string.IsNullOrEmpty(Utils.GetHashPuid(player)) && text.Contains(Utils.GetHashPuid(player))) + { + player.Kick(true, $"{player.Data.PlayerName} has been banned due to being on the ban player list!"); + break; + } } + + // Normalize and remove spaces and special characters from names + Func normalizeName = name => new string(name.Where(c => char.IsLetterOrDigit(c)).ToArray()).ToLower(); + + // Read all banned names into a HashSet with normalized names + HashSet bannedNames = new HashSet( + File.ReadLines(BetterDataManager.banNameListFile) + .Select(normalizeName) + .Where(name => !string.IsNullOrWhiteSpace(name)) + ); + + string normalizedPlayerName = normalizeName(player.Data.PlayerName); + + // Check if any banned name is a prefix of the player's normalized name + bool isNameBanned = bannedNames.Any(bannedName => + normalizedPlayerName.StartsWith(bannedName) + ); + + if (!string.IsNullOrEmpty(normalizedPlayerName) && isNameBanned) + { + player.Kick(false, $"{player.Data.PlayerName} has been kicked due to their name being on the ban name list!"); + } + } - - // Normalize and remove spaces and special characters from names - Func normalizeName = name => new string(name.Where(c => char.IsLetterOrDigit(c)).ToArray()).ToLower(); - - // Read all banned names into a HashSet with normalized names - HashSet bannedNames = new HashSet( - File.ReadLines(BetterDataManager.banNameListFile) - .Select(normalizeName) - .Where(name => !string.IsNullOrWhiteSpace(name)) - ); - - string normalizedPlayerName = normalizeName(player.Data.PlayerName); - - // Check if any banned name is a prefix of the player's normalized name - bool isNameBanned = bannedNames.Any(bannedName => - normalizedPlayerName.StartsWith(bannedName) - ); - - if (!string.IsNullOrEmpty(normalizedPlayerName) && isNameBanned) - { - player.Kick(false, $"{player.Data.PlayerName} has been kicked due to their name being on the ban name list!"); - } - } } }, 2.5f, "OnPlayerJoinedPatch", false); diff --git a/main.cs b/main.cs index 559573c..8591be4 100644 --- a/main.cs +++ b/main.cs @@ -27,8 +27,8 @@ public class Main : BasePlugin public const string HotfixNum = "0"; public const bool IsHotFix = false; public const string PluginGuid = "com.d1gq.betteramongus"; - public const string PluginVersion = "1.0.2"; - public const string ReleaseDate = "08.16.2024"; // mm/dd/yyyy + public const string PluginVersion = "1.0.3"; + public const string ReleaseDate = "08.17.2024"; // mm/dd/yyyy public const string Github = "https://github.com/D1GQ/BetterAmongUs-Public"; public const string Discord = "https://discord.gg/vjYrXpzNAn"; @@ -161,6 +161,7 @@ public class Main : BasePlugin public static ConfigEntry BetterHost { get; private set; } public static ConfigEntry BetterRoleAlgorithma { get; private set; } public static ConfigEntry BetterNotifications { get; private set; } + public static ConfigEntry UseBannedPlayerAndName { get; private set; } public static ConfigEntry LobbyPlayerInfo { get; private set; } public static ConfigEntry DisableLobbyTheme { get; private set; } public static ConfigEntry UnlockFPS { get; private set; } @@ -172,6 +173,7 @@ public class Main : BasePlugin BetterHost = Config.Bind("Better Options", "BetterHost", false); BetterRoleAlgorithma = Config.Bind("Better Options", "BetterRoleAlgorithma", true); BetterNotifications = Config.Bind("Better Options", "BetterNotifications", true); + UseBannedPlayerAndName = Config.Bind("Better Options", "UseBannedPlayerAndName", true); LobbyPlayerInfo = Config.Bind("Better Options", "LobbyPlayerInfo", true); DisableLobbyTheme = Config.Bind("Better Options", "DisableLobbyTheme", true); UnlockFPS = Config.Bind("Better Options", "UnlockFPS", false); From 871e55e9eb40c306526cd6ad9b33f0b3462f8ecd Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sat, 17 Aug 2024 12:46:08 -0500 Subject: [PATCH 02/18] fix text --- Patches/ClientOptionsPatch.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Patches/ClientOptionsPatch.cs b/Patches/ClientOptionsPatch.cs index 56ce3ba..610dfc3 100644 --- a/Patches/ClientOptionsPatch.cs +++ b/Patches/ClientOptionsPatch.cs @@ -77,7 +77,7 @@ public static class OptionsMenuBehaviourPatch if (UseBannedPlayerAndName == null || UseBannedPlayerAndName.ToggleButton == null) { - UseBannedPlayerAndName = ClientOptionItem.Create("Use Banned Player & Name List", Main.UseBannedPlayerAndName, __instance); + UseBannedPlayerAndName = ClientOptionItem.Create("Banned Player & Name List", Main.UseBannedPlayerAndName, __instance); } if (LobbyPlayerInfo == null || LobbyPlayerInfo.ToggleButton == null) From e67a5798ad65883a4d852680e5c34a8cb4591a19 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sat, 17 Aug 2024 20:52:22 -0500 Subject: [PATCH 03/18] Fixed vent task detected as false sabotage --- Modules/AntiCheat.cs | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/Modules/AntiCheat.cs b/Modules/AntiCheat.cs index 1e3a563..6009d97 100644 --- a/Modules/AntiCheat.cs +++ b/Modules/AntiCheat.cs @@ -314,22 +314,25 @@ class AntiCheat // Check game states when sabotaging public static bool RpcUpdateSystemCheck(PlayerControl player, SystemTypes systemType, byte amount) { - if (!player.IsImpostorTeam() || !GameStates.IsSystemActive(systemType) && GameStates.IsAnySabotageActive() || Utils.SystemTypeIsSabotage(systemType) - || ShipStatus.Instance.AllDoors.ToArray().Any(door => !door.IsOpen)) + if (Utils.SystemTypeIsSabotage(systemType)) { - BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName(systemType)}"); - Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName(systemType)} Start Sabotage: {!player.IsImpostorTeam()} || {!GameStates.IsSystemActive(systemType)}" + - $"&& {GameStates.IsAnySabotageActive()} || {Utils.SystemTypeIsSabotage(systemType)} || {ShipStatus.Instance.AllDoors.ToArray().Any(door => !door.IsOpen)}"); - return false; - } - - // Fix Sabo - if (amount == 16) - { - if (!GameStates.IsSystemActive(systemType)) + if (!player.IsImpostorTeam() || !GameStates.IsSystemActive(systemType) && GameStates.IsAnySabotageActive() + || ShipStatus.Instance.AllDoors.ToArray().Any(door => !door.IsOpen)) { BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName(systemType)}"); - Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName(systemType)} Fix Sabotage: {!GameStates.IsSystemActive(systemType)}"); + Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName(systemType)} Start Sabotage: {!player.IsImpostorTeam()} || {!GameStates.IsSystemActive(systemType)} " + + $"&& {GameStates.IsAnySabotageActive()} || {ShipStatus.Instance.AllDoors.ToArray().Any(door => !door.IsOpen)}"); + return false; + } + + // Fix Sabo + if (amount == 16) + { + if (!GameStates.IsSystemActive(systemType)) + { + BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName(systemType)}"); + Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName(systemType)} Fix Sabotage: {!GameStates.IsSystemActive(systemType)}"); + } } } From 6198d4491a6ea81f8699a465ea0850db3514bc15 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sat, 17 Aug 2024 21:12:10 -0500 Subject: [PATCH 04/18] hot fix --- Modules/AntiCheat.cs | 3 +++ Patches/PlayerControlPatch.cs | 4 ++++ Patches/RoleManagerPatch.cs | 3 --- main.cs | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Modules/AntiCheat.cs b/Modules/AntiCheat.cs index 6009d97..1bc34a8 100644 --- a/Modules/AntiCheat.cs +++ b/Modules/AntiCheat.cs @@ -314,6 +314,9 @@ class AntiCheat // Check game states when sabotaging public static bool RpcUpdateSystemCheck(PlayerControl player, SystemTypes systemType, byte amount) { + if (PlayerControl.LocalPlayer == null || player == null || player == PlayerControl.LocalPlayer || player.BetterData().IsBetterHost || !IsEnabled || !Main.AntiCheat.Value + || GameStates.IsBetterHostLobby && !GameStates.IsHost) return true; + if (Utils.SystemTypeIsSabotage(systemType)) { if (!player.IsImpostorTeam() || !GameStates.IsSystemActive(systemType) && GameStates.IsAnySabotageActive() diff --git a/Patches/PlayerControlPatch.cs b/Patches/PlayerControlPatch.cs index 8085820..370c046 100644 --- a/Patches/PlayerControlPatch.cs +++ b/Patches/PlayerControlPatch.cs @@ -1,4 +1,5 @@ using AmongUs.Data; +using AmongUs.GameOptions; using HarmonyLib; using Il2CppSystem.Linq; using LibCpp2IL; @@ -79,6 +80,9 @@ class PlayerControlPatch else { __instance.BetterData().TimeSinceLastTask += Time.deltaTime; + + if (__instance.IsAlive() || __instance.Data.RoleType == RoleTypes.GuardianAngel) + __instance.BetterData().RoleInfo.DeadDisplayRole = __instance.Data.RoleType; } } diff --git a/Patches/RoleManagerPatch.cs b/Patches/RoleManagerPatch.cs index 3f65851..fde5685 100644 --- a/Patches/RoleManagerPatch.cs +++ b/Patches/RoleManagerPatch.cs @@ -377,9 +377,6 @@ public class RoleManagerPatch [HarmonyPrefix] public static bool AssignRoleOnDeath_Prefix(/*RoleManager __instance*/ [HarmonyArgument(0)] PlayerControl player) { - if (player.Data.RoleType != RoleTypes.CrewmateGhost && player.Data.RoleType != RoleTypes.ImpostorGhost) - player.BetterData().RoleInfo.DeadDisplayRole = player.Data.RoleType; - if (!Main.BetterRoleAlgorithma.Value) return true; Dictionary GhostRoles = new() // Role, Amount diff --git a/main.cs b/main.cs index 8591be4..0ee4b3e 100644 --- a/main.cs +++ b/main.cs @@ -24,8 +24,8 @@ public class Main : BasePlugin { public const ReleaseTypes ReleaseBuildType = ReleaseTypes.Release; public const string CanaryNum = "0"; - public const string HotfixNum = "0"; - public const bool IsHotFix = false; + public const string HotfixNum = "1"; + public const bool IsHotFix = true; public const string PluginGuid = "com.d1gq.betteramongus"; public const string PluginVersion = "1.0.3"; public const string ReleaseDate = "08.17.2024"; // mm/dd/yyyy From bb320117e442842238f165d47c5eef70e10ab76c Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sat, 17 Aug 2024 21:50:19 -0500 Subject: [PATCH 05/18] log more info --- Modules/AntiCheat.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/AntiCheat.cs b/Modules/AntiCheat.cs index 1bc34a8..35d1126 100644 --- a/Modules/AntiCheat.cs +++ b/Modules/AntiCheat.cs @@ -362,7 +362,7 @@ class AntiCheat { if (!target.IsAlive() && target == PlayerControl.LocalPlayer) { - BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName((RpcCalls)callId)}"); + BetterNotificationManager.NotifyCheat(player, $"Invalid Action: Attempted To Ban Exploit"); Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName((RpcCalls)callId)} 2: {!target.IsAlive()}"); return false; } @@ -501,6 +501,7 @@ class AntiCheat if (callId is (byte)RpcCalls.CheckName) { var name = reader.ReadString(); + Utils.AddChatPrivate($"{player.GetPlayerNameAndColor()} Has tried to change their name to '{name}' but has been undone!"); Logger.LogCheat($"{player.Data.PlayerName} Has tried to change their name to '{name}' but has been undone!"); } return false; From 293e1b0ac0f31f52dd5397f1c0485b2ff31f8cb7 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sun, 18 Aug 2024 03:21:44 -0500 Subject: [PATCH 06/18] sabo fixes --- Modules/AntiCheat.cs | 132 ++++++++++++++++++++++++++++--- Modules/ExtendedPlayerControl.cs | 3 + Modules/ExtendedPlayerInfo.cs | 2 + Modules/Utils.cs | 6 +- main.cs | 2 +- 5 files changed, 132 insertions(+), 13 deletions(-) diff --git a/Modules/AntiCheat.cs b/Modules/AntiCheat.cs index 35d1126..a93df9b 100644 --- a/Modules/AntiCheat.cs +++ b/Modules/AntiCheat.cs @@ -4,6 +4,7 @@ using Hazel; using InnerNet; using UnityEngine; using UnityEngine.Purchasing; +using UnityEngine.Rendering; namespace BetterAmongUs; @@ -294,6 +295,15 @@ class AntiCheat player.BetterData().LastTaskId = taskId; } + if (callId is (byte)RpcCalls.CloseDoorsOfType) + { + if (!player.IsImpostorTeam()) + { + BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName((RpcCalls)callId)}"); + Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName((RpcCalls)callId)}: {!player.IsImpostorTeam()}"); + } + } + if (callId is (byte)RpcCalls.Pet or (byte)RpcCalls.CancelPet) { if (player?.CurrentOutfit?.PetId == "pet_EmptyPet") @@ -314,27 +324,129 @@ class AntiCheat // Check game states when sabotaging public static bool RpcUpdateSystemCheck(PlayerControl player, SystemTypes systemType, byte amount) { - if (PlayerControl.LocalPlayer == null || player == null || player == PlayerControl.LocalPlayer || player.BetterData().IsBetterHost || !IsEnabled || !Main.AntiCheat.Value - || GameStates.IsBetterHostLobby && !GameStates.IsHost) return true; + byte hostNum = 128; // Only host should ever send this number + byte singleFixNum = 0; + byte minLightNum = 0; + byte MaxLightNum = 4; + byte fixNum = 16; // 16 and 17 + byte openPanelNum = 64; // 64 and 65 + byte closePanelNum = 32; // 32 and 33 + // Set fixing status if (Utils.SystemTypeIsSabotage(systemType)) { - if (!player.IsImpostorTeam() || !GameStates.IsSystemActive(systemType) && GameStates.IsAnySabotageActive() - || ShipStatus.Instance.AllDoors.ToArray().Any(door => !door.IsOpen)) + if (amount == openPanelNum && !player.BetterData().IsFixingPanelSabotage) + { + player.BetterData().OpenSabotageNum = 1; + } + else if (amount == openPanelNum + 1 && !player.BetterData().IsFixingPanelSabotage) + { + player.BetterData().OpenSabotageNum = 2; + } + + if (amount == closePanelNum && player.BetterData().OpenSabotageNum == 1) + { + player.BetterData().OpenSabotageNum = 0; + } + else if (amount == closePanelNum + 1 && player.BetterData().OpenSabotageNum == 2) + { + player.BetterData().OpenSabotageNum = 0; + } + } + + if (!GameStates.IsHost || PlayerControl.LocalPlayer == null || player == null || player == PlayerControl.LocalPlayer + || player.BetterData().IsBetterHost || !IsEnabled || !Main.AntiCheat.Value + || GameStates.IsBetterHostLobby && !GameStates.IsHost) return true; + + // Single Fix: 0 + // Lights: 0-1-2-3-4 + // Fix 1: 16 + // Fix 2: 17 + // Panel 1: Open/Hold 64 - Close/Release 32 + // Panel 2: Open/Hold 65 - Close/Release 33 + // Cheat Sabo: 128 + + // Activate sabotage + if (systemType == SystemTypes.Sabotage) + { + SystemTypes SaboType = (SystemTypes)amount; + + if (!player.IsImpostorTeam() || GameStates.IsAnySabotageActive() || !Utils.SystemTypeIsSabotage(SaboType)) + { + BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName(SaboType)}"); + Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName(SaboType)}: {!player.IsImpostorTeam()} || {GameStates.IsAnySabotageActive()} " + + $"|| {!Utils.SystemTypeIsSabotage(SaboType)}"); + return false; + } + } + + // Fix sabotage + else if (Utils.SystemTypeIsSabotage(systemType)) + { + if (amount == hostNum && !player.IsHost()) { BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName(systemType)}"); - Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName(systemType)} Start Sabotage: {!player.IsImpostorTeam()} || {!GameStates.IsSystemActive(systemType)} " + - $"&& {GameStates.IsAnySabotageActive()} || {ShipStatus.Instance.AllDoors.ToArray().Any(door => !door.IsOpen)}"); + Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName(systemType)}: {amount == hostNum} && {!player.IsHost()}"); return false; } - // Fix Sabo - if (amount == 16) + if (!GameStates.IsSystemActive(systemType)) { - if (!GameStates.IsSystemActive(systemType)) + if (systemType is SystemTypes.Electrical) { BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName(systemType)}"); - Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName(systemType)} Fix Sabotage: {!GameStates.IsSystemActive(systemType)}"); + Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName(systemType)}: {systemType is SystemTypes.Electrical}"); + } + + return false; + } + + if (player.BetterData().IsFixingPanelSabotage) + { + if (player.BetterData().OpenSabotageNum == 0) + { + BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName(systemType)}"); + Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName(systemType)}: {player.BetterData().OpenSabotageNum == 0}"); + return false; + } + + if (amount == openPanelNum && amount == openPanelNum + 1) + { + BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName(systemType)}"); + Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName(systemType)}: {amount == openPanelNum} && {amount == openPanelNum + 1}"); + return false; + } + + if (player.BetterData().OpenSabotageNum == 1 && amount == openPanelNum + 1 + || player.BetterData().OpenSabotageNum == 2 && amount == openPanelNum) + { + BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName(systemType)}"); + Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName(systemType)}: {player.BetterData().OpenSabotageNum == 1} && {amount == openPanelNum + 1} " + + $"|| {player.BetterData().OpenSabotageNum == 2} && {amount == openPanelNum}"); + return false; + } + } + else + { + if (amount != fixNum && amount != fixNum + 1 + && amount != closePanelNum && amount != closePanelNum + 1 + && amount > MaxLightNum) + { + BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName(systemType)}"); + Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName(systemType)}: {amount != fixNum} && {amount != fixNum + 1}" + + $" && {amount != closePanelNum} && {amount != closePanelNum + 1}" + + $" && {amount > MaxLightNum}"); + return false; + } + + if (systemType == SystemTypes.Electrical) + { + if (amount > MaxLightNum) + { + BetterNotificationManager.NotifyCheat(player, $"Invalid Action RPC: {Enum.GetName(systemType)}"); + Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName(systemType)}: {amount > MaxLightNum}"); + return false; + } } } } diff --git a/Modules/ExtendedPlayerControl.cs b/Modules/ExtendedPlayerControl.cs index 168b03d..8fa2b42 100644 --- a/Modules/ExtendedPlayerControl.cs +++ b/Modules/ExtendedPlayerControl.cs @@ -114,7 +114,10 @@ static class ExtendedPlayerControl player.RpcSetName(setReasonInfo + ""); } + byte savePlayerId = player.PlayerId; + string saveName = player.Data.PlayerName; AmongUsClient.Instance.KickPlayer(player.GetClientId(), ban); + GameData.Instance.GetPlayerById(savePlayerId).PlayerName = saveName; } // RPCs diff --git a/Modules/ExtendedPlayerInfo.cs b/Modules/ExtendedPlayerInfo.cs index edf7f3d..259795a 100644 --- a/Modules/ExtendedPlayerInfo.cs +++ b/Modules/ExtendedPlayerInfo.cs @@ -12,6 +12,8 @@ public class ExtendedPlayerInfo public bool BannedByAntiCheat { get; set; } = false; // Track Game Info + public int OpenSabotageNum { get; set; } = 0; + public bool IsFixingPanelSabotage => OpenSabotageNum != 0; public float TimeSinceLastTask { get; set; } = 5f; public uint LastTaskId { get; set; } = 0; public int TimesCalledMeeting { get; set; } = 0; diff --git a/Modules/Utils.cs b/Modules/Utils.cs index ea46f90..024836a 100644 --- a/Modules/Utils.cs +++ b/Modules/Utils.cs @@ -68,13 +68,15 @@ public static class Utils or SystemTypes.Comms or SystemTypes.LifeSupp or SystemTypes.MushroomMixupSabotage - or SystemTypes.HeliSabotage; + or SystemTypes.HeliSabotage + or SystemTypes.Electrical; public static bool SystemTypeIsSabotage(int typeNum) => (SystemTypes)typeNum is SystemTypes.Reactor or SystemTypes.Laboratory or SystemTypes.Comms or SystemTypes.LifeSupp or SystemTypes.MushroomMixupSabotage - or SystemTypes.HeliSabotage; + or SystemTypes.HeliSabotage + or SystemTypes.Electrical; // Get players HashPuid public static string GetHashPuid(PlayerControl player) { diff --git a/main.cs b/main.cs index 0ee4b3e..486000c 100644 --- a/main.cs +++ b/main.cs @@ -24,7 +24,7 @@ public class Main : BasePlugin { public const ReleaseTypes ReleaseBuildType = ReleaseTypes.Release; public const string CanaryNum = "0"; - public const string HotfixNum = "1"; + public const string HotfixNum = "2"; public const bool IsHotFix = true; public const string PluginGuid = "com.d1gq.betteramongus"; public const string PluginVersion = "1.0.3"; From d2b30d64d1e92a75f3a164d333ae2e3ba860a488 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sun, 18 Aug 2024 03:21:57 -0500 Subject: [PATCH 07/18] date --- main.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cs b/main.cs index 486000c..83e8ef7 100644 --- a/main.cs +++ b/main.cs @@ -28,7 +28,7 @@ public class Main : BasePlugin public const bool IsHotFix = true; public const string PluginGuid = "com.d1gq.betteramongus"; public const string PluginVersion = "1.0.3"; - public const string ReleaseDate = "08.17.2024"; // mm/dd/yyyy + public const string ReleaseDate = "08.18.2024"; // mm/dd/yyyy public const string Github = "https://github.com/D1GQ/BetterAmongUs-Public"; public const string Discord = "https://discord.gg/vjYrXpzNAn"; From d3ea40d17c278b12c4eb9de664f2b7268cae623e Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sun, 18 Aug 2024 03:23:26 -0500 Subject: [PATCH 08/18] fix? --- Modules/ExtendedPlayerControl.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/ExtendedPlayerControl.cs b/Modules/ExtendedPlayerControl.cs index 8fa2b42..5a60230 100644 --- a/Modules/ExtendedPlayerControl.cs +++ b/Modules/ExtendedPlayerControl.cs @@ -114,10 +114,10 @@ static class ExtendedPlayerControl player.RpcSetName(setReasonInfo + ""); } - byte savePlayerId = player.PlayerId; + NetworkedPlayerInfo playerData = player.Data; string saveName = player.Data.PlayerName; AmongUsClient.Instance.KickPlayer(player.GetClientId(), ban); - GameData.Instance.GetPlayerById(savePlayerId).PlayerName = saveName; + playerData.PlayerName = saveName; } // RPCs From 8512573155d23b54c5cd75d671de5dcf0a5d061f Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sun, 18 Aug 2024 07:02:46 -0500 Subject: [PATCH 09/18] code clean up --- Modules/ExtendedPlayerInfo.cs | 68 ++++++++++++++++++++----------- Patches/GamePlayManagerPatch.cs | 4 +- Patches/PlayerControlPatch.cs | 16 +------- Patches/PlayerJoinAndLeftPatch.cs | 2 +- 4 files changed, 49 insertions(+), 41 deletions(-) diff --git a/Modules/ExtendedPlayerInfo.cs b/Modules/ExtendedPlayerInfo.cs index 259795a..e29bef3 100644 --- a/Modules/ExtendedPlayerInfo.cs +++ b/Modules/ExtendedPlayerInfo.cs @@ -1,37 +1,59 @@ using AmongUs.GameOptions; using InnerNet; +using UnityEngine; namespace BetterAmongUs; -public class ExtendedPlayerInfo +public static class PlayerControlDataExtension { - public Dictionary LastNameSetFor { get; set; } = []; - public bool IsBetterUser { get; set; } = false; - public bool IsBetterHost { get; set; } = false; - public bool IsTOHEHost { get; set; } = false; - public bool BannedByAntiCheat { get; set; } = false; + public class ExtendedPlayerInfo + { + public Dictionary LastNameSetFor { get; set; } = []; + public bool IsBetterUser { get; set; } = false; + public bool IsBetterHost { get; set; } = false; + public bool IsTOHEHost { get; set; } = false; + public bool BannedByAntiCheat { get; set; } = false; - // Track Game Info - public int OpenSabotageNum { get; set; } = 0; - public bool IsFixingPanelSabotage => OpenSabotageNum != 0; - public float TimeSinceLastTask { get; set; } = 5f; - public uint LastTaskId { get; set; } = 0; - public int TimesCalledMeeting { get; set; } = 0; - public DisconnectReasons DisconnectReason { get; set; } = DisconnectReasons.Unknown; - public ExtendedRoleInfo? RoleInfo { get; set; } -} + // Track Game Info + public int OpenSabotageNum { get; set; } = 0; + public bool IsFixingPanelSabotage => OpenSabotageNum != 0; + public float TimeSinceLastTask { get; set; } = 5f; + public uint LastTaskId { get; set; } = 0; + public int TimesCalledMeeting { get; set; } = 0; + public DisconnectReasons DisconnectReason { get; set; } = DisconnectReasons.Unknown; + public ExtendedRoleInfo? RoleInfo { get; set; } + } -public class ExtendedRoleInfo -{ - public int Kills { get; set; } = 0; - public bool HasNoisemakerNotify { get; set; } = false; - public RoleTypes DeadDisplayRole { get; set; } -} + public class ExtendedRoleInfo + { + public int Kills { get; set; } = 0; + public bool HasNoisemakerNotify { get; set; } = false; + public RoleTypes DeadDisplayRole { get; set; } + } -public static class PlayerControlExtensions -{ public static readonly Dictionary playerInfo = []; + // Reset info when needed + public static void ResetPlayerData(PlayerControl player) + { + if (!GameStates.IsInGamePlay) + { + player.BetterData().TimesCalledMeeting = 0; + player.BetterData().RoleInfo.HasNoisemakerNotify = false; + player.BetterData().TimeSinceLastTask = 5f; + player.BetterData().LastTaskId = 999; + player.BetterData().RoleInfo.Kills = 0; + player.BetterData().OpenSabotageNum = 0; + } + else + { + player.BetterData().TimeSinceLastTask += Time.deltaTime; + + if (player.IsAlive() || player.Data.RoleType == RoleTypes.GuardianAngel) + player.BetterData().RoleInfo.DeadDisplayRole = player.Data.RoleType; + } + } + // Get BetterData from PlayerControl public static ExtendedPlayerInfo? BetterData(this PlayerControl player) { diff --git a/Patches/GamePlayManagerPatch.cs b/Patches/GamePlayManagerPatch.cs index e8a3ae6..d9c3aed 100644 --- a/Patches/GamePlayManagerPatch.cs +++ b/Patches/GamePlayManagerPatch.cs @@ -23,7 +23,7 @@ class GamePlayManager // Clear unused Better Data var keysToRemove = new List(); - foreach (var betterInfo in PlayerControlExtensions.playerInfo) + foreach (var betterInfo in PlayerControlDataExtension.playerInfo) { if (!Main.AllPlayerControls.Any(pc => pc.Data.Puid == betterInfo.Key)) { @@ -33,7 +33,7 @@ class GamePlayManager foreach (var key in keysToRemove) { - PlayerControlExtensions.playerInfo.Remove(key); + PlayerControlDataExtension.playerInfo.Remove(key); } } diff --git a/Patches/PlayerControlPatch.cs b/Patches/PlayerControlPatch.cs index 370c046..4473e55 100644 --- a/Patches/PlayerControlPatch.cs +++ b/Patches/PlayerControlPatch.cs @@ -69,21 +69,7 @@ class PlayerControlPatch } // Reset player data in lobby - if (!GameStates.IsInGamePlay) - { - __instance.BetterData().TimesCalledMeeting = 0; - __instance.BetterData().RoleInfo.HasNoisemakerNotify = false; - __instance.BetterData().TimeSinceLastTask = 5f; - __instance.BetterData().LastTaskId = 999; - __instance.BetterData().RoleInfo.Kills = 0; - } - else - { - __instance.BetterData().TimeSinceLastTask += Time.deltaTime; - - if (__instance.IsAlive() || __instance.Data.RoleType == RoleTypes.GuardianAngel) - __instance.BetterData().RoleInfo.DeadDisplayRole = __instance.Data.RoleType; - } + PlayerControlDataExtension.ResetPlayerData(__instance); } public static void SetPlayerInfo(PlayerControl player) diff --git a/Patches/PlayerJoinAndLeftPatch.cs b/Patches/PlayerJoinAndLeftPatch.cs index e322bd8..de8365b 100644 --- a/Patches/PlayerJoinAndLeftPatch.cs +++ b/Patches/PlayerJoinAndLeftPatch.cs @@ -11,7 +11,7 @@ class OnGameJoinedPatch { try { - PlayerControlExtensions.playerInfo.Clear(); + PlayerControlDataExtension.playerInfo.Clear(); PlayerControlPatch.infotime = 0f; From c94d7ce80ea85560938fc307a276e6f1f55cf2ba Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sun, 18 Aug 2024 07:30:11 -0500 Subject: [PATCH 10/18] fix name at sum --- Modules/ExtendedPlayerControl.cs | 5 ++--- Modules/ExtendedPlayerInfo.cs | 6 ++++++ Patches/GamePlayManagerPatch.cs | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Modules/ExtendedPlayerControl.cs b/Modules/ExtendedPlayerControl.cs index 5a60230..d0c6f59 100644 --- a/Modules/ExtendedPlayerControl.cs +++ b/Modules/ExtendedPlayerControl.cs @@ -109,15 +109,14 @@ static class ExtendedPlayerControl player.BetterData().BannedByAntiCheat = true; + player.BetterData().SaveLastName = player.Data.PlayerName; + if (setReasonInfo != "") { player.RpcSetName(setReasonInfo + ""); } - NetworkedPlayerInfo playerData = player.Data; - string saveName = player.Data.PlayerName; AmongUsClient.Instance.KickPlayer(player.GetClientId(), ban); - playerData.PlayerName = saveName; } // RPCs diff --git a/Modules/ExtendedPlayerInfo.cs b/Modules/ExtendedPlayerInfo.cs index e29bef3..333f215 100644 --- a/Modules/ExtendedPlayerInfo.cs +++ b/Modules/ExtendedPlayerInfo.cs @@ -8,6 +8,7 @@ public static class PlayerControlDataExtension { public class ExtendedPlayerInfo { + public NetworkedPlayerInfo? ThisPlayerData { get; set; } public Dictionary LastNameSetFor { get; set; } = []; public bool IsBetterUser { get; set; } = false; public bool IsBetterHost { get; set; } = false; @@ -15,6 +16,8 @@ public static class PlayerControlDataExtension public bool BannedByAntiCheat { get; set; } = false; // Track Game Info + public string SaveLastName { get; set; } = string.Empty; + public string LastName => SaveLastName == string.Empty ? ThisPlayerData.PlayerName : SaveLastName; public int OpenSabotageNum { get; set; } = 0; public bool IsFixingPanelSabotage => OpenSabotageNum != 0; public float TimeSinceLastTask { get; set; } = 5f; @@ -63,6 +66,7 @@ public static class PlayerControlDataExtension { playerInfo[player.Data.Puid] = new ExtendedPlayerInfo { + ThisPlayerData = player.Data, RoleInfo = new ExtendedRoleInfo() }; } @@ -77,6 +81,7 @@ public static class PlayerControlDataExtension { playerInfo[info.Puid] = new ExtendedPlayerInfo { + ThisPlayerData = info, RoleInfo = new ExtendedRoleInfo() }; } @@ -95,6 +100,7 @@ public static class PlayerControlDataExtension { playerInfo[player.Data.Puid] = new ExtendedPlayerInfo { + ThisPlayerData = player.Data, RoleInfo = new ExtendedRoleInfo() }; } diff --git a/Patches/GamePlayManagerPatch.cs b/Patches/GamePlayManagerPatch.cs index d9c3aed..373b771 100644 --- a/Patches/GamePlayManagerPatch.cs +++ b/Patches/GamePlayManagerPatch.cs @@ -238,7 +238,7 @@ class GamePlayManager foreach (var data in playersData) { - var name = $"{data.PlayerName}"; + var name = $"{data.BetterData().LastName}"; string playerTheme(string text) => $"{text}"; string roleInfo; From a99f0dd0a6ce1478ff7a53fd05654492c9530e99 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sun, 18 Aug 2024 12:45:04 -0500 Subject: [PATCH 11/18] fix ban msg and name save --- Modules/ExtendedPlayerControl.cs | 14 ++++++++++++-- Modules/ExtendedPlayerInfo.cs | 2 -- Patches/GamePlayManagerPatch.cs | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Modules/ExtendedPlayerControl.cs b/Modules/ExtendedPlayerControl.cs index d0c6f59..6d18d5b 100644 --- a/Modules/ExtendedPlayerControl.cs +++ b/Modules/ExtendedPlayerControl.cs @@ -1,4 +1,5 @@ using AmongUs.GameOptions; +using BetterAmongUs.Patches; using InnerNet; using TMPro; using UnityEngine; @@ -109,14 +110,23 @@ static class ExtendedPlayerControl player.BetterData().BannedByAntiCheat = true; - player.BetterData().SaveLastName = player.Data.PlayerName; + NetworkedPlayerInfo playerInfo = player.Data; + string saveName = player.Data.PlayerName; if (setReasonInfo != "") { player.RpcSetName(setReasonInfo + ""); } - AmongUsClient.Instance.KickPlayer(player.GetClientId(), ban); + _ = new LateTask(() => + { + AmongUsClient.Instance.KickPlayer(player.GetClientId(), ban); + + _ = new LateTask(() => + { + playerInfo.PlayerName = saveName; + }, 0.15f, shoudLog: false); + }, 0.25f, shoudLog: false); } // RPCs diff --git a/Modules/ExtendedPlayerInfo.cs b/Modules/ExtendedPlayerInfo.cs index 333f215..69633b9 100644 --- a/Modules/ExtendedPlayerInfo.cs +++ b/Modules/ExtendedPlayerInfo.cs @@ -16,8 +16,6 @@ public static class PlayerControlDataExtension public bool BannedByAntiCheat { get; set; } = false; // Track Game Info - public string SaveLastName { get; set; } = string.Empty; - public string LastName => SaveLastName == string.Empty ? ThisPlayerData.PlayerName : SaveLastName; public int OpenSabotageNum { get; set; } = 0; public bool IsFixingPanelSabotage => OpenSabotageNum != 0; public float TimeSinceLastTask { get; set; } = 5f; diff --git a/Patches/GamePlayManagerPatch.cs b/Patches/GamePlayManagerPatch.cs index 373b771..d9c3aed 100644 --- a/Patches/GamePlayManagerPatch.cs +++ b/Patches/GamePlayManagerPatch.cs @@ -238,7 +238,7 @@ class GamePlayManager foreach (var data in playersData) { - var name = $"{data.BetterData().LastName}"; + var name = $"{data.PlayerName}"; string playerTheme(string text) => $"{text}"; string roleInfo; From 632bef17d74e53340cf9217cfe8c3bfe1a339070 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sun, 18 Aug 2024 13:12:11 -0500 Subject: [PATCH 12/18] More hide and seek support --- Modules/BetterHostManager.cs | 6 +++--- Patches/PlayerControlPatch.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/BetterHostManager.cs b/Modules/BetterHostManager.cs index 5e66038..550f3af 100644 --- a/Modules/BetterHostManager.cs +++ b/Modules/BetterHostManager.cs @@ -228,7 +228,7 @@ class BetterHostManager else if (player.BetterData().IsBetterUser) sbTopTag.Append("Better User+++"); } - else if (GameStates.IsInGamePlay) + else if (GameStates.IsInGamePlay && !GameStates.IsHideNSeek) { string Role = $"{player.GetRoleName()}"; if (!player.IsImpostorTeam() && player.myTasks.Count > 0) @@ -267,9 +267,9 @@ class BetterHostManager NewName = $"{NewName}"; // Don't send rpc if name is the same! - if (player.BetterData().LastNameSetFor.TryGetValue(target.PlayerId, out var lastName) && lastName == NewName) + if (player.BetterData().LastNameSetFor.TryGetValue(target.PlayerId, out var lastName)) { - if (!force) + if (lastName == NewName || !force) { return; } diff --git a/Patches/PlayerControlPatch.cs b/Patches/PlayerControlPatch.cs index 4473e55..421e6b5 100644 --- a/Patches/PlayerControlPatch.cs +++ b/Patches/PlayerControlPatch.cs @@ -163,7 +163,7 @@ class PlayerControlPatch sbTagBottom.Append($"{friendCode}+++"); } - else if (GameStates.IsInGame || GameStates.IsFreePlay) + else if (GameStates.IsInGame || GameStates.IsFreePlay && !GameStates.IsHideNSeek) { if (player.IsImpostorTeammate() || player == PlayerControl.LocalPlayer || !PlayerControl.LocalPlayer.IsAlive() || DebugMenu.RevealRoles) { From 04d911aa7ff2938492d0ca032aee9e055b9ab9d1 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sun, 18 Aug 2024 13:22:31 -0500 Subject: [PATCH 13/18] fix --- Patches/PlayerControlPatch.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Patches/PlayerControlPatch.cs b/Patches/PlayerControlPatch.cs index 421e6b5..edd6598 100644 --- a/Patches/PlayerControlPatch.cs +++ b/Patches/PlayerControlPatch.cs @@ -163,7 +163,7 @@ class PlayerControlPatch sbTagBottom.Append($"{friendCode}+++"); } - else if (GameStates.IsInGame || GameStates.IsFreePlay && !GameStates.IsHideNSeek) + else if ((GameStates.IsInGame || GameStates.IsFreePlay) && !GameStates.IsHideNSeek) { if (player.IsImpostorTeammate() || player == PlayerControl.LocalPlayer || !PlayerControl.LocalPlayer.IsAlive() || DebugMenu.RevealRoles) { From 664f64f390e7e8b81b43da6214548d55ce91f538 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Sun, 18 Aug 2024 13:59:40 -0500 Subject: [PATCH 14/18] remove kill tracker --- Patches/HudManagerPatch.cs | 19 ------------------- Patches/PlayerControlPatch.cs | 3 --- Patches/PlayerJoinAndLeftPatch.cs | 2 -- 3 files changed, 24 deletions(-) diff --git a/Patches/HudManagerPatch.cs b/Patches/HudManagerPatch.cs index 21430de..f470522 100644 --- a/Patches/HudManagerPatch.cs +++ b/Patches/HudManagerPatch.cs @@ -55,25 +55,6 @@ public class HudManagerPatch if (GameStates.InGame && __instance?.Chat?.gameObject.active != true) __instance.Chat.gameObject.SetActive(true); - - GameObject TaskDisplay = GameObject.Find("TaskDisplay"); - GameObject ProgressTracker = GameObject.Find("ProgressTracker"); - if (TaskDisplay != null && ProgressTracker != null) - { - if (PlayerControl.LocalPlayer.IsImpostorTeam()) - { - __instance.CrewmatesKilled.gameObject.SetActive(true); - __instance.CrewmatesKilled.gameObject.transform.SetLocalZ(-25); - TaskDisplay.transform.localPosition = new Vector3(0f, -0.4f, -5f); - ProgressTracker.transform.localPosition = new Vector3(-2.8733f, 3.1f); - } - else if (__instance.CrewmatesKilled.isActiveAndEnabled) - { - __instance.CrewmatesKilled.gameObject.SetActive(GameManager.Instance.ShowCrewmatesKilled()); - TaskDisplay.transform.localPosition = new Vector3(0f, 0f); - ProgressTracker.transform.localPosition = new Vector3(-2.8733f, 2.7f, 0); - } - } } catch { } } diff --git a/Patches/PlayerControlPatch.cs b/Patches/PlayerControlPatch.cs index edd6598..3a856de 100644 --- a/Patches/PlayerControlPatch.cs +++ b/Patches/PlayerControlPatch.cs @@ -241,9 +241,6 @@ class PlayerControlPatch { if (target == null) return; - if (PlayerControl.LocalPlayer.IsImpostorTeam() && GameStates.IsInGamePlay && !GameStates.IsHideNSeek && HudManager.Instance.CrewmatesKilled.isActiveAndEnabled) - HudManager.Instance?.NotifyOfDeath(); - Logger.LogPrivate($"{__instance.Data.PlayerName} Has killed {target.Data.PlayerName} as {Utils.GetRoleName(__instance.Data.RoleType)}", "EventLog"); __instance.BetterData().RoleInfo.Kills += 1; diff --git a/Patches/PlayerJoinAndLeftPatch.cs b/Patches/PlayerJoinAndLeftPatch.cs index de8365b..72e5c77 100644 --- a/Patches/PlayerJoinAndLeftPatch.cs +++ b/Patches/PlayerJoinAndLeftPatch.cs @@ -102,8 +102,6 @@ class OnPlayerLeftPatch { public static void Postfix(/*AmongUsClient __instance,*/ [HarmonyArgument(0)] ClientData data, [HarmonyArgument(1)] DisconnectReasons reason) { - if ((GameStates.IsInGame || GameStates.IsFreePlay) && !GameStates.IsLobby && !GameStates.IsHideNSeek && HudManager.Instance.CrewmatesKilled.isActiveAndEnabled) - HudManager.Instance?.NotifyOfDisconnect(data.Character); } } From 285823d6fbb6af536caa2a46ff566164f6860771 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Mon, 19 Aug 2024 03:14:49 -0500 Subject: [PATCH 15/18] Better Host & Modded Server Fix --- Modules/BetterNotificationManager.cs | 2 +- Modules/Debugger.cs | 8 ++++-- Modules/ExtendedPlayerControl.cs | 16 +++++------- Modules/RPC.cs | 12 +++++++-- Modules/Utils.cs | 26 ++++++++++++++++++- Patches/ClientOptionsPatch.cs | 6 +++++ Patches/PlayerControlPatch.cs | 13 +++++++++- Patches/ServerUpdatePatch.cs | 38 ---------------------------- 8 files changed, 67 insertions(+), 54 deletions(-) delete mode 100644 Patches/ServerUpdatePatch.cs diff --git a/Modules/BetterNotificationManager.cs b/Modules/BetterNotificationManager.cs index 9f89259..0bbda7d 100644 --- a/Modules/BetterNotificationManager.cs +++ b/Modules/BetterNotificationManager.cs @@ -51,7 +51,7 @@ class BetterNotificationManager player.Kick(true, $"{player.Data.PlayerName} banned by Anti-Cheat!\n Reason: {reason}"); } - Logger.LogCheat(Utils.GetRawText(text)); + Logger.LogCheat(Utils.RemoveHtmlText(text)); } public static void Update() diff --git a/Modules/Debugger.cs b/Modules/Debugger.cs index 985e79f..e689778 100644 --- a/Modules/Debugger.cs +++ b/Modules/Debugger.cs @@ -7,14 +7,18 @@ class Logger { string mark = $"{DateTime.Now:HH:mm} [BetterLog][{tag}]"; string logFilePath = Path.Combine(BetterDataManager.filePathFolder, "better-log.txt"); - string newLine = $"{mark}: {info}"; + string newLine = $"{mark}: {Utils.RemoveHtmlText(info)}"; File.AppendAllText(logFilePath, newLine + Environment.NewLine); Main.Logger.LogInfo($"[{tag}] {info}"); } public static void LogHeader(string info, string tag = "Log") => Log($" <-------------- {info} -------------->", tag); public static void LogCheat(string info, string tag = "AntiCheat") => Log(info, tag); public static void Error(string info, string tag = "Error") => Log(info, tag); - public static void Test() => Log("------------------> TEST <------------------", "TEST"); + public static void Test() + { + Log("------------------> TEST <------------------", "TEST"); + InGame("TEST"); + } // Log in game join msg public static void InGame(string info) { diff --git a/Modules/ExtendedPlayerControl.cs b/Modules/ExtendedPlayerControl.cs index 6d18d5b..04adc8a 100644 --- a/Modules/ExtendedPlayerControl.cs +++ b/Modules/ExtendedPlayerControl.cs @@ -54,7 +54,7 @@ static class ExtendedPlayerControl infoType = "InfoText_Info_TMP"; var topText = player.gameObject.transform.Find("Names/NameText_TMP/InfoText_T_TMP")?.GetComponent(); - if (topText != null && string.IsNullOrEmpty(Utils.GetRawText(topText.text))) + if (topText != null && string.IsNullOrEmpty(Utils.RemoveHtmlText(topText.text))) { text = "" + text + ""; } @@ -115,18 +115,16 @@ static class ExtendedPlayerControl if (setReasonInfo != "") { - player.RpcSetName(setReasonInfo + ""); + playerInfo.PlayerName = setReasonInfo + ""; + player.SetName(setReasonInfo + ""); } + AmongUsClient.Instance.KickPlayer(player.GetClientId(), ban); + _ = new LateTask(() => { - AmongUsClient.Instance.KickPlayer(player.GetClientId(), ban); - - _ = new LateTask(() => - { - playerInfo.PlayerName = saveName; - }, 0.15f, shoudLog: false); - }, 0.25f, shoudLog: false); + playerInfo.PlayerName = saveName; + }, 0.15f, shoudLog: false); } // RPCs diff --git a/Modules/RPC.cs b/Modules/RPC.cs index 10c8fea..750abc9 100644 --- a/Modules/RPC.cs +++ b/Modules/RPC.cs @@ -89,7 +89,12 @@ internal static class RPC } public static void SetNamePrivate(PlayerControl player, string name, PlayerControl target) - { + { + if (!GameStates.IsHost || !GameStates.IsVanillaServer) + { + return; + } + MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(player.NetId, (byte)RpcCalls.SetName, SendOption.Reliable, target.GetClientId()); writer.Write(player.Data.NetId); writer.Write(name); @@ -98,7 +103,10 @@ internal static class RPC public static void SyncAllNames(bool isForMeeting = false, bool force = false, bool isBetterHost = true) { - if (!GameStates.IsHost) return; + if (!GameStates.IsHost || !GameStates.IsVanillaServer) + { + return; + } foreach (PlayerControl player in Main.AllPlayerControls) BetterHostManager.SetPlayersInfoAsHost(player, isForMeeting, force, isBetterHost); diff --git a/Modules/Utils.cs b/Modules/Utils.cs index 024836a..6972ff8 100644 --- a/Modules/Utils.cs +++ b/Modules/Utils.cs @@ -100,12 +100,36 @@ public static class Utils // Remove Html Tags Template public static string RemoveHtmlTagsTemplate(string str) => Regex.Replace(str, "", ""); // Get raw text - public static string GetRawText(string text) + public static string RemoveHtmlText(string text) { text = Regex.Replace(text, "<[^>]*>", ""); text = Regex.Replace(text, "{[^}]*}", ""); + text = text.Replace("\n", " ").Replace("\r", " "); + text = text.Trim(); + return text; } + + + public static bool IsHtmlText(string text) + { + if (Regex.IsMatch(text, "<[^>]*>")) + { + return true; + } + if (Regex.IsMatch(text, "{[^}]*}")) + { + return true; + } + if (text.Contains("\n") || text.Contains("\r")) + { + return true; + } + + return false; + } + + // Get name for role public static string GetRoleName(RoleTypes role) => Main.GetRoleName[(int)role]; // Get hex color for team diff --git a/Patches/ClientOptionsPatch.cs b/Patches/ClientOptionsPatch.cs index 610dfc3..968ed3c 100644 --- a/Patches/ClientOptionsPatch.cs +++ b/Patches/ClientOptionsPatch.cs @@ -1,5 +1,6 @@ using HarmonyLib; using UnityEngine; +using static Rewired.Data.UserDataStore_PlayerPrefs.ControllerAssignmentSaveInfo; namespace BetterAmongUs.Patches; @@ -54,6 +55,11 @@ public static class OptionsMenuBehaviourPatch { RPC.SendBetterCheck(); + foreach (var kvp in PlayerControlDataExtension.playerInfo) + { + PlayerControlDataExtension.playerInfo[kvp.Key].LastNameSetFor.Clear(); + } + RPC.SyncAllNames(force: true); } } diff --git a/Patches/PlayerControlPatch.cs b/Patches/PlayerControlPatch.cs index 3a856de..cb134fb 100644 --- a/Patches/PlayerControlPatch.cs +++ b/Patches/PlayerControlPatch.cs @@ -195,7 +195,7 @@ class PlayerControlPatch string[] parts = text.Split("+++"); for (int i = 0; i < parts.Length; i++) { - if (!string.IsNullOrEmpty(Utils.GetRawText(parts[i]))) + if (!string.IsNullOrEmpty(Utils.RemoveHtmlText(parts[i]))) { destination.Append(parts[i]); if (i != parts.Length - 2) @@ -221,6 +221,17 @@ class PlayerControlPatch } } + [HarmonyPatch(nameof(PlayerControl.RpcSetName))] + [HarmonyPrefix] + public static bool RpcSetName_Prefix([HarmonyArgument(0)] string name) + { + if (!GameStates.IsVanillaServer && Utils.IsHtmlText(name)) + { + return false; + } + + return true; + } [HarmonyPatch(nameof(PlayerControl.SetColor))] [HarmonyPostfix] diff --git a/Patches/ServerUpdatePatch.cs b/Patches/ServerUpdatePatch.cs deleted file mode 100644 index a0b2016..0000000 --- a/Patches/ServerUpdatePatch.cs +++ /dev/null @@ -1,38 +0,0 @@ -using HarmonyLib; - -namespace BetterAmongUs.Patches; - -[HarmonyPatch(typeof(Constants), nameof(Constants.GetBroadcastVersion))] -class ServerUpdatePatch -{ - static void Postfix(ref int __result) - { - var region = ServerManager.Instance.CurrentRegion.Name; - - if (GameStates.IsLocalGame) - { - } - if (GameStates.IsOnlineGame) - { - if (region.Contains("MNA") || region.Contains("MEU") || region.Contains("MAS")) - { - __result += 25; - } - } - } -} -[HarmonyPatch(typeof(Constants), nameof(Constants.IsVersionModded))] -public static class IsVersionModdedPatch -{ - public static bool Prefix(ref bool __result) - { - var region = ServerManager.Instance.CurrentRegion.Name; - - if (region.Contains("MNA") || region.Contains("MEU") || region.Contains("MAS")) - { - __result = true; - return false; - } - return true; - } -} \ No newline at end of file From 0f8f14b648ace066e894a50611e309411caac0d2 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Mon, 19 Aug 2024 10:03:03 -0500 Subject: [PATCH 16/18] Ban word list --- Modules/AntiCheat.cs | 6 +-- Modules/BetterDataManager.cs | 6 +++ Modules/BetterNotificationManager.cs | 2 +- Modules/ExtendedPlayerControl.cs | 10 ++--- Modules/RPC.cs | 32 +++++++++++++ Patches/ClientOptionsPatch.cs | 6 +-- Patches/ClientPatch.cs | 2 +- Patches/PlayerJoinAndLeftPatch.cs | 67 +++++++++++++++------------- main.cs | 4 +- 9 files changed, 90 insertions(+), 45 deletions(-) diff --git a/Modules/AntiCheat.cs b/Modules/AntiCheat.cs index a93df9b..13f819f 100644 --- a/Modules/AntiCheat.cs +++ b/Modules/AntiCheat.cs @@ -27,15 +27,15 @@ class AntiCheat if (SickoData.ContainsKey(hashPuid)) { - player.Kick(true, $"{player.Data.PlayerName} banned by Anti-Cheat!\n Reason: Known Sicko Menu User"); + player.Kick(true, $"banned by Anti-Cheat!\n Reason: Known Sicko Menu User", true); } else if (AUMData.ContainsKey(hashPuid)) { - player.Kick(true, $"{player.Data.PlayerName} banned by Anti-Cheat!\n Reason: Known AUM User"); + player.Kick(true, $"banned by Anti-Cheat!\n Reason: Known AUM User", true); } else if (PlayerData.ContainsKey(hashPuid)) { - player.Kick(true, $"{player.Data.PlayerName} banned by Anti-Cheat!\n Reason: Known Cheater"); + player.Kick(true, $"banned by Anti-Cheat!\n Reason: Known Cheater", true); } } } diff --git a/Modules/BetterDataManager.cs b/Modules/BetterDataManager.cs index 6068fe7..63506eb 100644 --- a/Modules/BetterDataManager.cs +++ b/Modules/BetterDataManager.cs @@ -9,6 +9,7 @@ class BetterDataManager public static string filePathFolderSaveInfo = Path.Combine(filePathFolder, $"SaveInfo"); public static string banPlayerListFile = Path.Combine(filePathFolderSaveInfo, "BanPlayerList.txt"); public static string banNameListFile = Path.Combine(filePathFolderSaveInfo, "BanNameList.txt"); + public static string banWordListFile = Path.Combine(filePathFolderSaveInfo, "BanWordList.txt"); public static string GetFilePath(string name) { @@ -37,6 +38,11 @@ class BetterDataManager File.WriteAllText(banNameListFile, "// Example\nBanName1\nBanName2"); } + if (!File.Exists(banWordListFile)) + { + File.WriteAllText(banWordListFile, "// Example\nStart"); + } + if (!File.Exists(filePath)) { // Initialize with predefined categories diff --git a/Modules/BetterNotificationManager.cs b/Modules/BetterNotificationManager.cs index 0bbda7d..a826f32 100644 --- a/Modules/BetterNotificationManager.cs +++ b/Modules/BetterNotificationManager.cs @@ -48,7 +48,7 @@ class BetterNotificationManager if (GameStates.IsHost && kickPlayer) { - player.Kick(true, $"{player.Data.PlayerName} banned by Anti-Cheat!\n Reason: {reason}"); + player.Kick(true, $"banned by Anti-Cheat!\n Reason: {reason}", true); } Logger.LogCheat(Utils.RemoveHtmlText(text)); diff --git a/Modules/ExtendedPlayerControl.cs b/Modules/ExtendedPlayerControl.cs index 04adc8a..c153095 100644 --- a/Modules/ExtendedPlayerControl.cs +++ b/Modules/ExtendedPlayerControl.cs @@ -101,22 +101,22 @@ static class ExtendedPlayerControl } // Kick player - public static void Kick(this PlayerControl player, bool ban = false, string setReasonInfo = "") + public static void Kick(this PlayerControl player, bool ban = false, string setReasonInfo = "", bool AntiCheatBan = false) { - if (!GameStates.IsHost || PlayerControl.LocalPlayer == player || !player.DataIsCollected() || player.IsHost() || player.BetterData().BannedByAntiCheat || player.isDummy) + if (!GameStates.IsHost || PlayerControl.LocalPlayer == player || !player.DataIsCollected() || player.IsHost() || player.isDummy) { return; } - player.BetterData().BannedByAntiCheat = true; + player.BetterData().BannedByAntiCheat = AntiCheatBan && ban; NetworkedPlayerInfo playerInfo = player.Data; string saveName = player.Data.PlayerName; if (setReasonInfo != "") { - playerInfo.PlayerName = setReasonInfo + ""; - player.SetName(setReasonInfo + ""); + playerInfo.PlayerName = $"{saveName} {setReasonInfo}"; + player.SetName($"{saveName} {setReasonInfo}"); } AmongUsClient.Instance.KickPlayer(player.GetClientId(), ban); diff --git a/Modules/RPC.cs b/Modules/RPC.cs index 750abc9..ff28105 100644 --- a/Modules/RPC.cs +++ b/Modules/RPC.cs @@ -222,6 +222,38 @@ internal static class RPC BetterNotificationManager.Notify($"{player.GetPlayerNameAndColor()} has granted permission!"); } } + + // Check banned words + if (Main.UseBannedList.Value) + { + try + { + Func normalizeText = text => new string(text.Where(c => char.IsLetterOrDigit(c)).ToArray()).ToLower(); + + HashSet bannedWords = new HashSet( + File.ReadLines(BetterDataManager.banWordListFile) + .Select(normalizeText) + .Where(text => !string.IsNullOrWhiteSpace(text)) + ); + + string normalizedMessage = normalizeText(text); + + bool isWordBanned = bannedWords.Any(bannedWord => + normalizedMessage.Contains(bannedWord) + ); + + if (!string.IsNullOrEmpty(normalizedMessage) && isWordBanned) + { + _ = new LateTask(() => + { + player.Kick(false, $"has been kicked due to\nchat message containing a banned word!"); + }, 1f, shoudLog: false); + } + } + catch { } + } + + break; } } diff --git a/Patches/ClientOptionsPatch.cs b/Patches/ClientOptionsPatch.cs index 968ed3c..a7efcb3 100644 --- a/Patches/ClientOptionsPatch.cs +++ b/Patches/ClientOptionsPatch.cs @@ -13,7 +13,7 @@ public static class OptionsMenuBehaviourPatch private static ClientOptionItem BetterHost; private static ClientOptionItem BetterRoleAlgorithma; private static ClientOptionItem BetterNotifications; - private static ClientOptionItem UseBannedPlayerAndName; + private static ClientOptionItem UseBannedList; private static ClientOptionItem LobbyPlayerInfo; private static ClientOptionItem DisableLobbyTheme; private static ClientOptionItem UnlockFPS; @@ -81,9 +81,9 @@ public static class OptionsMenuBehaviourPatch } } - if (UseBannedPlayerAndName == null || UseBannedPlayerAndName.ToggleButton == null) + if (UseBannedList == null || UseBannedList.ToggleButton == null) { - UseBannedPlayerAndName = ClientOptionItem.Create("Banned Player & Name List", Main.UseBannedPlayerAndName, __instance); + UseBannedList = ClientOptionItem.Create("Use Ban Lists", Main.UseBannedList, __instance); } if (LobbyPlayerInfo == null || LobbyPlayerInfo.ToggleButton == null) diff --git a/Patches/ClientPatch.cs b/Patches/ClientPatch.cs index 11d194b..6836178 100644 --- a/Patches/ClientPatch.cs +++ b/Patches/ClientPatch.cs @@ -151,7 +151,7 @@ public class ClientPatch [HarmonyPrefix] public static void Show_Prefix(ref string playerName) { - if (playerName.Contains("Anti-Cheat")) + if (Utils.IsHtmlText(playerName)) { string extractedText = playerName.Split(new[] { "", "" }, StringSplitOptions.None)[1]; playerName = extractedText; diff --git a/Patches/PlayerJoinAndLeftPatch.cs b/Patches/PlayerJoinAndLeftPatch.cs index 72e5c77..7e2463a 100644 --- a/Patches/PlayerJoinAndLeftPatch.cs +++ b/Patches/PlayerJoinAndLeftPatch.cs @@ -50,47 +50,54 @@ public static class OnPlayerJoinedPatch client.Character.RpcSendHostChat(HudManagerPatch.WelcomeMessage, sendToBetterUser: false); // Auto ban player on ban list - if (Main.UseBannedPlayerAndName.Value) + if (Main.UseBannedList.Value) { var player = Utils.PlayerFromClientId(client.Id); if (player != null) { - string banPlayerListContent = File.ReadAllText(BetterDataManager.banPlayerListFile); - - string[] listPlayerArray = banPlayerListContent.Split(new[] { Environment.NewLine }, StringSplitOptions.None); - - foreach (string text in listPlayerArray) + try { - if (!string.IsNullOrEmpty(player.Data.FriendCode) && text.Contains(player.Data.FriendCode) - || !string.IsNullOrEmpty(Utils.GetHashPuid(player)) && text.Contains(Utils.GetHashPuid(player))) + string banPlayerListContent = File.ReadAllText(BetterDataManager.banPlayerListFile); + + string[] listPlayerArray = banPlayerListContent.Split(new[] { Environment.NewLine }, StringSplitOptions.None); + + foreach (string text in listPlayerArray) { - player.Kick(true, $"{player.Data.PlayerName} has been banned due to being on the ban player list!"); - break; + if (!string.IsNullOrEmpty(player.Data.FriendCode) && text.Contains(player.Data.FriendCode) + || !string.IsNullOrEmpty(Utils.GetHashPuid(player)) && text.Contains(Utils.GetHashPuid(player))) + { + player.Kick(true, $"has been banned due to being on the ban player list!"); + break; + } } } + catch { } - // Normalize and remove spaces and special characters from names - Func normalizeName = name => new string(name.Where(c => char.IsLetterOrDigit(c)).ToArray()).ToLower(); - - // Read all banned names into a HashSet with normalized names - HashSet bannedNames = new HashSet( - File.ReadLines(BetterDataManager.banNameListFile) - .Select(normalizeName) - .Where(name => !string.IsNullOrWhiteSpace(name)) - ); - - string normalizedPlayerName = normalizeName(player.Data.PlayerName); - - // Check if any banned name is a prefix of the player's normalized name - bool isNameBanned = bannedNames.Any(bannedName => - normalizedPlayerName.StartsWith(bannedName) - ); - - if (!string.IsNullOrEmpty(normalizedPlayerName) && isNameBanned) + try { - player.Kick(false, $"{player.Data.PlayerName} has been kicked due to their name being on the ban name list!"); - } + // Normalize and remove spaces and special characters from names + Func normalizeName = name => new string(name.Where(c => char.IsLetterOrDigit(c)).ToArray()).ToLower(); + // Read all banned names into a HashSet with normalized names + HashSet bannedNames = new HashSet( + File.ReadLines(BetterDataManager.banNameListFile) + .Select(normalizeName) + .Where(name => !string.IsNullOrWhiteSpace(name)) + ); + + string normalizedPlayerName = normalizeName(player.Data.PlayerName); + + // Check if any banned name is a prefix of the player's normalized name + bool isNameBanned = bannedNames.Any(bannedName => + normalizedPlayerName.StartsWith(bannedName) + ); + + if (!string.IsNullOrEmpty(normalizedPlayerName) && isNameBanned) + { + player.Kick(false, $"has been kicked due to their name being on the ban name list!"); + } + } + catch { } } } } diff --git a/main.cs b/main.cs index 83e8ef7..49d48ae 100644 --- a/main.cs +++ b/main.cs @@ -161,7 +161,7 @@ public class Main : BasePlugin public static ConfigEntry BetterHost { get; private set; } public static ConfigEntry BetterRoleAlgorithma { get; private set; } public static ConfigEntry BetterNotifications { get; private set; } - public static ConfigEntry UseBannedPlayerAndName { get; private set; } + public static ConfigEntry UseBannedList { get; private set; } public static ConfigEntry LobbyPlayerInfo { get; private set; } public static ConfigEntry DisableLobbyTheme { get; private set; } public static ConfigEntry UnlockFPS { get; private set; } @@ -173,7 +173,7 @@ public class Main : BasePlugin BetterHost = Config.Bind("Better Options", "BetterHost", false); BetterRoleAlgorithma = Config.Bind("Better Options", "BetterRoleAlgorithma", true); BetterNotifications = Config.Bind("Better Options", "BetterNotifications", true); - UseBannedPlayerAndName = Config.Bind("Better Options", "UseBannedPlayerAndName", true); + UseBannedList = Config.Bind("Better Options", "UseBannedList", true); LobbyPlayerInfo = Config.Bind("Better Options", "LobbyPlayerInfo", true); DisableLobbyTheme = Config.Bind("Better Options", "DisableLobbyTheme", true); UnlockFPS = Config.Bind("Better Options", "UnlockFPS", false); From 158d48438607323dda86b4efb05252f0a5269041 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Mon, 19 Aug 2024 18:40:46 -0500 Subject: [PATCH 17/18] False positive fixes --- Modules/AntiCheat.cs | 15 +++++++++++---- Modules/ExtendedPlayerInfo.cs | 4 +++- Modules/GameState.cs | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Modules/AntiCheat.cs b/Modules/AntiCheat.cs index 13f819f..f0417bb 100644 --- a/Modules/AntiCheat.cs +++ b/Modules/AntiCheat.cs @@ -472,11 +472,18 @@ class AntiCheat if (target != null) { - if (!target.IsAlive() && target == PlayerControl.LocalPlayer) + if (target == PlayerControl.LocalPlayer) { - BetterNotificationManager.NotifyCheat(player, $"Invalid Action: Attempted To Ban Exploit"); - Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName((RpcCalls)callId)} 2: {!target.IsAlive()}"); - return false; + if (target.BetterData().CheckBanExploit && !target.IsAlive()) + { + BetterNotificationManager.NotifyCheat(player, $"Invalid Action: Attempted To Ban Exploit"); + Logger.LogCheat($"{player.Data.PlayerName} {Enum.GetName((RpcCalls)callId)} 2: {target.BetterData().CheckBanExploit} && {!target.IsAlive()}"); + return false; + } + else + { + target.BetterData().CheckBanExploit = true; + } } } } diff --git a/Modules/ExtendedPlayerInfo.cs b/Modules/ExtendedPlayerInfo.cs index 69633b9..68712c2 100644 --- a/Modules/ExtendedPlayerInfo.cs +++ b/Modules/ExtendedPlayerInfo.cs @@ -14,6 +14,7 @@ public static class PlayerControlDataExtension public bool IsBetterHost { get; set; } = false; public bool IsTOHEHost { get; set; } = false; public bool BannedByAntiCheat { get; set; } = false; + public bool CheckBanExploit { get; set; } = false; // Track Game Info public int OpenSabotageNum { get; set; } = 0; @@ -37,7 +38,7 @@ public static class PlayerControlDataExtension // Reset info when needed public static void ResetPlayerData(PlayerControl player) { - if (!GameStates.IsInGamePlay) + if (GameStates.IsLobby) { player.BetterData().TimesCalledMeeting = 0; player.BetterData().RoleInfo.HasNoisemakerNotify = false; @@ -45,6 +46,7 @@ public static class PlayerControlDataExtension player.BetterData().LastTaskId = 999; player.BetterData().RoleInfo.Kills = 0; player.BetterData().OpenSabotageNum = 0; + player.BetterData().CheckBanExploit = false; } else { diff --git a/Modules/GameState.cs b/Modules/GameState.cs index 068c4f8..d2e21d3 100644 --- a/Modules/GameState.cs +++ b/Modules/GameState.cs @@ -29,7 +29,7 @@ public static class GameStates return type switch { - SystemTypes.Electrical when mapId != 5 => system.Cast()?.IsActive ?? false, + SystemTypes.Electrical when mapId != 5 => !system.Cast()?.IsActive == false, SystemTypes.Reactor when mapId != 2 => system.Cast()?.IsActive ?? false, SystemTypes.Laboratory when mapId == 2 => system.Cast()?.IsActive ?? false, SystemTypes.LifeSupp when mapId is 0 or 3 => system.Cast()?.IsActive ?? false, From cd1526ac92b2574c4bf4c1f73236d9720c6d14f6 Mon Sep 17 00:00:00 2001 From: D1GQ Date: Mon, 19 Aug 2024 18:52:14 -0500 Subject: [PATCH 18/18] v1.0.4 --- main.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.cs b/main.cs index 49d48ae..3900c5c 100644 --- a/main.cs +++ b/main.cs @@ -24,11 +24,11 @@ public class Main : BasePlugin { public const ReleaseTypes ReleaseBuildType = ReleaseTypes.Release; public const string CanaryNum = "0"; - public const string HotfixNum = "2"; - public const bool IsHotFix = true; + public const string HotfixNum = "0"; + public const bool IsHotFix = false; public const string PluginGuid = "com.d1gq.betteramongus"; - public const string PluginVersion = "1.0.3"; - public const string ReleaseDate = "08.18.2024"; // mm/dd/yyyy + public const string PluginVersion = "1.0.4"; + public const string ReleaseDate = "08.19.2024"; // mm/dd/yyyy public const string Github = "https://github.com/D1GQ/BetterAmongUs-Public"; public const string Discord = "https://discord.gg/vjYrXpzNAn";