Add more Admin perms for players (#355)

* Update ChatCommandPatch.cs

* Update ChatCommandPatch.cs

* Update ClientPatch.cs

* Update ControlPatch.cs

* Update en_US.json

* Update en_US.json

* Update en_US.json

* Update README.md

* Update README.md

* Update README.md

* add parentheses

* remove unnecessary check

* again

* this made 0 sense

this would have prevented the host from banning players if they haven't added themselves as an admin 💀

* fix this

---------

Co-authored-by: Gurge44 <90392754+Gurge44@users.noreply.github.com>
This commit is contained in:
PEPPERculaandGurge44 authored and GitHub committed 2025-09-14 09:43:26 +02:00
1 parent ba1d79cce1
commit 2c87c43b3c
5 files changed
+48 -30

No files matched your search

+11 -7
View File
@@ -21,7 +21,6 @@ using static EHR.Translator;
// ReSharper disable InconsistentNaming
namespace EHR;
internal class Command(string[] commandForms, string arguments, string description, Command.UsageLevels usageLevel, Command.UsageTimes usageTime, Action<PlayerControl, string, string[]> action, bool isCanceled, bool alwaysHidden, string[] argsDescriptions = null)
@@ -149,7 +148,7 @@ internal static class ChatCommands
new(["deletemod", "убрмодера", "удмодера", "убратьмодера", "удалитьмодера", "移除协管", "moderador-remover"], "{id}", GetString("CommandDescription.DeleteMod"), Command.UsageLevels.Host, Command.UsageTimes.Always, DeleteModCommand, true, false, [GetString("CommandArgs.DeleteMod.Id")]),
new(["combo", "комбо", "设置不会同时出现的职业", "combinação", "combinar"], "{mode} {role} {addon} [all]", GetString("CommandDescription.Combo"), Command.UsageLevels.Host, Command.UsageTimes.Always, ComboCommand, true, false, [GetString("CommandArgs.Combo.Mode"), GetString("CommandArgs.Combo.Role"), GetString("CommandArgs.Combo.Addon"), GetString("CommandArgs.Combo.All")]),
new(["eff", "effect", "эффект", "效果", "efeito"], "{effect}", GetString("CommandDescription.Effect"), Command.UsageLevels.Host, Command.UsageTimes.InGame, EffectCommand, true, false, [GetString("CommandArgs.Effect.Effect")]),
new(["afkexempt", "освафк", "афкосв", "挂机检测器不会检测", "afk-isentar"], "{id}", GetString("CommandDescription.AFKExempt"), Command.UsageLevels.Host, Command.UsageTimes.Always, AFKExemptCommand, true, false, [GetString("CommandArgs.AFKExempt.Id")]),
new(["afkexempt", "освафк", "афкосв", "挂机检测器不会检测", "afk-isentar"], "{id}", GetString("CommandDescription.AFKExempt"), Command.UsageLevels.HostOrAdmin, Command.UsageTimes.Always, AFKExemptCommand, true, false, [GetString("CommandArgs.AFKExempt.Id")]),
new(["m", "myrole", "м", "мояроль", "我的职业", "minhafunção"], "", GetString("CommandDescription.MyRole"), Command.UsageLevels.Everyone, Command.UsageTimes.InGame, MyRoleCommand, true, false),
new(["tpout", "тпаут", "传送出"], "", GetString("CommandDescription.TPOut"), Command.UsageLevels.Everyone, Command.UsageTimes.InLobby, TPOutCommand, true, false),
new(["tpin", "тпин", "传送进"], "", GetString("CommandDescription.TPIn"), Command.UsageLevels.Everyone, Command.UsageTimes.InLobby, TPInCommand, true, false),
@@ -188,11 +187,11 @@ internal static class ChatCommands
new(["os", "optionset", "шансроли", "设置职业生成概率"], "{chance} {role}", GetString("CommandDescription.OS"), Command.UsageLevels.Host, Command.UsageTimes.InLobby, OSCommand, true, false, [GetString("CommandArgs.OS.Chance"), GetString("CommandArgs.OS.Role")]),
new(["negotiation", "neg", "наказание", "谈判方式", "negociar", "negociação"], "{number}", GetString("CommandDescription.Negotiation"), Command.UsageLevels.Everyone, Command.UsageTimes.InMeeting, NegotiationCommand, true, false, [GetString("CommandArgs.Negotiation.Number")]),
new(["mute", "замутить", "мут", "禁言", "mutar", "silenciar"], "{id} [duration]", GetString("CommandDescription.Mute"), Command.UsageLevels.HostOrModerator, Command.UsageTimes.AfterDeathOrLobby, MuteCommand, true, false, [GetString("CommandArgs.Mute.Id"), GetString("CommandArgs.Mute.Duration")]),
new(["unmute", "размутить", "размут", "解禁", "desmutar", "desilenciar"], "{id}", GetString("CommandDescription.Unmute"), Command.UsageLevels.Host, Command.UsageTimes.Always, UnmuteCommand, true, false, [GetString("CommandArgs.Unmute.Id")]),
new(["unmute", "размутить", "размут", "解禁", "desmutar", "desilenciar"], "{id}", GetString("CommandDescription.Unmute"), Command.UsageLevels.HostOrAdmin, Command.UsageTimes.Always, UnmuteCommand, true, false, [GetString("CommandArgs.Unmute.Id")]),
new(["draftstart", "ds", "драфтстарт", "启用草稿", "todosescolhem-iniciar"], "", GetString("CommandDescription.DraftStart"), Command.UsageLevels.HostOrModerator, Command.UsageTimes.InLobby, DraftStartCommand, true, false),
new(["dd", "draftdesc", "draftdescription", "драфтописание", "драфтопис", "草稿描述", "todosescolhem-descricao"], "{index}", GetString("CommandDescription.DraftDescription"), Command.UsageLevels.Everyone, Command.UsageTimes.InLobby, DraftDescriptionCommand, false, false, [GetString("CommandArgs.DraftDescription.Index")]),
new(["draft", "драфт", "选择草稿", "todosescolhem-escolher"], "{number}", GetString("CommandDescription.Draft"), Command.UsageLevels.Everyone, Command.UsageTimes.InLobby, DraftCommand, false, false, [GetString("CommandArgs.Draft.Number")]),
new(["rc", "readycheck", "проверитьготовность", "准备检测", "verificação-de-prontidão"], "", GetString("CommandDescription.ReadyCheck"), Command.UsageLevels.Host, Command.UsageTimes.InLobby, ReadyCheckCommand, true, false),
new(["rc", "readycheck", "проверитьготовность", "准备检测", "verificação-de-prontidão"], "", GetString("CommandDescription.ReadyCheck"), Command.UsageLevels.HostOrAdmin, Command.UsageTimes.InLobby, ReadyCheckCommand, true, false),
new(["ready", "готов", "准备", "pronto"], "", GetString("CommandDescription.Ready"), Command.UsageLevels.Everyone, Command.UsageTimes.InLobby, ReadyCommand, true, false),
new(["enableallroles", "вклвсероли", "启用所有职业", "habilitar-todas-as-funções"], "", GetString("CommandDescription.EnableAllRoles"), Command.UsageLevels.Host, Command.UsageTimes.InLobby, EnableAllRolesCommand, true, false),
new(["achievements", "достижения", "成就", "conquistas"], "", GetString("CommandDescription.Achievements"), Command.UsageLevels.Modded, Command.UsageTimes.Always, AchievementsCommand, true, false),
@@ -1248,7 +1247,7 @@ internal static class ChatCommands
{
if (!AmongUsClient.Instance.AmHost)
{
RequestCommandProcessingFromHost(nameof(ReadyCheckCommand), text);
RequestCommandProcessingFromHost(nameof(ReadyCheckCommand), text, adminCommand: true);
return;
}
@@ -1445,7 +1444,7 @@ internal static class ChatCommands
{
if (!AmongUsClient.Instance.AmHost)
{
RequestCommandProcessingFromHost(nameof(UnmuteCommand), text);
RequestCommandProcessingFromHost(nameof(UnmuteCommand), text, adminCommand: true);
return;
}
@@ -1454,6 +1453,7 @@ internal static class ChatCommands
MutedPlayers.Remove(id);
Utils.SendMessage("\n", player.PlayerId, string.Format(GetString("PlayerUnmuted"), id.ColoredPlayerName()));
Utils.SendMessage("\n", id, string.Format(GetString("YouUnmuted"), player.PlayerId.ColoredPlayerName()));
if (!player.IsHost()) Utils.SendMessage("\n", 0, string.Format(GetString("AdminUnmuted"), player.PlayerId.ColoredPlayerName(), id.ColoredPlayerName()));
}
private static void NegotiationCommand(PlayerControl player, string text, string[] args)
@@ -2437,7 +2437,7 @@ internal static class ChatCommands
{
if (!AmongUsClient.Instance.AmHost)
{
RequestCommandProcessingFromHost(nameof(AFKExemptCommand), text);
RequestCommandProcessingFromHost(nameof(AFKExemptCommand), text, adminCommand: true);
return;
}
@@ -3825,3 +3825,7 @@ internal static class RpcSendChatPatch
return false;
}
}
+3
View File
@@ -211,3 +211,6 @@ internal static class AuthTimeoutPatch
#endif
}
+14 -7
View File
@@ -55,7 +55,12 @@ internal static class ControllerManagerUpdatePatch
else
InGameRoleInfoMenu.Hide();
if (Input.GetKeyDown(KeyCode.F11))
bool admin = ChatCommands.IsPlayerAdmin(PlayerControl.LocalPlayer.FriendCode);
if (KeysDown(KeyCode.Return, KeyCode.C, KeyCode.LeftShift) && admin)
HudManager.Instance.Chat.SetVisible(true);
if (KeysDown(KeyCode.F11, KeyCode.LeftAlt))
{
ResolutionIndex++;
if (ResolutionIndex >= Resolutions.Length) ResolutionIndex = 0;
@@ -84,12 +89,10 @@ internal static class ControllerManagerUpdatePatch
Utils.DumpLog();
}
if (KeysDown(KeyCode.LeftAlt, KeyCode.C) && !Input.GetKey(KeyCode.LeftShift) && !GameStates.IsNotJoined) Utils.CopyCurrentSettings();
if (KeysDown(KeyCode.LeftAlt, KeyCode.C) && !Input.GetKey(KeyCode.LeftShift) && !GameStates.IsNotJoined)
Utils.CopyCurrentSettings();
if (!AmongUsClient.Instance.AmHost) return;
if (KeysDown(KeyCode.Return, KeyCode.C, KeyCode.LeftShift))
HudManager.Instance.Chat.SetVisible(true);
if (!AmongUsClient.Instance.AmHost && !admin) return;
if (KeysDown(KeyCode.Return, KeyCode.L, KeyCode.LeftShift) && GameStates.IsInGame)
{
@@ -97,6 +100,8 @@ internal static class ControllerManagerUpdatePatch
GameEndChecker.CheckCustomEndCriteria();
}
if (!AmongUsClient.Instance.AmHost) return;
if (KeysDown(KeyCode.Return, KeyCode.C, KeyCode.LeftShift, KeyCode.LeftControl) && GameStates.IsInGame)
Utils.SetChatVisibleForAll();
@@ -447,4 +452,6 @@ public static class InGameRoleInfoMenu
Menu?.SetActive(false);
}
}
}
}
+17 -14
View File
@@ -49,7 +49,7 @@ Share the download link with your friends: [bit.ly/downloadehr](https://bit.ly/d
## Want to become a beta tester?
Join our Discord server and download the latest test build from the #test-builds channel.
You do **NOT** need to pay, boost the server, donate, be a VIP, contributor or anything like that.
You do **NOT** need to pay, boost the server, donate, be a VIP, Contributor or anything like that.
In this mod and its discord server, everything is free.
We don't want your money, we want your feedback.
You can also report bugs and suggest features in the #bug-reports and #suggestions channels.
@@ -66,9 +66,9 @@ You can also report bugs and suggest features in the #bug-reports and #suggestio
### Visit this website to find role descriptions: [Role description finder](https://gurge44.pythonanywhere.com/)
#### Over 400 roles and add-ons, 12 custom game modes, and a custom team assigner application, making EHR the most extensive mod for Among Us. And it's all free, and only the host needs to have the mod installed for the entire lobby to play!
#### Over 400+ roles and add-ons, 13 custom game modes, and a Custom Team Assigner application, making EHR the most extensive mod for Among Us. And it's all free, and only the host needs to have the mod installed for the entire lobby to play!
## List of Roles <span style="font-size: 12px;">(excluding (Custom) Hide and Seek roles and vanilla roles)</span>
## List of Roles <span style="font-size: 12px;">(excluding (Custom) Hide And Seek roles and Vanilla roles)</span>
| Crewmates | Impostors | Neutrals | Coven | Add-ons |
|-------------------|-----------------|-------------------|---------------|----------------|
@@ -101,7 +101,7 @@ You can also report bugs and suggest features in the #bug-reports and #suggestio
| Dad | Disperser | The Glitch | | Diseased |
| Demolitionist | Duellist | God | | Dynamo |
| Deputy | Dazzler | Hater | | Disregarded |
| Detective | Echo | Head Hunter | | Double Shot |
| Forensic | Echo | Head Hunter | | Double Shot |
| Detour | Escapist | Hex Master | | Egoist |
| Dictator | Evil Eraser | Hookshot | | Energetic |
| Doctor | Evil Guesser | Pulse | | Entranced |
@@ -204,7 +204,7 @@ You can also report bugs and suggest features in the #bug-reports and #suggestio
| | | | | |
| 129 | 98 | 107 | 17 | 95 |
## VIP and Moderator perks
## VIP, Moderator, and Admin perks
:heavy_check_mark: Can always use the command<br>
:x: Can never use the command<br>
@@ -249,7 +249,7 @@ Source language: English
- /up was reworked to /setrole, allowing you to set anyone's role for the next game, not only yours.
- You can fully gain access to /setrole by just hosting EHR lobbies weekly or uploading EHR content to YouTube, but
everyone can use /setrole to set their own role without any requirements (essentially /up).
- EHR has a custom team assigner application, which is a unique feature that no other mod has.
- EHR has a Custom Team Assigner application, which is a unique feature that no other mod has.
- You can force or ban certain role/add-on combinations directly in the game using /combo.
- Not sure how to use commands? Use /help to see a list of all available commands.
- EHR helps the host use commands by directly displaying their short descriptions, arguments, descriptions for all
@@ -257,7 +257,7 @@ Source language: English
- You can also press TAB to autocomplete commands.
- Some hints and tips are displayed during the loading screen and ejection animations, which can help you discover new
features.
- EHR has 12 unique custom game modes, which can be played with any number of players, some even alone.
- EHR has 13 unique custom game modes, which can be played with any number of players, some even alone.
- You can make lobbies with more than 15 players on modded servers, just type /cs players 100 - for example - to set the
player limit to 100.
- I, the main developer of EHR, care about user feedback and suggestions, and I try to implement them as much as
@@ -293,7 +293,7 @@ Source language: English
| /deletemod | Removes the specified player from the list of moderators | &#x1F538; **id** – The player's ID to remove from the list of moderators<br> | :yellow_circle: Host | :purple_square: Always | :x: |
| /combo | Set roles and add-ons that always or never spawn together | &#x1F538; **mode** – add/ban/remove/allow (leave blank to view all combos)<br>&#x1F538; **role** – The name of the main role in 1 word<br>&#x1F538; **addon** – The name of the add-on in 1 word<br>&#x1F539; **all** – Whether to apply to all presets (all/[blank])<br> | :yellow_circle: Host | :purple_square: Always | :x: |
| /eff<br>/effect | Apply a Randomizer effect to yourself | &#x1F538; **effect** – The name of the effect to apply<br> | :yellow_circle: Host | :white_large_square: In Game | :x: |
| /afkexempt | Exempt a player from being checked by the AFK detector | &#x1F538; **id** – The player's ID to exempt from AFK detection<br> | :yellow_circle: Host | :purple_square: Always | :x: |
| /afkexempt | Exempt a player from being checked by the AFK detector | &#x1F538; **id** – The player's ID to exempt from AFK detection<br> | :white_circle: Host And Admins | :purple_square: Always | :x: |
| /m<br>/myrole | View the description and settings of your role | – | :purple_circle: Everyone | :white_large_square: In Game | :x: |
| /tpout | Teleport out of the lobby | – | :purple_circle: Everyone | :green_square: In Lobby | :x: |
| /tpin | Teleport into the lobby | – | :purple_circle: Everyone | :green_square: In Lobby | :x: |
@@ -332,11 +332,11 @@ Source language: English
| /os<br>/optionset | Set the spawn chance of a role | &#x1F538; **chance** – The spawn chance for the role<br>&#x1F538; **role** – The role to set the spawn chance for<br> | :yellow_circle: Host | :green_square: In Lobby | :x: |
| /negotiation<br>/neg | Pick your negotiation method when asked by the Negotiator | &#x1F538; **number** – The index of the picked negotiation method (0/1/2/3)<br> | :purple_circle: Everyone | :yellow_square: In Meetings | :x: |
| /mute | Mute someone. Muted players can't chat. Everyone is unmuted on game start. | &#x1F538; **id** – The player's ID to mute<br>&#x1F539; **duration** – The duration in seconds (leaving blank => 60s)<br> | :red_circle: Host, Moderators, And Admins | :brown_square: After Death And In Lobby | :x: |
| /unmute | Unmute someone. | &#x1F538; **id** – The player's ID to unmute<br> | :yellow_circle: Host | :purple_square: Always | :x: |
| /unmute | Unmute someone. | &#x1F538; **id** – The player's ID to unmute<br> | :white_circle: Host And Admins | :purple_square: Always | :x: |
| /draftstart<br>/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<br>/draftdesc<br>/draftdescription | View the description of one of the roles you got in the draft. | &#x1F538; **index** – The number in the drafting message of the role to view the description of<br> | :purple_circle: Everyone | :green_square: In Lobby | :x: |
| /draft | Choose a role in the draft | &#x1F538; **number** – The number of the role to choose<br> | :purple_circle: Everyone | :green_square: In Lobby | :x: |
| /rc<br>/readycheck | Start a ready check (check who is AFK) (results displayed after 30s) | – | :yellow_circle: Host | :green_square: In Lobby | :x: |
| /rc<br>/readycheck | Start a ready check (check who is AFK) (results displayed after 30s) | – | :white_circle: Host 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: |
@@ -384,14 +384,14 @@ Source language: English
### :star: [Town Of Host Re-Edited](https://github.com/Loonie-Toons/) :
>
> - Our repo is forked from TOHRE (from a long time ago)
> - Our repository is forked from TOHRE (from a long time ago)
> - Ported PhantomRolePatch.cs (partially broken)
>
### :star: [Town Of Host Edited / Town Of Next](https://github.com/KARPED1EM/TownOfHostEdited) :
>
> - Our repo is a continuation of Town Of Host Edited
> - Our repository is a continuation of Town Of Host Edited
> - Town Of Next reference: Modify character limit for chat messages
> - Town Of Next reference: Modify and apply cool animations on Main Menu
>
@@ -399,7 +399,7 @@ Source language: English
### :star: [TOH](https://github.com/tukasa0001/TownOfHost) :
>
> - Our repo is based initially on TOH
> - Our repository is based initially on TOH
>
### :star: [TOHY](https://github.com/Yumenopai/TownOfHost_Y) :
@@ -515,7 +515,7 @@ Source language: English
- PH_Gaming
- TommyXL
- Drakos
- Peppercula
- PEPPERcula
##### Special Thanks:
@@ -667,3 +667,6 @@ 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.
+3 -2
View File
@@ -1256,7 +1256,7 @@
"MenuTitle.Guessers": "★ Guesser Mode ★",
"MenuTitle.CTA": "★ Custom Team Assignment ★",
"MenuTitle.AFKDetection": "★ AFK Detection ★",
"ReadyCheckMessage": "The host is checking how many players are ready to start the game.\\nPlease type <b>/ready</b> to let the host know you're not AFK.",
"ReadyCheckMessage": "The host/an Admin is checking how many players are ready to start the game.\\nPlease type <b>/ready</b> to let the host know you're not AFK.",
"ReadyCheckTitle": "<#ffff00>★ Ready Check ★</color>",
"EveryoneReadyTitle": "<#00ff00>Everyone is ready!</color>",
"PlayersNotReadyTitle": "<#ffff00><#ffab1b>{0}</color> players are not ready!</color> They are:",
@@ -2625,6 +2625,7 @@
"ModeratorMuted": "Moderator {0} has muted {1} for <#00ffa5>{2}</color> seconds.",
"PlayerUnmuted": "You've successfully unmuted {0}.",
"YouUnmuted": "{0} has unmuted you.",
"AdminUnmuted": "Admin {0} has unmuted {1}.",
"MuteMessage": "<#ff0000>You're muted and cannot send messages. The mute will expire in <#ffff00>{0}</color> seconds.</color>",
"WhisperTitle": "{0} <#ffffff>(ID <#00ffa5>{1}</color>) whispers to you:</color>",
"HWhisperTitle": "<#ff0000>The Host <size=70%>({0})</size> whispers a <#00ffff>help</color> to you:</color>",
@@ -9851,7 +9852,7 @@
"ErrorEndTextDescription": "To avoid crashing, the game was forcibly ended.",
"ForceEnd": "Aborted",
"EveryoneDied": "Everyone died",
"ForceEndText": "Host has aborted the game",
"ForceEndText": "The Host/an Admin has aborted the game",
"BlackScreenFixCompleteNotify": "<#00ff00>Black Screen Fix Code Executed</color>",
"MinMaxModdedImpCountsSettingsChangedAuto": "<#ffff00><b>Modded Min/Max Impostors Automatically Set To </color><#ffffff>{0}</color></b>\\n<size=80%>Because you only changed the vanilla setting, which gets overridden by the modded ones.</size>",
"DiscoChangeInterval": "Disco Change Color Interval",