zio fork 1.8.2b-zio3: ban reasons on join, @css/bypassipban, spectators keep hidden
Some checks failed
Build and Publish / build (push) Has been cancelled
Build and Publish / publish (push) Has been cancelled

Banned players are let in long enough to be told the ban's reason and time left, then kicked
after KickTime, instead of only seeing "Your client is not allowed to join this server"; they
can't chat, talk or join a team meanwhile. New permission @css/bypassipban (players or groups,
implied by @css/root) skips IP and shared-IP bans, leaving only bans on their own SteamID, on
join and in the periodic check. Moving to spectators no longer unhides a hidden admin; only
joining T or CT does.
This commit is contained in:
Astra 2026-09-28 11:23:11 +01:00
parent 6171162ae9
commit 2069c1a690
8 changed files with 142 additions and 25 deletions

View file

@ -132,6 +132,18 @@ internal static class Helper
}
}
// zio: "2d 4h", "3h 15m", "45m" or "less than a minute", for time left on a penalty.
internal static string FormatRemaining(TimeSpan remaining)
{
if (remaining.TotalMinutes < 1)
return "less than a minute";
var parts = new List<string>();
if (remaining.Days > 0) parts.Add($"{remaining.Days}d");
if (remaining.Hours > 0) parts.Add($"{remaining.Hours}h");
if (remaining.Minutes > 0 && remaining.Days == 0) parts.Add($"{remaining.Minutes}m");
return string.Join(" ", parts);
}
public static void KickPlayer(int userId, NetworkDisconnectionReason reason = NetworkDisconnectionReason.NETWORK_DISCONNECT_KICKED, int delay = 0)
{
var player = Utilities.GetPlayerFromUserid(userId);