mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-10-18 12:57:04 +02:00
upstream to 1.7.7-alpha-10
This commit is contained in:
commit
2de2924cef
106 changed files with 5897 additions and 3306 deletions
|
|
@ -1,18 +1,39 @@
|
|||
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; set; }
|
||||
|
||||
public int Id { get; init; }
|
||||
|
||||
[Column("player_name")]
|
||||
public string? PlayerName { get; set; }
|
||||
|
||||
[Column("player_steamid")]
|
||||
public string? PlayerSteamId { get; set; }
|
||||
|
||||
public ulong? PlayerSteamId { get; set; }
|
||||
|
||||
[Column("player_ip")]
|
||||
public string? PlayerIp { get; set; }
|
||||
|
||||
|
||||
[Column("status")]
|
||||
public string? Status { get; set; }
|
||||
public required string Status { get; init; }
|
||||
|
||||
[NotMapped]
|
||||
public BanStatus StatusEnum => Status.ToUpper() switch
|
||||
{
|
||||
"ACTIVE" => BanStatus.ACTIVE,
|
||||
"UNBANNED" => BanStatus.UNBANNED,
|
||||
"EXPIRED" => BanStatus.EXPIRED,
|
||||
_ => BanStatus.UNKNOWN
|
||||
};
|
||||
}
|
||||
|
|
|
|||
12
CS2-SimpleAdmin/Models/PlayerDto.cs
Normal file
12
CS2-SimpleAdmin/Models/PlayerDto.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
namespace CS2_SimpleAdmin.Models;
|
||||
|
||||
public record PlayerStats(int Score, int Kills, int Deaths, int MVPs);
|
||||
public record PlayerDto(
|
||||
int UserId,
|
||||
string Name,
|
||||
string SteamId,
|
||||
string IpAddress,
|
||||
uint Ping,
|
||||
bool IsAdmin,
|
||||
PlayerStats Stats
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue