zio fork 1.8.2b-zio3: ban reasons on join, @css/bypassipban, spectators keep hidden
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:
parent
6171162ae9
commit
2069c1a690
8 changed files with 142 additions and 25 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue