diff --git a/Gamemodes/TheMindGame.cs b/Gamemodes/TheMindGame.cs index 932161ad2..5e78b45e1 100644 --- a/Gamemodes/TheMindGame.cs +++ b/Gamemodes/TheMindGame.cs @@ -786,7 +786,8 @@ public static class TheMindGame byte id = FindTargetIdFromText(); if (id == byte.MaxValue) break; - if (!pc.AmOwner && spamRequired) ChatManager.SendPreviousMessagesToAll(); + if (!pc.AmOwner && spamRequired) + Utils.SendMessage("\n", pc.PlayerId, Translator.GetString("NoSpamAnymoreUseCmd")); if (id == WinningBriefcaseHolderId) { diff --git a/Modules/GuessManager.cs b/Modules/GuessManager.cs index f47b98afa..aecf0c5a0 100644 --- a/Modules/GuessManager.cs +++ b/Modules/GuessManager.cs @@ -126,7 +126,7 @@ public static class GuessManager (pc.Is(CustomRoles.EvilGuesser) && Options.EGTryHideMsg.GetBool()) || (pc.Is(CustomRoles.Doomsayer) && Doomsayer.DoomsayerTryHideMsg.GetBool()) || (pc.Is(CustomRoles.Guesser) && Guesser.GTryHideMsg.GetBool()) || (Options.GuesserMode.GetBool() && Options.HideGuesserCommands.GetBool()))) - ChatManager.SendPreviousMessagesToAll(); + Utils.SendMessage("\n", pc.PlayerId, GetString("NoSpamAnymoreUseCmd")); if (!MsgToPlayerAndRole(msg, out byte targetId, out CustomRoles role, out string error)) { diff --git a/Patches/ChatCommandPatch.cs b/Patches/ChatCommandPatch.cs index 77600c646..22bcc5cc0 100644 --- a/Patches/ChatCommandPatch.cs +++ b/Patches/ChatCommandPatch.cs @@ -3188,7 +3188,7 @@ internal static class ChatCommands break; } - if (command.AlwaysHidden && spamRequired) ChatManager.SendPreviousMessagesToAll(); + if (command.AlwaysHidden && spamRequired) Utils.SendMessage("\n", player.PlayerId, GetString("NoSpamAnymoreUseCmd")); command.Action(player, text, args); if (command.IsCanceled) canceled = command.AlwaysHidden || !Options.HostSeesCommandsEnteredByOthers.GetBool(); break; diff --git a/Patches/ChatControlPatch.cs b/Patches/ChatControlPatch.cs index 69c22f665..63a6517a5 100644 --- a/Patches/ChatControlPatch.cs +++ b/Patches/ChatControlPatch.cs @@ -291,18 +291,7 @@ public static class ChatManager if (!AmongUsClient.Instance.AmHost) return; PlayerControl player = GameStates.CurrentServerType == GameStates.ServerType.Vanilla ? PlayerControl.LocalPlayer : Main.AllAlivePlayerControls.MinBy(x => x.PlayerId) ?? Main.AllPlayerControls.MinBy(x => x.PlayerId) ?? PlayerControl.LocalPlayer; if (player == null) return; - - if (GameStates.CurrentServerType == GameStates.ServerType.Vanilla) - { - if (targets.Length <= 1 || targets.Length >= Main.AllAlivePlayerControls.Length) - Loop.Times(30, _ => Utils.SendMessage(string.Empty, targets.Length == 1 ? targets[0].PlayerId : byte.MaxValue, "​", force: true, sendOption: SendOption.None)); - else - targets.Do(x => Loop.Times(30, _ => Utils.SendMessage(string.Empty, x.PlayerId, "​", force: true, sendOption: SendOption.None))); - - return; - } - - if (targets.Length == 0 || targets.Length == PlayerControl.AllPlayerControls.Count) SendEmptyMessage(null); + if (targets.Length == 0 || targets.Length >= Main.AllAlivePlayerControls.Length) SendEmptyMessage(null); else targets.Do(SendEmptyMessage); return; @@ -312,10 +301,19 @@ public static class ChatManager bool toLocalPlayer = !toEveryone && receiver.AmOwner; if (HudManager.InstanceExists && (toLocalPlayer || toEveryone)) HudManager.Instance.Chat.AddChat(player, "."); if (toLocalPlayer) return; - MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(player.NetId, (byte)RpcCalls.SendChat, SendOption.Reliable, toEveryone ? -1 : receiver.OwnerId); - writer.Write("."); - writer.Write(true); - AmongUsClient.Instance.FinishRpcImmediately(writer); + + if (GameStates.CurrentServerType == GameStates.ServerType.Vanilla) + { + byte to = toEveryone ? byte.MaxValue : receiver.PlayerId; + Utils.SendMessage(".", to, "\n", force: true, addToHistory: false); + } + else + { + MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(player.NetId, (byte)RpcCalls.SendChat, SendOption.Reliable, toEveryone ? -1 : receiver.OwnerId); + writer.Write("."); + writer.Write(true); + AmongUsClient.Instance.FinishRpcImmediately(writer); + } } } } \ No newline at end of file diff --git a/Resources/Lang/en_US.json b/Resources/Lang/en_US.json index 64893e3ec..8c60a9f36 100644 --- a/Resources/Lang/en_US.json +++ b/Resources/Lang/en_US.json @@ -801,7 +801,7 @@ "InspectorInfoLong": "(Crewmates):\\nTo check if two players are on the same team, use the command /cmd cp [player id 1] [player id 2]. Neutral killers are counted as part of the same team. Non-Killing Neutrals are counted as separate teams. The Trickster is counted as crew, and Madmates are counted as Impostor. The Lawyer/Follower and its target count as the same team. You will receive an affirmation message if they are in the same team or a denial message if they are not.", "TimeMasterInfoLong": "(Crewmates):\\nAs the Time Master, use the vents/pet to rewind time to a few seconds before. Players will be teleported back to their positions from that time. Players who died within that time will be revived.", "CrusaderInfoLong": "(Crewmates):\\nAs the Crusader, use your kill button to crusade a player. If that player gets attacked, you'll kill the attacker.", - "ArsonistInfoLong": "(Neutrals):\\nArsonist can douse by clicking the kill button on a player and following them for a few seconds. When dousing starts, successful dousing is indicated by a shield animation (only visible to themselves). When the Arsonist douses all surviving players, they can vent/pet their pet to start a fire and win alone. If player name shows 「△」, they're being doused; if it shows 「▲」, they're completely doused. Note that if 'Can Ignite Anytime' is enabled, the Arsonist needs to use their kill button on a fully doused player to ignite.", + "ArsonistInfoLong": "(Neutrals):\\nArsonist can douse by clicking the kill button on a player and following them for a few seconds. Successful dousing is indicated by a shield animation (only visible to themselves). When the Arsonist douses all living players, they can vent/pet to start a fire and win alone. If a player's name shows 「△」, they're being doused; if it shows 「▲」, they're completely doused. Note that if 'Can Ignite Anytime' is enabled, the Arsonist needs to use their kill button on a fully doused player to ignite, and only doused players die.", "JesterInfoLong": "(Neutrals):\\nJester wins alone if voted out but loses if still alive at the end. Jester, Executioner, and Innocent can win together.", "TerroristInfoLong": "(Neutrals):\\nIf the Terrorist completes all tasks and dies, they win the game alone.", "ExecutionerInfoLong": "(Neutrals):\\nThe Executioner has a target with a diamond symbol next to their name. If the target dies, the Executioner may become a Crewmate, Jester, or Opportunist. If the target is voted out, the Executioner wins.", @@ -4244,6 +4244,7 @@ "NumGuessersOn.Neutral.Max": "Maximum Number of Neutral Guessers", "NumGuessersOn.Coven.Min": "Minimum Number of Coven Guessers", "NumGuessersOn.Coven.Max": "Maximum Number of Coven Guessers", + "NoSpamAnymoreUseCmd": "<#ff0000>⚠ <#ffff00>USE THE '/cmd {command name} {arguments}' FORMAT <#ff0000>⚠\\n<#ffa500>Otherwise your messages are exposed!", "ZombieSpeedReduceInterval": "Speed Reduction Interval", "ZombieInitialSpeed": "Initial Speed", "ZombieMinimumSpeed": "Minimum Speed", diff --git a/Roles/Standard/Crewmate/Investigate/Inspector.cs b/Roles/Standard/Crewmate/Investigate/Inspector.cs index 0dbcaa304..74a934603 100644 --- a/Roles/Standard/Crewmate/Investigate/Inspector.cs +++ b/Roles/Standard/Crewmate/Investigate/Inspector.cs @@ -139,7 +139,7 @@ public class Inspector : RoleBase case 2: { if (TryHideMsg.GetBool() && !isUI && spamRequired) - ChatManager.SendPreviousMessagesToAll(); + Utils.SendMessage("\n", pc.PlayerId, GetString("NoSpamAnymoreUseCmd")); if (!MsgToPlayerAndRole(msg, out byte targetId1, out byte targetId2, out string error)) { diff --git a/Roles/Standard/Crewmate/Killing/Judge.cs b/Roles/Standard/Crewmate/Killing/Judge.cs index 595a18e6b..edc9df362 100644 --- a/Roles/Standard/Crewmate/Killing/Judge.cs +++ b/Roles/Standard/Crewmate/Killing/Judge.cs @@ -109,7 +109,7 @@ public class Judge : RoleBase case 2: { if (TryHideMsg.GetBool() && !isUI && spamRequired) - ChatManager.SendPreviousMessagesToAll(); + Utils.SendMessage("\n", pc.PlayerId, GetString("NoSpamAnymoreUseCmd")); if (!MsgToPlayerAndRole(msg, out byte targetId, out string error)) { diff --git a/Roles/Standard/Crewmate/Power/Swapper.cs b/Roles/Standard/Crewmate/Power/Swapper.cs index c89257b49..858155222 100644 --- a/Roles/Standard/Crewmate/Power/Swapper.cs +++ b/Roles/Standard/Crewmate/Power/Swapper.cs @@ -105,7 +105,7 @@ public class Swapper : RoleBase } if (HideMsg.GetBool() && !isUI && !spamRequired) - ChatManager.SendPreviousMessagesToAll(); + Utils.SendMessage("\n", pc.PlayerId, GetString("NoSpamAnymoreUseCmd")); if (!byte.TryParse(msg.Replace(" ", string.Empty), out byte targetId)) { diff --git a/Roles/Standard/Impostor/Killing/Councillor.cs b/Roles/Standard/Impostor/Killing/Councillor.cs index 5b679427d..8faab51d8 100644 --- a/Roles/Standard/Impostor/Killing/Councillor.cs +++ b/Roles/Standard/Impostor/Killing/Councillor.cs @@ -126,7 +126,7 @@ public class Councillor : RoleBase case 2: { if (TryHideMsg.GetBool() && !isUI && spamRequired) - ChatManager.SendPreviousMessagesToAll(); + Utils.SendMessage("\n", pc.PlayerId, GetString("NoSpamAnymoreUseCmd")); if (!MsgToPlayerAndRole(msg, out byte targetId, out string error)) {