mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-18 02:41:55 +00:00
Forgotten column with the reason for the ban
OOOooops :D
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig<CS2_SimpleAdmin
|
||||
`player_name` VARCHAR(128) NOT NULL,
|
||||
`admin_steamid` VARCHAR(64) NOT NULL,
|
||||
`admin_name` VARCHAR(128) NOT NULL,
|
||||
`reason` VARCHAR(255) NOT NULL,
|
||||
`duration` INT NOT NULL,
|
||||
`ends` TIMESTAMP NOT NULL,
|
||||
`created` TIMESTAMP NOT NULL,
|
||||
|
||||
Reference in New Issue
Block a user