From 73fc6cd7ef24ad13851c0ecb6b5adb33c4a352a1 Mon Sep 17 00:00:00 2001 From: PEPPERcula Date: Thu, 25 Dec 2025 05:12:45 -0700 Subject: [PATCH] Auto execute Ready Check (#447) * Update en_US.json * Update RPC.cs * Update GameOptionsMenuPatch.cs * Update Main.cs * Update GameOptionsMenuPatch.cs * Update EACList.txt * Update OptionShower.cs * Update OptionHolder.cs * Update PlayerJoinAndLeftPatch.cs * Update en_US.json * Update Main.cs * Update ChatCommandPatch.cs * Update en_US.json * Update README.md * Update en_US.json * Update en_US.json * Update OptionHolder.cs * Update Main.cs * Update GameOptionsMenuPatch.cs --- Modules/OptionHolder.cs | 17 ++++++++++++++--- Modules/OptionShower.cs | 2 +- Modules/RPC.cs | 3 --- Patches/ChatCommandPatch.cs | 2 +- Patches/GameOptionsMenuPatch.cs | 6 +++--- Patches/PlayerJoinAndLeftPatch.cs | 22 +++++++++++++++++++++- README.md | 6 ++---- Resources/Config/EACList.txt | 6 +++--- Resources/Lang/en_US.json | 18 ++++++++++-------- 9 files changed, 55 insertions(+), 27 deletions(-) diff --git a/Modules/OptionHolder.cs b/Modules/OptionHolder.cs index 1a919c365..642960fa5 100644 --- a/Modules/OptionHolder.cs +++ b/Modules/OptionHolder.cs @@ -842,7 +842,9 @@ public static class Options public static OptionItem AutoMPollCommandCooldown; public static OptionItem AutoDraftStartCommandAfterJoin; public static OptionItem AutoDraftStartCommandCooldown; - + public static OptionItem AutoReadyCheckCommandAfterJoin; + public static OptionItem AutoReadyCheckCommandCooldown; + public static OptionItem DumpLogAfterGameEnd; private static readonly string[] SuffixModes = @@ -1676,6 +1678,12 @@ public static class Options AutoDraftStartCommandCooldown = new IntegerOptionItem(19427, "AutoDraftStartCommandCooldown", new(10, 600, 5), 150, TabGroup.SystemSettings) .SetParent(AutoDraftStartCommandAfterJoin) .SetValueFormat(OptionFormat.Seconds); + + AutoReadyCheckCommandAfterJoin = new BooleanOptionItem(19433, "AutoReadyCheckCommandAfterJoin", false, TabGroup.SystemSettings); + + AutoReadyCheckCommandCooldown = new IntegerOptionItem(19434, "AutoReadyCheckCommandCooldown", new(10, 600, 5), 325, TabGroup.SystemSettings) + .SetParent(AutoReadyCheckCommandAfterJoin) + .SetValueFormat(OptionFormat.Seconds); EnterKeyToStartGame = new BooleanOptionItem(19432, "EnterKeyToStartGame", false, TabGroup.SystemSettings); @@ -2828,16 +2836,19 @@ public static class Options }); HideGuesserCommands = new BooleanOptionItem(19717, "GuesserTryHideMsg", true, TabGroup.TaskSettings) - .SetParent(GuesserMode) - .SetColor(Color.green); + .SetColor(Color.green) + .SetParent(GuesserMode); GuesserDoesntDieOnMisguess = new BooleanOptionItem(19718, "GuesserDoesntDieOnMisguess", false, TabGroup.TaskSettings) + .SetColor(Color.yellow) .SetGameMode(CustomGameMode.Standard); CanGuessDuringDiscussionTime = new BooleanOptionItem(19799, "CanGuessDuringDiscussionTime", true, TabGroup.TaskSettings) + .SetColor(Color.yellow) .SetGameMode(CustomGameMode.Standard); MisguessDeathReason = new BooleanOptionItem(44444, "MisguessDeathReason", false, TabGroup.TaskSettings) + .SetColor(Color.yellow) .SetGameMode(CustomGameMode.Standard); LoadingPercentage = 92; diff --git a/Modules/OptionShower.cs b/Modules/OptionShower.cs index 4e81c14e8..5e4659b72 100644 --- a/Modules/OptionShower.cs +++ b/Modules/OptionShower.cs @@ -87,7 +87,7 @@ public static class OptionShower } Pages.Add(""); - sb.Append($"{Utils.GetRoleName(CustomRoles.GM)}: {(Main.GM.Value ? GetString("RoleRate") : GetString("RoleOff"))}\n\n"); + sb.Append($"{Utils.GetRoleName(CustomRoles.GM)}: {(Main.GM.Value ? GetString("RoleRate") : GetString("RoleOff"))}\n\n"); var index = 0; diff --git a/Modules/RPC.cs b/Modules/RPC.cs index 58dc27bf0..d8ab5285f 100644 --- a/Modules/RPC.cs +++ b/Modules/RPC.cs @@ -679,9 +679,6 @@ internal static class RPCHandlerPatch if (!command.CanUseCommand(player)) break; command.Action(player, commandKey, text, text.Split(' ')); - - // const BindingFlags flags = BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public; - // typeof(ChatCommands).GetMethod(methodName, flags)?.Invoke(null, [player, text, text.Split(' ')]); Logger.Info($"Invoke Command: {command.Action.Method.Name} ({player?.Data?.PlayerName}, {text})", "RequestCommandProcessing"); break; } diff --git a/Patches/ChatCommandPatch.cs b/Patches/ChatCommandPatch.cs index 78331d450..764a8ccb1 100644 --- a/Patches/ChatCommandPatch.cs +++ b/Patches/ChatCommandPatch.cs @@ -194,7 +194,7 @@ internal static class ChatCommands ["Command.DraftStart"] = new(["draftstart", "ds", "драфтстарт", "启用草稿", "todosescolhem-iniciar"], "", GetString("CommandDescription.DraftStart"), Command.UsageLevels.HostOrModerator, Command.UsageTimes.InLobby, DraftStartCommand, true, false), ["Command.DraftDescription"] = new(["dd", "draftdesc", "draftdescription", "драфтописание", "драфтопис", "草稿描述", "todosescolhem-descricao"], "{index}", GetString("CommandDescription.DraftDescription"), Command.UsageLevels.Everyone, Command.UsageTimes.InLobby, DraftDescriptionCommand, false, false, [GetString("CommandArgs.DraftDescription.Index")]), ["Command.Draft"] = new(["draft", "драфт", "选择草稿", "todosescolhem-escolher"], "{number}", GetString("CommandDescription.Draft"), Command.UsageLevels.Everyone, Command.UsageTimes.InLobby, DraftCommand, false, false, [GetString("CommandArgs.Draft.Number")]), - ["Command.ReadyCheck"] = new(["rc", "readycheck", "проверитьготовность", "准备检测", "verificação-de-prontidão"], "", GetString("CommandDescription.ReadyCheck"), Command.UsageLevels.HostOrAdmin, Command.UsageTimes.InLobby, ReadyCheckCommand, true, false), + ["Command.ReadyCheck"] = new(["rc", "readycheck", "проверитьготовность", "准备检测", "verificação-de-prontidão"], "", GetString("CommandDescription.ReadyCheck"), Command.UsageLevels.HostOrModerator, Command.UsageTimes.InLobby, ReadyCheckCommand, true, false), ["Command.Ready"] = new(["ready", "готов", "准备", "pronto"], "", GetString("CommandDescription.Ready"), Command.UsageLevels.Everyone, Command.UsageTimes.InLobby, ReadyCommand, true, false), ["Command.EnableAllRoles"] = new(["enableallroles", "вклвсероли", "启用所有职业", "habilitar-todas-as-funções"], "", GetString("CommandDescription.EnableAllRoles"), Command.UsageLevels.Host, Command.UsageTimes.InLobby, EnableAllRolesCommand, true, false), ["Command.Achievements"] = new(["achievements", "достижения", "成就", "conquistas"], "", GetString("CommandDescription.Achievements"), Command.UsageLevels.Modded, Command.UsageTimes.Always, AchievementsCommand, true, false), diff --git a/Patches/GameOptionsMenuPatch.cs b/Patches/GameOptionsMenuPatch.cs index fdc0fd23e..cba17dc7a 100644 --- a/Patches/GameOptionsMenuPatch.cs +++ b/Patches/GameOptionsMenuPatch.cs @@ -812,7 +812,7 @@ public static class StringOptionPatch if (instance == null) return string.Empty; Team team = instance.Team; - if ((int)team is 1 or 2 or 4) return $" {GetColoredShortTeamName(team)}"; + if ((int)team is 1 or 2 or 4 or 8) return $" {GetColoredShortTeamName(team)}"; Team[] teams = (int)team switch { @@ -949,7 +949,6 @@ public static class GameSettingMenuPatch private static readonly Vector3 ButtonPositionRight = new(-2.4f, -0.55f, 0f); private static readonly Vector3 ButtonSize = new(0.45f, 0.35f, 1f); - // private static readonly Vector3 ButtonSize = new(0.45f, 0.6f, 1f); private static GameOptionsMenu TemplateGameOptionsMenu; private static PassiveButton TemplateGameSettingsButton; @@ -1503,4 +1502,5 @@ public static class RpcSyncSettingsPatch { OptionItem.SyncAllOptions(); } -} \ No newline at end of file + +} diff --git a/Patches/PlayerJoinAndLeftPatch.cs b/Patches/PlayerJoinAndLeftPatch.cs index 7114d8776..2aace899b 100644 --- a/Patches/PlayerJoinAndLeftPatch.cs +++ b/Patches/PlayerJoinAndLeftPatch.cs @@ -183,6 +183,25 @@ internal static class OnGameJoinedPatch if (Options.AutoDraftStartCommandAfterJoin.GetBool()) ChatCommands.DraftStartCommand(PlayerControl.LocalPlayer, "Command.DraftStart", "/draftstart", ["/draftstart"]); } + + if (Options.AutoReadyCheckCommandAfterJoin.GetBool()) + { + Main.Instance.StartCoroutine(CoRoutine()); + + IEnumerator CoRoutine() + { + float timer = Options.AutoReadyCheckCommandCooldown.GetInt(); + + while (timer > 0) + { + if (!GameStates.IsLobby) yield break; + timer -= Time.deltaTime; + yield return null; + } + + if (Options.AutoReadyCheckCommandAfterJoin.GetBool()) + ChatCommands.ReadyCheckCommand(PlayerControl.LocalPlayer, "Command.ReadyCheck", "/readycheck", ["/readycheck"]); + } } if (Options.AutoGMRotationEnabled) @@ -895,4 +914,5 @@ internal static class NetworkedPlayerInfoInitPatch } } } -} \ No newline at end of file + +} diff --git a/README.md b/README.md index ea96f1c80..6ba233c93 100644 --- a/README.md +++ b/README.md @@ -243,7 +243,7 @@ You can also report bugs and suggest features in the #bug-reports and #suggestio | /afkexempt | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | | /os | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | | /unmute | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | -| /readycheck | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | +| /readycheck | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | /end | :x: | :x: | :x: | :heavy_check_mark: | :heavy_check_mark: | | Lobby tag | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | @@ -364,7 +364,7 @@ Click this badge to view our translation project: | /draftstart
/ds | Start drafting, where players may choose their roles for the next game | – | :red_circle: Host, Moderators, And Admins | :green_square: In Lobby | :x: | | /dd
/draftdesc
/draftdescription | View the description of one of the roles you got in the draft. | 🔸 **index** – The number in the drafting message of the role to view the description of
| :purple_circle: Everyone | :green_square: In Lobby | :x: | | /draft | Choose a role in the draft | 🔸 **number** – The number of the role to choose
| :purple_circle: Everyone | :green_square: In Lobby | :x: | -| /rc
/readycheck | Start a ready check (check who is AFK) (results displayed after 30s) | – | :white_circle: Host And Admins | :green_square: In Lobby | :x: | +| /rc
/readycheck | Start a ready check (check who is AFK) (results displayed after 30s) | – | :red_circle: Host, Moderators, And Admins | :green_square: In Lobby | :x: | | /ready | Mark yourself as ready | – | :purple_circle: Everyone | :green_square: In Lobby | :x: | | /enableallroles | Enables all roles and add-ons | – | :yellow_circle: Host | :green_square: In Lobby | :x: | | /achievements | See which achievements you have unlocked and which you haven't | – | :green_circle: Modded Clients | :purple_square: Always | :x: | @@ -703,5 +703,3 @@ If you have any questions about this Privacy Policy or how your data is handled, ------------------------------------------------------------------------------------------------------------ By using the Endless Host Roles mod, you agree to the terms outlined in this Privacy Policy. - - diff --git a/Resources/Config/EACList.txt b/Resources/Config/EACList.txt index eba86282e..9894eb4c3 100644 --- a/Resources/Config/EACList.txt +++ b/Resources/Config/EACList.txt @@ -90,11 +90,11 @@ woveelixir#4088 | 42044d211 | DMD 3CD | Cheating | Cheater and probably Boomplay tenpalace#1924 | 6a259fcd9 | Goaty | Cheating | pinbrittle#1538 | 4955c179f | Moralmaser | Cheating | Cheating and disrupting lobbies dollfly#4791 | 5ba449454 | Mari | Cheating | Spamming RPCs to crash lobbies - byechic#6270 | 91e0145f1 | (Contains n word) | Harassing a streamer with a slur in the IGN | waiverfore#0496 | b493df896 | | Cheating in Syl's lobby | whaleutter#4768 | 9e04dc5d5 | | Cheating in Syl's lobby | No name cheater -whimrecent#6558 | f8452a9d1 | | Cheating | no name cheater +whimrecent#6558 | f8452a9d1 | | Cheating | No name cheater + ## Griefers, Toxic, harrasing, morons setmolar#4374 | | 藏族顶针 | Toxic | overtfeast#5802 | | 黑影 | Toxic | @@ -126,4 +126,4 @@ primesnow#4272 | 65b98a6de | HiverXM | Toxic | The n word tenthrope#3476 | | Oldishwire | Other | greencorps#9587 | 4a403fe31 | ellsbells | Other | finlucky#6381 | 433b2e672 | Wuwu | Other | -nattertame#9540 | 0abd54784 | Wuwu | Other | Alt account +nattertame#9540 | 0abd54784 | Wuwu | Other | Alt account \ No newline at end of file diff --git a/Resources/Lang/en_US.json b/Resources/Lang/en_US.json index 3a7e755b8..988a5b4c9 100644 --- a/Resources/Lang/en_US.json +++ b/Resources/Lang/en_US.json @@ -482,7 +482,7 @@ "EvilTrackerInfo": "Track players by shifting", "AntiAdminerInfo": "Track device usage", "ArroganceInfo": "Your cooldown decreases with each kill you make", - "BomberInfo": "Shapeshift to explode", + "BomberInfo": "Vanish to explode", "TrapsterInfo": "Start a killing chain", "ScavengerInfo": "Your kills are unreportable", "EvilGuesserInfo": "Guess roles in meetings to kill", @@ -680,7 +680,7 @@ "NotAssignedInfo": "Error, report to host!!", "SunnyboyInfo": "Shine, shine my sunshine!", "BardInfo": "Poem's grace, murder's trace, a rhythmic dance in a dark embrace.", - "NukerInfo": "Shapeshift to nuke everyone", + "NukerInfo": "Vanish to nuke everyone", "EngineerEHRInfoLong": "(Crewmates):\\nAs the Engineer, you may access the vents while comms are not sabotaged. Vents are disabled when they are sabotaged.", "ScientistEHRInfoLong": "(Crewmates):\\nAs the Scientist, you have a portable tablet with the crew's vitals on it. Use this any way you'd like. Catching self-reports, extra intel on body age, etc.", "ShapeshifterEHRInfoLong": "(Impostors):\\nAs the Shapeshifter, you have a shapeshifting ability that you may use to frame other crewmates. Just be aware that there is an egg while shifting, and the disguise is temporary.", @@ -933,8 +933,8 @@ "DisablePlayerVotedMessage": "Disable 'X has voted. Y remaining.' Message in Meetings", "LadderDeath": "Fall From Ladders", "LadderDeathChance": "Fall To Death Chance", - "GuesserDoesntDieOnMisguess": "Guesser Doesn't Die on Misguess", - "CanGuessDuringDiscussionTime": "Guessers Can Guess During Discussion Time", + "GuesserDoesntDieOnMisguess": "Guesser Doesn't Die on Misguess", + "CanGuessDuringDiscussionTime": "Guessers Can Guess During Discussion Time", "MisguessDeathReason": "'Misguess' Death Reason", "YouCanGuessTitle": "<#00ffff>You can Guess!", "YouCanGuess": "Use the /bt [player id] [role] command to guess someone's role. You can see everyone's IDs next to their name, or type /id.", @@ -1091,6 +1091,8 @@ "AutoMPollCommandCooldown": "Delay Before Auto Executing /mpoll (After Joining The Lobby)", "AutoDraftStartCommandAfterJoin": "Auto Execute /draftstart After Joining The Lobby", "AutoDraftStartCommandCooldown": "Delay Before Auto Executing /draftstart (After Joining The Lobby)", + "AutoReadyCheckCommandAfterJoin": "Auto Execute /readycheck After Joining The Lobby", + "AutoReadyCheckCommandCooldown": "Delay Before Auto Executing /readycheck (After Joining The Lobby)", "EnterKeyToStartGame": "Begin the starting countdown by pressing the Enter key", "RemovePetsAtDeadPlayers": "Remove pets from dead players", "SeeEjectedRolesInMeeting": "See ejected roles in meetings", @@ -1266,7 +1268,7 @@ "MenuTitle.Guessers": "★ Guesser Mode ★", "MenuTitle.CTA": "★ Custom Team Assignment ★", "MenuTitle.AFKDetection": "★ AFK Detection ★", - "ReadyCheckMessage": "The Host/an Admin is checking how many players are ready to start the game.\\nPlease type /ready to let the Host/Admins know you're not AFK.", + "ReadyCheckMessage": "The Host/a Staff is checking how many players are ready to start the game.\\nPlease type /ready to let the Host/Staff know you're not AFK.", "ReadyCheckTitle": "<#ffff00>★ Ready Check ★", "EveryoneReadyTitle": "<#00ff00>Everyone is ready!", "PlayersNotReadyTitle": "<#ffff00><#ffab1b>{0} players are not ready! They are:", @@ -2353,7 +2355,7 @@ "Message.NoDescription": "No description", "Message.KickedByDenyName": "{0} was kicked because their name matched {1}", "Message.BanedByBanList": "{0} was banned because they were banned in the past.", - "Message.BanedByEACList": "{0} has been banned because he is in EAC list of Banned people.", + "Message.BanedByEACList": "{0} has been banned because they're in the EAC list of Banned people.", "Message.InvalidFriendCode": "{0} has been banned because they have an invalid friend code.", "Message.DumpfileSaved": "The log file was successfully saved to the desktop, filename: {0}", "Message.KickedByNoFriendCode": "{0} was kicked because their friend code does not exist.", @@ -4422,7 +4424,7 @@ "HitmanLowKCD": "Lower Kill Cooldown", "Sapper": "Sapper", "SapperInfo": "Blow up Everyone with Timed Bombs!", - "SapperInfoLong": "(Impostors):\\nAs the Sapper, you can not kill with your kill button. Instead, you can pet/vanish to plant time bombs which explode after a specified delay (set by host), killing everyone nearby.\\n\\nNote: If you're in the radius of the explosion, you will die too!", + "SapperInfoLong": "(Impostors):\\nAs the Sapper, you can pet/vanish to plant time bombs which explode after a specified delay (set by host), killing everyone nearby.\\n\\nNote: If you're in the radius of the explosion, you will die too!", "SapperRadius": "Bomb Explosion Radius", "SapperCD": "Bomb Place Cooldown", "SapperDelay": "Bomb Explode Delay", @@ -10201,7 +10203,7 @@ "ForceEnd": "Aborted", "EveryoneDied": "Everyone died", "GameTimerEnded": "Game Time Limit Ended", - "ForceEndText": "The Host/an Admin has aborted the game", + "ForceEndText": "The Host/a Staff has aborted the game", "BlackScreenFixCompleteNotify": "<#00ff00>Black Screen Fix Code Executed", "MinMaxModdedImpCountsSettingsChangedAuto": "<#ffff00>Modded Min/Max Impostors Automatically Set To <#ffffff>{0}\\nBecause you only changed the vanilla setting, which gets overridden by the modded ones.", "DiscoChangeInterval": "Disco Change Color Interval",