From d496977c7661d077892c809dd15b71326c49eb04 Mon Sep 17 00:00:00 2001 From: daffyyyy Date: Sun, 3 Dec 2023 01:22:18 +0100 Subject: [PATCH] Forgotten column with the reason for the ban OOOooops :D --- BanManager.cs | 8 +++++--- CS2-SimpleAdmin.cs | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/BanManager.cs b/BanManager.cs index 2a6213f..eb2f77a 100644 --- a/BanManager.cs +++ b/BanManager.cs @@ -23,14 +23,15 @@ namespace CS2_SimpleAdmin DateTime now = DateTime.Now; DateTime futureTime = now.AddMinutes(time); - var sql = "INSERT INTO `sa_bans` (`player_steamid`, `player_name`, `admin_steamid`, `admin_name`, `duration`, `ends`, `created`) " + - "VALUES (@playerSteamid, @playerName, @adminSteamid, @adminName, @duration, @ends, @created)"; + var sql = "INSERT INTO `sa_bans` (`player_steamid`, `player_name`, `admin_steamid`, `admin_name`, `reason`, `duration`, `ends`, `created`) " + + "VALUES (@playerSteamid, @playerName, @adminSteamid, @adminName, @banReason, @duration, @ends, @created)"; _dbConnection.Execute(sql, new { playerSteamid = player.AuthorizedSteamID.SteamId64.ToString(), playerName = player.PlayerName, adminSteamid = issuer == null ? "Console" : issuer?.AuthorizedSteamID?.SteamId64.ToString(), adminName = issuer == null ? "Console" : issuer.PlayerName, + banReason = reason, duration = time, ends = futureTime, created = now @@ -58,7 +59,8 @@ namespace CS2_SimpleAdmin _dbConnection.Open(); string sql = "UPDATE sa_bans SET status = 'EXPIRED' WHERE status = 'ACTIVE' AND `duration` > 0 AND ends <= @CurrentTime"; - int affectedRows = _dbConnection.Execute(sql, new { CurrentTime = DateTime.Now }); + _dbConnection.Execute(sql, new { CurrentTime = DateTime.Now }); + //int affectedRows = _dbConnection.Execute(sql, new { CurrentTime = DateTime.Now }); _dbConnection.Close(); } diff --git a/CS2-SimpleAdmin.cs b/CS2-SimpleAdmin.cs index fcada0b..325e196 100644 --- a/CS2-SimpleAdmin.cs +++ b/CS2-SimpleAdmin.cs @@ -61,6 +61,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig