From dcc85b21c3c856ec29cd73fad33eab69367aea88 Mon Sep 17 00:00:00 2001 From: daffyyyy Date: Mon, 4 Dec 2023 17:34:21 +0100 Subject: [PATCH] Hotfix for cssharp 101 Hotfix for non-main thread --- BanManager.cs | 65 ++++++++--------------------- CS2-SimpleAdmin.cs | 101 ++++++++++++++++++++++++++++++++++++--------- Events.cs | 71 ++++++++++++++++++++++++++++--- Helper.cs | 3 +- MuteManager.cs | 53 +++++++----------------- PlayerInfo.cs | 17 ++++++++ 6 files changed, 197 insertions(+), 113 deletions(-) create mode 100644 PlayerInfo.cs diff --git a/BanManager.cs b/BanManager.cs index 13a74b5..f41d5bf 100644 --- a/BanManager.cs +++ b/BanManager.cs @@ -1,9 +1,5 @@ -using CounterStrikeSharp.API.Core; -using CounterStrikeSharp.API.Modules.Entities; -using Dapper; +using Dapper; using MySqlConnector; -using System.Data; -using System.Xml.Linq; namespace CS2_SimpleAdmin { @@ -15,10 +11,8 @@ public BanManager(string connectionString) { _dbConnection = new MySqlConnection(connectionString); } - public async Task BanPlayer(CCSPlayerController? player, CCSPlayerController? issuer, string reason, int time = 0) + public async Task BanPlayer(PlayerInfo player, PlayerInfo issuer, string reason, int time = 0) { - if (player == null || !player.IsValid || player.AuthorizedSteamID == null) return; - DateTime now = DateTime.Now; DateTime futureTime = now.AddMinutes(time); @@ -30,11 +24,11 @@ public async Task BanPlayer(CCSPlayerController? player, CCSPlayerController? is await connection.ExecuteAsync(sql, new { - playerSteamid = player.AuthorizedSteamID.SteamId64.ToString(), - playerName = player.PlayerName, - playerIp = player.IpAddress!.Split(":")[0], - adminSteamid = issuer == null ? "Console" : issuer.AuthorizedSteamID?.SteamId64.ToString(), - adminName = issuer == null ? "Console" : issuer.PlayerName, + playerSteamid = player.SteamId, + playerName = player.Name, + playerIp = player.IpAddress, + adminSteamid = issuer.SteamId == null ? "Console" : issuer.SteamId, + adminName = issuer.Name == null ? "Console" : issuer.Name, banReason = reason, duration = time, ends = futureTime, @@ -42,7 +36,7 @@ public async Task BanPlayer(CCSPlayerController? player, CCSPlayerController? is }); } - public async Task AddBanBySteamid(string playerSteamId, CCSPlayerController? issuer, string reason, int time = 0) + public async Task AddBanBySteamid(string playerSteamId, PlayerInfo issuer, string reason, int time = 0) { if (string.IsNullOrEmpty(playerSteamId)) return; @@ -58,8 +52,8 @@ public async Task AddBanBySteamid(string playerSteamId, CCSPlayerController? iss await connection.ExecuteAsync(sql, new { playerSteamid = playerSteamId, - adminSteamid = issuer == null ? "Console" : issuer.AuthorizedSteamID?.SteamId64.ToString(), - adminName = issuer == null ? "Console" : issuer.PlayerName, + adminSteamid = issuer.SteamId == null ? "Console" : issuer.SteamId, + adminName = issuer.Name == null ? "Console" : issuer.Name, banReason = reason, duration = time, ends = futureTime, @@ -67,7 +61,7 @@ public async Task AddBanBySteamid(string playerSteamId, CCSPlayerController? iss }); } - public async Task AddBanByIp(string playerIp, CCSPlayerController? issuer, string reason, int time = 0) + public async Task AddBanByIp(string playerIp, PlayerInfo issuer, string reason, int time = 0) { if (string.IsNullOrEmpty(playerIp)) return; @@ -83,8 +77,8 @@ public async Task AddBanByIp(string playerIp, CCSPlayerController? issuer, strin await connection.ExecuteAsync(sql, new { playerIp, - adminSteamid = issuer == null ? "Console" : issuer?.AuthorizedSteamID?.SteamId64.ToString(), - adminName = issuer == null ? "Console" : issuer.PlayerName, + adminSteamid = issuer.SteamId == null ? "Console" : issuer.SteamId, + adminName = issuer.Name == null ? "Console" : issuer.Name, banReason = reason, duration = time, ends = futureTime, @@ -92,7 +86,7 @@ public async Task AddBanByIp(string playerIp, CCSPlayerController? issuer, strin }); } - public async Task IsPlayerBanned(string steamId, string? ipAddress = null) + public async Task IsPlayerBanned(PlayerInfo player) { DateTime now = DateTime.Now; @@ -103,13 +97,13 @@ public async Task IsPlayerBanned(string steamId, string? ipAddress = null) await using var connection = _dbConnection; await connection.OpenAsync(); - if (!string.IsNullOrEmpty(ipAddress)) + if (!string.IsNullOrEmpty(player.IpAddress)) { - banCount = await connection.ExecuteScalarAsync(sql, new { PlayerSteamID = steamId, PlayerIP = ipAddress, CurrentTime = now }); + banCount = await connection.ExecuteScalarAsync(sql, new { PlayerSteamID = player.SteamId, PlayerIP = player.IpAddress, CurrentTime = now }); } else { - banCount = await connection.ExecuteScalarAsync(sql, new { PlayerSteamID = steamId, PlayerIP = DBNull.Value, CurrentTime = now }); + banCount = await connection.ExecuteScalarAsync(sql, new { PlayerSteamID = player.SteamId, PlayerIP = DBNull.Value, CurrentTime = now }); } return banCount > 0; @@ -137,30 +131,5 @@ public async Task ExpireOldBans() string sql = "UPDATE sa_bans SET status = 'EXPIRED' WHERE status = 'ACTIVE' AND `duration` > 0 AND ends <= @CurrentTime"; await connection.ExecuteAsync(sql, new { CurrentTime = DateTime.Now }); } - - public async Task CheckBan(CCSPlayerController? player) - { - if (player == null || !player.IsValid || player.AuthorizedSteamID == null) return; - - string steamId = player.AuthorizedSteamID.SteamId64.ToString(); - string? ipAddress = player.IpAddress?.Split(":")[0]; - - bool isBanned = false; - - if (ipAddress != null) - { - isBanned = await IsPlayerBanned(steamId, ipAddress); - } - else - { - isBanned = await IsPlayerBanned(steamId); - } - - if (isBanned) - { - Helper.KickPlayer(player.UserId, "Banned"); - } - } - } } diff --git a/CS2-SimpleAdmin.cs b/CS2-SimpleAdmin.cs index 091a41a..da52c81 100644 --- a/CS2-SimpleAdmin.cs +++ b/CS2-SimpleAdmin.cs @@ -12,7 +12,7 @@ using System.Collections.Concurrent; namespace CS2_SimpleAdmin; -[MinimumApiVersion(98)] +[MinimumApiVersion(101)] public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig { public static ConcurrentBag gaggedPlayers = new ConcurrentBag(); @@ -22,7 +22,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig "CS2-SimpleAdmin"; public override string ModuleDescription => ""; public override string ModuleAuthor => "daffyy"; - public override string ModuleVersion => "1.0.4b"; + public override string ModuleVersion => "1.0.4c"; public CS2_SimpleAdminConfig Config { get; set; } = new(); @@ -138,12 +138,11 @@ public void OnKickCommand(CCSPlayerController? caller, CommandInfo command) if (command.ArgCount >= 2) { player!.PrintToCenter($"{Config.Messages.PlayerKickMessage}".Replace("{REASON}", reason).Replace("{ADMIN}", caller?.PlayerName == null ? "Console" : caller.PlayerName)); - AddTimer(Config.KickTime, () => Helper.KickPlayer(player!.UserId, reason)); - + AddTimer(Config.KickTime, () => Helper.KickPlayer((ushort)player.UserId!, reason)); } else { - AddTimer(Config.KickTime, () => Helper.KickPlayer(player!.UserId)); + AddTimer(Config.KickTime, () => Helper.KickPlayer((ushort)player.UserId!)); } Server.PrintToChatAll(Helper.ReplaceTags($" {Config.Prefix} {Config.Messages.AdminKickMessage}".Replace("{REASON}", reason).Replace("{ADMIN}", caller?.PlayerName == null ? "Console" : caller.PlayerName).Replace("{PLAYER}", player.PlayerName))); @@ -162,14 +161,30 @@ public void OnGagCommand(CCSPlayerController? caller, CommandInfo command) int time = 0; string reason = "Unknown"; - MuteManager _muteManager = new(dbConnectionString); - int.TryParse(command.GetArg(2), out time); if (command.ArgCount >= 3) reason = command.GetArg(3); - _ = _muteManager.MutePlayer(player, caller, reason, time, 0); + PlayerInfo playerInfo = new PlayerInfo + { + SteamId = player?.AuthorizedSteamID?.SteamId64.ToString(), + Name = player?.PlayerName, + IpAddress = player?.IpAddress?.Split(":")[0] + }; + + PlayerInfo adminInfo = new PlayerInfo + { + SteamId = caller?.AuthorizedSteamID?.SteamId64.ToString(), + Name = caller?.PlayerName, + IpAddress = caller?.IpAddress?.Split(":")[0] + }; + + Task.Run(async () => + { + MuteManager _muteManager = new(dbConnectionString); + await _muteManager.MutePlayer(playerInfo, adminInfo, reason, time); + }); if (TagsDetected) NativeAPI.IssueServerCommand($"css_tag_mute {player!.Index.ToString()}"); @@ -184,8 +199,9 @@ public void OnGagCommand(CCSPlayerController? caller, CommandInfo command) if (player == null || !player.IsValid || player.AuthorizedSteamID == null) return; if (TagsDetected) - NativeAPI.IssueServerCommand($"css_tag_unmute {player.Index.ToString()}"); + NativeAPI.IssueServerCommand($"css_tag_unmute {player.Index}"); + MuteManager _muteManager = new(dbConnectionString); _ = _muteManager.UnmutePlayer(player.AuthorizedSteamID.SteamId64.ToString(), 0); }, CounterStrikeSharp.API.Modules.Timers.TimerFlags.STOP_ON_MAPCHANGE); } @@ -229,7 +245,14 @@ public void OnAddGagCommand(CCSPlayerController? caller, CommandInfo command) if (command.ArgCount >= 3) reason = command.GetArg(3); - _ = _muteManager.AddMuteBySteamid(steamid, caller, reason, time, 0); + PlayerInfo adminInfo = new PlayerInfo + { + SteamId = caller?.AuthorizedSteamID?.SteamId64.ToString(), + Name = caller?.PlayerName, + IpAddress = caller?.IpAddress?.Split(":")[0] + }; + + _ = _muteManager.AddMuteBySteamid(steamid, adminInfo, reason, time, 0); List matches = Helper.GetPlayerFromSteamid64(steamid); if (matches.Count == 1) @@ -360,6 +383,7 @@ public void OnBanCommand(CCSPlayerController? caller, CommandInfo command) { if (!GetTarget(command, out var player)) return; + if (player == null || !player.IsValid || player.AuthorizedSteamID == null) return; if (command.ArgCount < 2) return; @@ -368,14 +392,30 @@ public void OnBanCommand(CCSPlayerController? caller, CommandInfo command) player!.Pawn.Value!.Freeze(); - BanManager _banManager = new(dbConnectionString); - int.TryParse(command.GetArg(2), out time); if (command.ArgCount >= 3) reason = command.GetArg(3); - _ = _banManager.BanPlayer(player, caller, reason, time); + PlayerInfo playerInfo = new PlayerInfo + { + SteamId = player?.AuthorizedSteamID?.SteamId64.ToString(), + Name = player?.PlayerName, + IpAddress = player?.IpAddress?.Split(":")[0] + }; + + PlayerInfo adminInfo = new PlayerInfo + { + SteamId = caller?.AuthorizedSteamID?.SteamId64.ToString(), + Name = caller?.PlayerName, + IpAddress = caller?.IpAddress?.Split(":")[0] + }; + + Task.Run(async () => + { + BanManager _banManager = new(dbConnectionString); + await _banManager.BanPlayer(playerInfo, adminInfo, reason, time); + }); if (time == 0) { @@ -388,7 +428,7 @@ public void OnBanCommand(CCSPlayerController? caller, CommandInfo command) Server.PrintToChatAll(Helper.ReplaceTags($" {Config.Prefix} {Config.Messages.AdminBanMessageTime}".Replace("{REASON}", reason).Replace("{TIME}", time.ToString()).Replace("{ADMIN}", caller?.PlayerName == null ? "Console" : caller.PlayerName).Replace("{PLAYER}", player.PlayerName))); } - AddTimer(Config.KickTime, () => Helper.KickPlayer(player!.UserId)); + AddTimer(Config.KickTime, () => Helper.KickPlayer((ushort)player.UserId!)); } [ConsoleCommand("css_addban")] @@ -418,7 +458,18 @@ public void OnAddBanCommand(CCSPlayerController? caller, CommandInfo command) if (command.ArgCount >= 3) reason = command.GetArg(3); - _ = _banManager.AddBanBySteamid(steamid, caller, reason, time); + PlayerInfo adminInfo = new PlayerInfo + { + SteamId = caller?.AuthorizedSteamID?.SteamId64.ToString(), + Name = caller?.PlayerName, + IpAddress = caller?.IpAddress?.Split(":")[0] + }; + + Task.Run(async () => + { + BanManager _banManager = new(dbConnectionString); + await _banManager.AddBanBySteamid(steamid, adminInfo, reason, time); + }); List matches = Helper.GetPlayerFromSteamid64(steamid); if (matches.Count == 1) @@ -439,7 +490,7 @@ public void OnAddBanCommand(CCSPlayerController? caller, CommandInfo command) Server.PrintToChatAll(Helper.ReplaceTags($" {Config.Prefix} {Config.Messages.AdminBanMessageTime}".Replace("{REASON}", reason).Replace("{TIME}", time.ToString()).Replace("{ADMIN}", caller?.PlayerName == null ? "Console" : caller.PlayerName).Replace("{PLAYER}", player.PlayerName))); } - AddTimer(Config.KickTime, () => Helper.KickPlayer(player.UserId)); + AddTimer(Config.KickTime, () => Helper.KickPlayer((ushort)player.UserId!)); } } command.ReplyToCommand($"Banned player with steamid {steamid}."); @@ -465,15 +516,24 @@ public void OnBanIp(CCSPlayerController? caller, CommandInfo command) int time = 0; string reason = "Unknown"; - BanManager _banManager = new(dbConnectionString); + PlayerInfo adminInfo = new PlayerInfo + { + SteamId = caller?.AuthorizedSteamID?.SteamId64.ToString(), + Name = caller?.PlayerName, + IpAddress = caller?.IpAddress?.Split(":")[0] + }; + + Task.Run(async () => + { + BanManager _banManager = new(dbConnectionString); + await _banManager.AddBanByIp(ipAddress, adminInfo, reason, time); + }); int.TryParse(command.GetArg(2), out time); if (command.ArgCount >= 3) reason = command.GetArg(3); - _ = _banManager.AddBanByIp(ipAddress, caller, reason, time); - List matches = Helper.GetPlayerFromIp(ipAddress); if (matches.Count == 1) { @@ -493,9 +553,10 @@ public void OnBanIp(CCSPlayerController? caller, CommandInfo command) Server.PrintToChatAll(Helper.ReplaceTags($" {Config.Prefix} {Config.Messages.AdminBanMessageTime}".Replace("{REASON}", reason).Replace("{TIME}", time.ToString()).Replace("{ADMIN}", caller?.PlayerName == null ? "Console" : caller.PlayerName).Replace("{PLAYER}", player.PlayerName))); } - AddTimer(Config.KickTime, () => Helper.KickPlayer(player.UserId)); + AddTimer(Config.KickTime, () => Helper.KickPlayer((ushort)player.UserId!, "Banned")); } } + command.ReplyToCommand($"Banned player with IP address {ipAddress}."); } diff --git a/Events.cs b/Events.cs index 8b63485..a39702a 100644 --- a/Events.cs +++ b/Events.cs @@ -35,7 +35,7 @@ private void OnClientAuthorized(int playerSlot, SteamID steamID) CCSPlayerController? player = Utilities.GetPlayerFromIndex(playerIndex); - if (player.AuthorizedSteamID == null) + if (player == null || !player.IsValid || player.AuthorizedSteamID == null) { AddTimer(3.0f, () => { @@ -44,11 +44,72 @@ private void OnClientAuthorized(int playerSlot, SteamID steamID) return; } - BanManager _banManager = new(dbConnectionString); - MuteManager _muteManager = new(dbConnectionString); + PlayerInfo playerInfo = new PlayerInfo + { + UserId = player.UserId, + Index = (int)player.Index, + SteamId = player?.AuthorizedSteamID?.SteamId64.ToString(), + Name = player?.PlayerName, + IpAddress = player?.IpAddress?.Split(":")[0] + }; + + Task.Run(async () => + { + if (player == null) return; + BanManager _banManager = new(dbConnectionString); + bool isBanned = await _banManager.IsPlayerBanned(playerInfo); + + MuteManager _muteManager = new(dbConnectionString); + List activeMutes = await _muteManager.IsPlayerMuted(playerInfo.SteamId); + + Server.NextFrame(() => + { + if (player == null) return; + if (isBanned) + { + Helper.KickPlayer((ushort)player.UserId!, "Banned"); + return; + } + + if (activeMutes.Count > 0) + { + foreach (var mute in activeMutes) + { + string muteType = mute.type; + TimeSpan duration = mute.ends - mute.created; + int durationInSeconds = (int)duration.TotalSeconds; + + if (muteType == "GAG") + { + if (!gaggedPlayers.Any(index => index == player.Index)) + gaggedPlayers.Add((int)player.Index); + + if (TagsDetected) + NativeAPI.IssueServerCommand($"css_tag_mute {player.Index}"); + + /* + CCSPlayerController currentPlayer = player; + + if (mute.duration == 0 || durationInSeconds >= 1800) continue; + + await Task.Delay(TimeSpan.FromSeconds(durationInSeconds)); + + if (currentPlayer != null && currentPlayer.IsValid) + { + NativeAPI.IssueServerCommand($"css_tag_unmute {currentPlayer.Index.ToString()}"); + await UnmutePlayer(currentPlayer.AuthorizedSteamID.SteamId64.ToString(), 0); + } + */ + } + else + { + // Mic mute + } + } + } + }); + }); - _ = _banManager.CheckBan(player); - _ = _muteManager.CheckMute(player); } private void OnClientDisconnect(int playerSlot) diff --git a/Helper.cs b/Helper.cs index bf6940d..fc5d2ba 100644 --- a/Helper.cs +++ b/Helper.cs @@ -1,6 +1,5 @@ using CounterStrikeSharp.API.Core; using CounterStrikeSharp.API; -using MySqlConnector; using CounterStrikeSharp.API.Modules.Utils; using System.Reflection; using System.Text.RegularExpressions; @@ -66,7 +65,7 @@ public static TargetResult GetTarget(string target, out CCSPlayerController? pla return player?.IsValid == true ? TargetResult.Single : TargetResult.None; } - public static void KickPlayer(int? userId, string? reason = null) + public static void KickPlayer(ushort userId, string? reason = null) { NativeAPI.IssueServerCommand($"kickid {userId} {reason}"); } diff --git a/MuteManager.cs b/MuteManager.cs index c6f9243..4600a5d 100644 --- a/MuteManager.cs +++ b/MuteManager.cs @@ -14,9 +14,9 @@ public MuteManager(string connectionString) _dbConnection = new MySqlConnection(connectionString); } - public async Task MutePlayer(CCSPlayerController? player, CCSPlayerController? issuer, string reason, int time = 0, int type = 0) + public async Task MutePlayer(PlayerInfo player, PlayerInfo issuer, string reason, int time = 0, int type = 0) { - if (player == null || !player.IsValid || player.AuthorizedSteamID == null) return; + if (player == null || player.SteamId == null) return; await using var connection = _dbConnection; await connection.OpenAsync(); @@ -33,24 +33,19 @@ public async Task MutePlayer(CCSPlayerController? player, CCSPlayerController? i await connection.ExecuteAsync(sql, new { - playerSteamid = player.AuthorizedSteamID.SteamId64.ToString(), - playerName = player.PlayerName, - adminSteamid = issuer == null ? "Console" : issuer?.AuthorizedSteamID?.SteamId64.ToString(), - adminName = issuer == null ? "Console" : issuer.PlayerName, + playerSteamid = player.SteamId, + playerName = player.Name, + adminSteamid = issuer.SteamId == null ? "Console" : issuer.SteamId, + adminName = issuer.SteamId == null ? "Console" : issuer.Name, banReason = reason, duration = time, ends = futureTime, created = now, type = muteType, }); - - if (connection.State != ConnectionState.Closed) - { - connection.Close(); - } } - public async Task AddMuteBySteamid(string playerSteamId, CCSPlayerController? issuer, string reason, int time = 0, int type = 0) + public async Task AddMuteBySteamid(string playerSteamId, PlayerInfo issuer, string reason, int time = 0, int type = 0) { if (string.IsNullOrEmpty(playerSteamId)) return; @@ -70,19 +65,14 @@ public async Task AddMuteBySteamid(string playerSteamId, CCSPlayerController? is await connection.ExecuteAsync(sql, new { playerSteamid = playerSteamId, - adminSteamid = issuer == null ? "Console" : issuer?.AuthorizedSteamID?.SteamId64.ToString(), - adminName = issuer == null ? "Console" : issuer.PlayerName, + adminSteamid = issuer.SteamId == null ? "Console" : issuer.SteamId, + adminName = issuer.Name == null ? "Console" : issuer.Name, banReason = reason, duration = time, ends = futureTime, created = now, type = muteType }); - - if (connection.State != ConnectionState.Closed) - { - connection.Close(); - } } public async Task> IsPlayerMuted(string steamId) @@ -95,11 +85,6 @@ public async Task> IsPlayerMuted(string steamId) string sql = "SELECT * FROM sa_mutes WHERE player_steamid = @PlayerSteamID AND status = 'ACTIVE' AND (duration = 0 OR ends > @CurrentTime)"; var activeMutes = (await connection.QueryAsync(sql, new { PlayerSteamID = steamId, CurrentTime = now })).ToList(); - if (connection.State != ConnectionState.Closed) - { - connection.Close(); - } - return activeMutes; } @@ -134,11 +119,6 @@ public async Task UnmutePlayer(string playerPattern, int type = 0) string sqlUnban = "UPDATE sa_mutes SET status = 'UNMUTED' WHERE (player_steamid = @pattern OR player_name = @pattern) AND type = @muteType AND status = 'ACTIVE'"; await connection.ExecuteAsync(sqlUnban, new { pattern = playerPattern, muteType }); - - if (connection.State != ConnectionState.Closed) - { - connection.Close(); - } } public async Task ExpireOldMutes() @@ -148,18 +128,13 @@ public async Task ExpireOldMutes() string sql = "UPDATE sa_mutes SET status = 'EXPIRED' WHERE status = 'ACTIVE' AND `duration` > 0 AND ends <= @CurrentTime"; await connection.ExecuteAsync(sql, new { CurrentTime = DateTime.Now }); - - if (connection.State != ConnectionState.Closed) - { - connection.Close(); - } } - public async Task CheckMute(CCSPlayerController? player) + public async Task CheckMute(PlayerInfo player) { - if (player == null || !player.IsValid || player.AuthorizedSteamID == null) return; + if (player.Index == null) return; - string steamId = player.AuthorizedSteamID.SteamId64.ToString(); + string steamId = player.SteamId!; List activeMutes = await IsPlayerMuted(steamId); if (activeMutes.Count > 0) @@ -172,12 +147,13 @@ public async Task CheckMute(CCSPlayerController? player) if (muteType == "GAG") { - if (!CS2_SimpleAdmin.gaggedPlayers.Contains((int)player.Index)) + if (!CS2_SimpleAdmin.gaggedPlayers.Any(index => index == player.Index)) CS2_SimpleAdmin.gaggedPlayers.Add((int)player.Index); if (CS2_SimpleAdmin.TagsDetected) NativeAPI.IssueServerCommand($"css_tag_mute {player!.Index.ToString()}"); + /* CCSPlayerController currentPlayer = player; if (mute.duration == 0 || durationInSeconds >= 1800) continue; @@ -189,6 +165,7 @@ public async Task CheckMute(CCSPlayerController? player) NativeAPI.IssueServerCommand($"css_tag_unmute {currentPlayer.Index.ToString()}"); await UnmutePlayer(currentPlayer.AuthorizedSteamID.SteamId64.ToString(), 0); } + */ } else { diff --git a/PlayerInfo.cs b/PlayerInfo.cs new file mode 100644 index 0000000..60e40f0 --- /dev/null +++ b/PlayerInfo.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CS2_SimpleAdmin +{ + public class PlayerInfo + { + public int? Index { get; set; } + public int? UserId { get; set; } + public string? SteamId { get; set; } + public string? Name { get; set; } + public string? IpAddress { get; set; } + } +}