Better notes and bans (#14228)

Co-authored-by: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>
This commit is contained in:
Riggle
2023-07-21 13:38:52 +02:00
committed by GitHub
parent c6cb6ad928
commit 579913b617
84 changed files with 9820 additions and 886 deletions

View File

@@ -1,6 +1,7 @@
using System.Collections.Immutable;
using System.Collections.Immutable;
using System.Net;
using Content.Shared.CCVar;
using Content.Shared.Database;
using Robust.Shared.Configuration;
using Robust.Shared.Network;
@@ -16,7 +17,10 @@ namespace Content.Server.Database
public DateTimeOffset BanTime { get; }
public DateTimeOffset? ExpirationTime { get; }
public int? RoundId { get; }
public TimeSpan PlaytimeAtNote { get; }
public string Reason { get; }
public NoteSeverity Severity { get; set; }
public NetUserId? BanningAdmin { get; }
public ServerUnbanDef? Unban { get; }
@@ -27,7 +31,10 @@ namespace Content.Server.Database
ImmutableArray<byte>? hwId,
DateTimeOffset banTime,
DateTimeOffset? expirationTime,
int? roundId,
TimeSpan playtimeAtNote,
string reason,
NoteSeverity severity,
NetUserId? banningAdmin,
ServerUnbanDef? unban)
{
@@ -49,7 +56,10 @@ namespace Content.Server.Database
HWId = hwId;
BanTime = banTime;
ExpirationTime = expirationTime;
RoundId = roundId;
PlaytimeAtNote = playtimeAtNote;
Reason = reason;
Severity = severity;
BanningAdmin = banningAdmin;
Unban = unban;
}
@@ -66,10 +76,9 @@ namespace Content.Server.Database
else
{
var appeal = cfg.GetCVar(CCVars.InfoLinksAppeal);
if (!string.IsNullOrWhiteSpace(appeal))
expires = loc.GetString("ban-banned-permanent-appeal", ("link", appeal));
else
expires = loc.GetString("ban-banned-permanent");
expires = !string.IsNullOrWhiteSpace(appeal)
? loc.GetString("ban-banned-permanent-appeal", ("link", appeal))
: loc.GetString("ban-banned-permanent");
}
return $"""