mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-09-27 20:17:04 +02:00
Refactored IP ban checking logic in CacheManager for improved accuracy and maintainability. Replaced StatusBlocker plugin binaries with v1.1.3 for both Linux and Windows. EOL, no more new features
42 lines
982 B
C#
42 lines
982 B
C#
using System.ComponentModel;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace CS2_SimpleAdmin.Models;
|
|
|
|
public enum BanStatus
|
|
{
|
|
[Description("ACTIVE")] ACTIVE,
|
|
[Description("UNBANNED")] UNBANNED,
|
|
[Description("EXPIRED")] EXPIRED,
|
|
[Description("")] UNKNOWN
|
|
}
|
|
|
|
public record BanRecord
|
|
{
|
|
[Column("id")]
|
|
public int Id { get; init; }
|
|
|
|
[Column("player_name")]
|
|
public string? PlayerName { get; set; }
|
|
|
|
[Column("player_steamid")]
|
|
public ulong? PlayerSteamId { get; set; }
|
|
|
|
[Column("player_ip")]
|
|
public string? PlayerIp { get; set; }
|
|
|
|
[Column("created")]
|
|
public DateTime Created { get; init; }
|
|
|
|
[Column("status")]
|
|
public required string Status { get; init; }
|
|
|
|
[NotMapped]
|
|
public BanStatus StatusEnum => Status.ToUpper() switch
|
|
{
|
|
"ACTIVE" => BanStatus.ACTIVE,
|
|
"UNBANNED" => BanStatus.UNBANNED,
|
|
"EXPIRED" => BanStatus.EXPIRED,
|
|
_ => BanStatus.UNKNOWN
|
|
};
|
|
}
|