1.7.3 Part Two

This commit is contained in:
Ape committed 2026-05-29 15:28:48 +02:00
1 parent 1c3224396c
commit 94c0049939
7 files changed
+104 -12

No files matched your search

+1 -1
View File
@@ -18,7 +18,7 @@
<ItemGroup>
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.735" ExcludeAssets="runtime;native" />
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2025.11.18" PrivateAssets="all" Condition="'$(Configuration)' == 'Release'"/>
<PackageReference Include="AmongUs.GameLibs.Steam" Version="2026.3.31" PrivateAssets="all" Condition="'$(Configuration)' == 'Release'"/>
<PackageReference Include="AmongUs.GameLibs.Android" Version="2025.10.14" PrivateAssets="all" Condition="'$(Configuration)' == 'Android'"/>
<PackageReference Include="BepInEx.AutoPlugin" Version="1.1.0" PrivateAssets="all" />
+43 -4
View File
@@ -20,12 +20,14 @@ public static class BanManager
#endif
public static string RemoveHtmlTags(this string str) => Regex.Replace(str, "<[^>]*?>", "");
private static readonly string DenyNameListPath = $"{DataPath}/AUR-DATA/DenyNameList.txt";
private static readonly string DenyNameListPath = $"{DataPath}/AUR-DATA/Deniednames.txt";
private static string BanListPath = $"{DataPath}/AUR-DATA/Banlist.txt";
private static string BanWordPath = $"{DataPath}/AUR-DATA/Bannedwords.txt";
private static string BanWordPath = $"{DataPath}/AUR-DATA/Deniedwords.txt";
private static string VipListPath = $"{DataPath}/AUR-DATA/VIP.txt";
private static string ModeratorListPath = $"{DataPath}/AUR-DATA/Moderator.txt";
private static string AdminListPath = $"{DataPath}/AUR-DATA/Admin.txt";
private static string TemplatePath = $"{DataPath}/AUR-DATA/Templates.txt";
public static Dictionary<string, string> Templates = new();
public static List<string> TempBanWhiteList = [];
public static void Init()
{
@@ -37,32 +39,46 @@ public static class BanManager
{
Logger.Warn("Creating a new DenyNameList.txt file", "BanManager");
File.Create(DenyNameListPath).Close();
File.WriteAllText(DenyNameListPath, Translator.Get("bannameWelcome"));
}
if (!File.Exists(BanListPath))
{
Logger.Warn("Creating a new Banlist.txt file", "BanManager");
File.Create(BanListPath).Close();
File.WriteAllText(BanListPath, Translator.Get("banlistWelcome"));
}
if (!File.Exists(BanWordPath))
{
Logger.Warn("Creating a new Banlist.txt file", "BanManager");
File.Create(BanWordPath).Close();
File.WriteAllText(BanWordPath, Translator.Get("banwordWelcome"));
}
if (!File.Exists(VipListPath))
{
Logger.Warn("Creating a new VIP.txt file", "BanManager");
File.Create(VipListPath).Close();
File.WriteAllText(VipListPath, Translator.Get("vipWelcome"));
}
if (!File.Exists(ModeratorListPath))
{
Logger.Warn("Creating a new Moderator.txt file", "BanManager");
File.Create(ModeratorListPath).Close();
File.WriteAllText(ModeratorListPath, Translator.Get("moderatorWelcome"));
}
if (!File.Exists(AdminListPath))
{
Logger.Warn("Creating a new Admin.txt file", "BanManager");
File.Create(AdminListPath).Close();
File.WriteAllText(AdminListPath, Translator.Get("adminWelcome"));
}
if (!File.Exists(TemplatePath))
{
Logger.Warn("Creating a new Templates.txt file", "BanManager");
File.Create(TemplatePath).Close();
File.WriteAllText(TemplatePath, Translator.Get("templateWelcome"));
}
LoadTemplates();
}
catch (Exception ex)
@@ -153,6 +169,7 @@ public static class BanManager
string line;
while ((line = sr.ReadLine()) != null)
{
if (line.StartsWith("#")) continue;
if (line == "") continue;
if (!OnlyCheckPuid)
{
@@ -172,7 +189,7 @@ public static class BanManager
{
if (name == "" || !AmongUsClient.Instance.AmHost) return false;
var deniedNames = File.ReadAllLines(DenyNameListPath);
var deniedNames = File.ReadAllLines(DenyNameListPath).Where(x => !x.StartsWith("#"));
if (deniedNames.Where(code => !string.IsNullOrWhiteSpace(code)).Any(code => name.Contains(code, StringComparison.OrdinalIgnoreCase)))
{
@@ -188,7 +205,7 @@ public static class BanManager
{
if (input == "" || !AmongUsClient.Instance.AmHost || Utils.CheckAccessLevel(player.Data.FriendCode) > 0) return false;
var bannedWords = File.ReadAllLines(BanWordPath);
var bannedWords = File.ReadAllLines(BanWordPath).Where(x => !x.StartsWith("#"));
if (bannedWords.Where(code => !string.IsNullOrWhiteSpace(code)).Any(code => input.Contains(code, StringComparison.OrdinalIgnoreCase)))
{
@@ -213,4 +230,26 @@ public static class BanManager
__instance.BanButton.GetComponent<ButtonRolloverHandler>().SetEnabledColors();
}
}
public static void LoadTemplates()
{
Templates.Clear();
if (!File.Exists(TemplatePath)) return;
foreach (var line in File.ReadAllLines(TemplatePath))
{
if (string.IsNullOrWhiteSpace(line)) continue;
if (line.StartsWith("#")) continue;
int splitIndex = line.IndexOf(':');
if (splitIndex == -1) continue;
string key = line[..splitIndex].Trim().ToLower();
string value = line[(splitIndex + 1)..].Trim();
if (!Templates.ContainsKey(key)) Templates.Add(key, value);
}
}
}
+30
View File
@@ -229,6 +229,24 @@ internal static class SendChatPatch
__instance.freeChatField.textArea.SetText(string.Empty);
return false;
}
if (text.StartsWith("/t "))
{
string templateName = text[3..].Trim().ToLower();
if (BanManager.Templates.TryGetValue(templateName, out string templateMessage))
{
Utils.ChatCommand(__instance, templateMessage, "", false);
}
else
{
Logger.Info($"Could not find template '{templateName}'", "TemplateManager");
HudManager.Instance.Chat.AddChat(PlayerControl.LocalPlayer, $"Template '{templateName}' not found.");
}
__instance.freeChatField.textArea.Clear();
__instance.freeChatField.textArea.SetText(string.Empty);
return false;
}
bool col1 = text.StartsWith("/col ") || text.StartsWith("/cor ");
bool col2 = text.StartsWith("/color ");
@@ -513,6 +531,8 @@ public static class RPCHandlerPatch
}
}
if (Utils.CheckAccessLevel(__instance.Data.FriendCode) < Options.SlashRolesAndGamemodeCmd.GetValue()) return;
if (text == "/r jester"){
Utils.ModeratorChatCommand(Translator.Get("jesterPublic"), "", false);}
@@ -534,6 +554,16 @@ public static class RPCHandlerPatch
if (text == "/r speedrunner"){
Utils.ModeratorChatCommand(Translator.Get("speedrunnerPublic"), "", false);}
if (text.StartsWith("/t "))
{
string templateName = text[3..].Trim().ToLower();
if (BanManager.Templates.TryGetValue(templateName, out string templateMessage))
{
Utils.ModeratorChatCommand(templateMessage, "", false);
}
}
break;
}
}
+1 -1
View File
@@ -25,7 +25,7 @@ class ExileControllerWrapUpPatch
pc = p;
}
if (ejectedPlayer == PlayerControl.LocalPlayer.Data)
if (ejectedPlayer == PlayerControl.LocalPlayer.Data && !Main.DisableInfoWhenDead.Value)
{
if (p.Data.Role.IsImpostor)
{
+9
View File
@@ -112,4 +112,13 @@ public class GameStartManagerStartPatch
}));
}
}
[HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.BeginGame))]
public class GameStartManagerBeginGamePatch
{
public static void Prefix(GameStartManager __instance)
{
if (Options.NoGameEnd.GetBool()) Logger.SendInGame(Translator.Get("noGameEndWarning"));
}
}
+5 -1
View File
@@ -15,7 +15,7 @@ internal static class CoShowIntroPatch
if (!AmongUsClient.Instance.AmHost) return;
Utils.ModeratorChatCommand(Translator.Get("abilitiesGenericOne", Options.CrewmateAbility.GetString(), Options.ScientistAbility.GetString(), Options.EngineerAbility.GetString(), Options.NoisemakerAbility.GetString(), Options.TrackerAbility.GetString()), Translator.Get("abilitiesGenericTwo", Options.DetectiveAbility.GetString(), Options.ImpostorAbility.GetString(), Options.ShapeshifterAbility.GetString(), Options.PhantomAbility.GetString(), Options.ViperAbility.GetString()), true);
//Utils.ModeratorChatCommand(Translator.Get("abilitiesGenericOne", Options.CrewmateAbility.GetString(), Options.ScientistAbility.GetString(), Options.EngineerAbility.GetString(), Options.NoisemakerAbility.GetString(), Options.TrackerAbility.GetString()), Translator.Get("abilitiesGenericTwo", Options.DetectiveAbility.GetString(), Options.ImpostorAbility.GetString(), Options.ShapeshifterAbility.GetString(), Options.PhantomAbility.GetString(), Options.ViperAbility.GetString()), true);
foreach (var p in PlayerControl.AllPlayerControls)
{
@@ -25,8 +25,12 @@ internal static class CoShowIntroPatch
MurderPlayerPatch.misfireCount[p.Data.PlayerId] = 0;
PlayerControlCompleteTaskPatch.playerTasksCompleted[p] = 0;
PlayerControlCompleteTaskPatch.tasksPerPlayer[p] = 0;
Logger.Info($" {p.Data.PlayerName} -> {p.Data.RoleType}", "RoleInfo");
}
Logger.Info($" {AbilityManagement.RoleList()}", "AbilityInfo");
if (Options.DisableAnnoyingMeetingCalls.GetBool() && !Utils.isHideNSeek)
{
Utils.CanCallMeetings = false;
+15 -5
View File
@@ -7,9 +7,9 @@
"autoStart": "Auto Start",
"enableDarkTheme": "Enable Dark Theme",
"enableLobbyMusic": "Lobby Music",
"disableInfoWhenDead": "Disable Task/Kill View",
"disableInfoWhenDead": "Hide Info When Dead",
"gameMasterWarning":"You will now spectate games until GM is turned off. WARNING: Custom role notifications will not work with this setting on!",
"gameMasterWarning":"You will now spectate games until Game Master is turned off.",
"cancelStartCountdown": "Start countdown canceled",
@@ -41,7 +41,7 @@
"tabGroupAccess": "Access Levels",
"slashColorCmd": "Who Can Use /color",
"slashRolesAndGamemodeCmd": "Who Can Use /r",
"slashRolesAndGamemodeCmd": "Who Can Use /r And Templates",
"slashLastGameCmd": "Who Can Use /l",
"slashHelpAndAurCmd": "Who Can Use /help And /aur",
"slashKickCmd": "Who Can Use /kick And /ckick",
@@ -77,7 +77,7 @@
"tabGroupSpeedrun": "Speedrun",
"speedrunSettingsOverride": "Auto Update Settings",
"gameAutoEndsAfter": "Game automatically ends after",
"engineerMode": "All Crewmates Are Engineer",
"engineerMode": "Everyone Is Engineer",
"tabGroupSabotages": "Sabotages",
"deadImpostorsCanSabotage": "Dead Impostors Can Sabotage",
@@ -260,5 +260,15 @@
"extraVotesPerKill": "Extra Votes Per Kill For Stealer",
"killsNeededForJuggernaut": "Kills Needed For Juggernaut",
"ability": "Ability"
"ability": "Ability",
"templateWelcome": "# In this file you can add Templates, which serve as easy copy-paste alternatives.\n# To create a template, write a new line with the same formatting as the test Template below.\n# Note that Templates can't be longer than 120 characters and can't contain special characters. Having so will kick you.\n\ntest: this is an example template. Type '/t test' to see it.",
"moderatorWelcome": "# In this file you can add Moderators by Friendcode.\n# If you add someone, they will gain a purple name in-game.\n# Go to 'System Settings' in-game to customize Moderator permissions. Below is a Friendcode example.\n\nfriendcode#0000",
"vipWelcome": "# In this file you can add VIP's by Friendcode.\n# If you add someone, they will gain a yellow name in-game.\n# Go to 'System Settings' in-game to customize VIP permissions. Below is a Friendcode example.\n\nfriendcode#0000\n",
"adminWelcome": "# In this file you can add Admins by Friendcode.\n# If you add someone, they will gain a red name in-game.\n# Go to 'System Settings' in-game to customize Admin permissions. Below is a Friendcode example.\n\nfriendcode#0000\n",
"banlistWelcome": "# In this file you can ban players from your lobby by Friendcode.\n# Banning someone in-game will automatically add them here as well. Below is a Friendcode example.\n\nfriendcode#0000\n",
"banwordWelcome": "# In this file you can set denied words, automatically kicking anyone in-game who sends words listed here.\n# Make sure to separate words by using new lines.",
"bannameWelcome": "# In this file you can set denied names, automatically kicking anyone in-game who uses names listed here.\n# Make sure to separate names by using new lines.",
"noGameEndWarning": "WARNING: No Game End is enabled"
}