Whitelist reason cvar + RP server whitelist reason (#10451)

This commit is contained in:
Kara
2022-08-08 16:55:57 -07:00
committed by GitHub
parent 1eb4dfb13f
commit bbdb269b5f
3 changed files with 8 additions and 1 deletions

View File

@@ -131,7 +131,7 @@ The ban reason is: ""{ban.Reason}""
&& await _db.GetWhitelistStatusAsync(userId) == false && await _db.GetWhitelistStatusAsync(userId) == false
&& adminData is null) && adminData is null)
{ {
return (ConnectionDenyReason.Whitelist, Loc.GetString("whitelist-not-whitelisted"), null); return (ConnectionDenyReason.Whitelist, Loc.GetString(_cfg.GetCVar(CCVars.WhitelistReason)), null);
} }
return null; return null;

View File

@@ -813,6 +813,12 @@ namespace Content.Shared.CCVar
public static readonly CVarDef<bool> WhitelistEnabled = public static readonly CVarDef<bool> WhitelistEnabled =
CVarDef.Create("whitelist.enabled", false, CVar.SERVERONLY); CVarDef.Create("whitelist.enabled", false, CVar.SERVERONLY);
/// <summary>
/// The loc string to display as a disconnect reason when someone is not whitelisted.
/// </summary>
public static readonly CVarDef<string> WhitelistReason =
CVarDef.Create("whitelist.reason", "whitelist-not-whitelisted", CVar.SERVERONLY);
/* /*
* VOTE * VOTE
*/ */

View File

@@ -1,4 +1,5 @@
whitelist-not-whitelisted = You are not whitelisted. whitelist-not-whitelisted = You are not whitelisted.
whitelist-not-whitelisted-rp = You are not whitelisted. To become whitelisted, visit our Discord (which can be found at https://spacestation14.io) and check the #rp-whitelist channel.
command-whitelistadd-description = Adds the player with the given username to the server whitelist. command-whitelistadd-description = Adds the player with the given username to the server whitelist.
command-whitelistadd-help = whitelistadd <username> command-whitelistadd-help = whitelistadd <username>