mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Add CVars for privacy policy information (#5545)
* Add CVars for privacy policy information Engine side of https://github.com/space-wizards/SS14.Launcher/issues/194 * Improve/fix cvar desc
This commit is contained in:
committed by
GitHub
parent
1621d25a92
commit
aca7847933
@@ -103,6 +103,22 @@ namespace Robust.Server.ServerStatus
|
||||
["desc"] = _serverDescCache,
|
||||
};
|
||||
|
||||
var privacyPolicyLink = _cfg.GetCVar(CVars.StatusPrivacyPolicyLink);
|
||||
var privacyPolicyIdentifier = _cfg.GetCVar(CVars.StatusPrivacyPolicyIdentifier);
|
||||
var privacyPolicyVersion = _cfg.GetCVar(CVars.StatusPrivacyPolicyVersion);
|
||||
|
||||
if (!string.IsNullOrEmpty(privacyPolicyLink)
|
||||
&& !string.IsNullOrEmpty(privacyPolicyIdentifier)
|
||||
&& !string.IsNullOrEmpty(privacyPolicyVersion))
|
||||
{
|
||||
jObject["privacy_policy"] = new JsonObject
|
||||
{
|
||||
["identifier"] = privacyPolicyIdentifier,
|
||||
["version"] = privacyPolicyVersion,
|
||||
["link"] = privacyPolicyLink,
|
||||
};
|
||||
}
|
||||
|
||||
OnInfoRequest?.Invoke(jObject);
|
||||
|
||||
await context.RespondJsonAsync(jObject);
|
||||
|
||||
@@ -628,6 +628,43 @@ namespace Robust.Shared
|
||||
public static readonly CVarDef<string> StatusConnectAddress =
|
||||
CVarDef.Create("status.connectaddress", "", CVar.ARCHIVE | CVar.SERVERONLY);
|
||||
|
||||
/// <summary>
|
||||
/// HTTP(S) link to a privacy policy that the user must accept to connect to the server.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This must be set along with <see cref="StatusPrivacyPolicyIdentifier"/> and
|
||||
/// <see cref="StatusPrivacyPolicyVersion"/> for the user to be prompted about a privacy policy.
|
||||
/// </remarks>
|
||||
public static readonly CVarDef<string> StatusPrivacyPolicyLink =
|
||||
CVarDef.Create("status.privacy_policy_link", "https://example.com/privacy", CVar.SERVER | CVar.REPLICATED);
|
||||
|
||||
/// <summary>
|
||||
/// An identifier for privacy policy specified by <see cref="StatusPrivacyPolicyLink"/>.
|
||||
/// This must be globally unique.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This value must be globally unique per server community. Servers that want to enforce a
|
||||
/// privacy policy should set this to a value that is unique to their server and, preferably, recognizable.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// This value is stored by the launcher to keep track of what privacy policies a player has accepted.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public static readonly CVarDef<string> StatusPrivacyPolicyIdentifier =
|
||||
CVarDef.Create("status.privacy_policy_identifier", "", CVar.SERVER | CVar.REPLICATED);
|
||||
|
||||
/// <summary>
|
||||
/// A "version" for the privacy policy specified by <see cref="StatusPrivacyPolicyLink"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This parameter is stored by the launcher and should be modified whenever your server's privacy policy changes.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public static readonly CVarDef<string> StatusPrivacyPolicyVersion =
|
||||
CVarDef.Create("status.privacy_policy_version", "", CVar.SERVER | CVar.REPLICATED);
|
||||
|
||||
/*
|
||||
* BUILD
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user