- Fixed rare problems with expiring bans
- More checks for `BanType`
- Minor changes about validating players
- Added `css_players -duplicate` to list players with same ip address
This commit is contained in:
Dawid Bepierszcz
2024-05-02 13:51:07 +02:00
parent c25d3c4bda
commit 9fb256d39f
9 changed files with 165 additions and 139 deletions

View File

@@ -59,16 +59,14 @@ namespace CS2_SimpleAdmin
public static List<CCSPlayerController> GetValidPlayers()
{
return Utilities.GetPlayers().FindAll(p =>
p.IsValid && p.SteamID.ToString().Length == 17 && !string.IsNullOrEmpty(p.IpAddress) && p is
{ Connected: PlayerConnectedState.PlayerConnected, IsBot: false, IsHLTV: false });
return Utilities.GetPlayers().FindAll(p => p is
{ IsBot: false, IsHLTV: false });
}
public static IEnumerable<CCSPlayerController?> GetValidPlayersWithBots()
{
return Utilities.GetPlayers().FindAll(p =>
p.IsValid && p.SteamID.ToString().Length == 17 && !string.IsNullOrEmpty(p.IpAddress) && p is { Connected: PlayerConnectedState.PlayerConnected, IsBot: false, IsHLTV: false } ||
p is { IsValid: true, Connected: PlayerConnectedState.PlayerConnected, IsBot: true, IsHLTV: false }
p is { IsBot: false, IsHLTV: false } or { IsBot: true, IsHLTV: false }
);
}