From 9ec4b0867e1821357d27bb8a4c849360df0fe9b5 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Fri, 19 Aug 2022 16:42:47 +1000 Subject: [PATCH] Whitelist shell feedback (#10694) Co-authored-by: Visne <39844191+Visne@users.noreply.github.com> --- Content.Server/Whitelist/WhitelistCommands.cs | 14 ++++++++++++++ Resources/Locale/en-US/connection-messages.ftl | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/Content.Server/Whitelist/WhitelistCommands.cs b/Content.Server/Whitelist/WhitelistCommands.cs index c503c8453c..59b576e7ca 100644 --- a/Content.Server/Whitelist/WhitelistCommands.cs +++ b/Content.Server/Whitelist/WhitelistCommands.cs @@ -31,10 +31,17 @@ public sealed class AddWhitelistCommand : IConsoleCommand var guid = data.UserId; var isWhitelisted = await db.GetWhitelistStatusAsync(guid); if (isWhitelisted) + { + shell.WriteLine(Loc.GetString("command-whitelistadd-existing", ("username", data.Username))); return; + } await db.AddToWhitelistAsync(guid); + shell.WriteLine(Loc.GetString("command-whitelistadd-added", ("username", data.Username))); + return; } + + shell.WriteError(Loc.GetString("command-whitelistadd-not-found", ("username", args[0]))); } } @@ -60,10 +67,17 @@ public sealed class RemoveWhitelistCommand : IConsoleCommand var guid = data.UserId; var isWhitelisted = await db.GetWhitelistStatusAsync(guid); if (!isWhitelisted) + { + shell.WriteLine(Loc.GetString("command-whitelistremove-existing", ("username", data.Username))); return; + } await db.RemoveFromWhitelistAsync(guid); + shell.WriteLine(Loc.GetString("command-whitelistremove-removed", ("username", data.Username))); + return; } + + shell.WriteError(Loc.GetString("command-whitelistremove-not-found", ("username", args[0]))); } } diff --git a/Resources/Locale/en-US/connection-messages.ftl b/Resources/Locale/en-US/connection-messages.ftl index a17b202718..752dacac66 100644 --- a/Resources/Locale/en-US/connection-messages.ftl +++ b/Resources/Locale/en-US/connection-messages.ftl @@ -3,9 +3,15 @@ whitelist-not-whitelisted-rp = You are not whitelisted. To become whitelisted, v command-whitelistadd-description = Adds the player with the given username to the server whitelist. command-whitelistadd-help = whitelistadd +command-whitelistadd-existing = {$username} is already on the whitelist! +command-whitelistadd-added = {$username} added to the whitelist +command-whitelistadd-not-found = Unable to find '{$username}' command-whitelistremove-description = Removes the player with the given username from the server whitelist. command-whitelistremove-help = whitelistremove +command-whitelistremove-existing = {$username} is not on the whitelist! +command-whitelistremove-removed = {$username} removed from the whitelist +command-whitelistremove-not-found = Unable to find '{$username}' command-kicknonwhitelisted-description = Kicks all non-whitelisted players from the server. command-kicknonwhitelisted-help = kicknonwhitelisted