9386 Permanent ban message change (#11325)
This commit is contained in:
@@ -42,16 +42,14 @@ namespace Content.Server.Connection
|
||||
var ban = await _db.GetServerBanByIpAsync(eventArgs.Connection.RemoteEndPoint.Address);
|
||||
if (ban != null)
|
||||
{
|
||||
var expires = "This is a permanent ban.";
|
||||
var expires = Loc.GetString("ban-banned-permanent");
|
||||
if (ban.ExpirationTime is { } expireTime)
|
||||
{
|
||||
var duration = expireTime - ban.BanTime;
|
||||
var utc = expireTime.ToUniversalTime();
|
||||
expires = $"This ban is for {duration.TotalMinutes} minutes and will expire at {utc:f} UTC.";
|
||||
expires = Loc.GetString("ban-expires", ("duration", duration.TotalMinutes.ToString("N0")), ("time", utc.ToString("f")));
|
||||
}
|
||||
var reason = $@"You, or another user of this computer or connection is banned from playing here.
|
||||
The ban reason is: ""{ban.Reason}""
|
||||
{expires}";
|
||||
var reason = Loc.GetString("ban-banned-1") + "\n" + Loc.GetString("ban-banned-2", ("reason", this.Reason)) + "\n" + expires;;
|
||||
return NetApproval.Deny(reason);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,14 +55,15 @@ namespace Content.Server.Database
|
||||
public string DisconnectMessage
|
||||
{
|
||||
get {
|
||||
var expires = "This is a permanent ban.";
|
||||
var expires = Loc.GetString("ban-banned-permanent");
|
||||
if (this.ExpirationTime is { } expireTime)
|
||||
{
|
||||
var duration = expireTime - this.BanTime;
|
||||
var utc = expireTime.ToUniversalTime();
|
||||
expires = $"This ban is for {duration.TotalMinutes:N0} minutes and will expire at {utc:f} UTC.";
|
||||
expires = Loc.GetString("ban-expires", ("duration", duration.TotalMinutes.ToString("N0")), ("time", utc.ToString("f")));
|
||||
}
|
||||
return $"You, or another user of this computer or connection, are banned from playing here.\nThe ban reason is: \"{this.Reason}\"\n{expires}";
|
||||
var details = Loc.GetString("ban-banned-1") + "\n" + Loc.GetString("ban-banned-2", ("reason", this.Reason)) + "\n" + expires;
|
||||
return details;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,5 +16,10 @@ command-whitelistremove-not-found = Unable to find '{$username}'
|
||||
command-kicknonwhitelisted-description = Kicks all non-whitelisted players from the server.
|
||||
command-kicknonwhitelisted-help = kicknonwhitelisted
|
||||
|
||||
ban-banned-permanent = This ban is appeal only.
|
||||
ban-expires = This ban is for {$duration} minutes and will expire at {$time} UTC.
|
||||
ban-banned-1 = You, or another user of this computer or connection, are banned from playing here.
|
||||
ban-banned-2 = The ban reason is: "{$reason}"
|
||||
|
||||
soft-player-cap-full = The server is full!
|
||||
panic-bunker-account-denied = This server is in Panic mode and you were rejected. Contact the server administrator for help.
|
||||
|
||||
Reference in New Issue
Block a user