mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-22 11:42:26 +00:00
Added info about crashes with bots
This commit is contained in:
@@ -51,7 +51,7 @@ namespace CS2_SimpleAdmin
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
|
||||
using var connection = await _database.GetConnection();
|
||||
await using var connection = await _database.GetConnectionAsync();
|
||||
|
||||
string sql = "SELECT flags, immunity, ends FROM sa_admins WHERE player_steamid = @PlayerSteamID AND (ends IS NULL OR ends > @CurrentTime) AND (server_id IS NULL OR server_id = @serverid)";
|
||||
List<dynamic>? activeFlags = (await connection.QueryAsync(sql, new { PlayerSteamID = steamId, CurrentTime = now, serverid = CS2_SimpleAdmin.ServerId }))?.ToList();
|
||||
@@ -151,7 +151,7 @@ namespace CS2_SimpleAdmin
|
||||
|
||||
try
|
||||
{
|
||||
using var connection = await _database.GetConnection();
|
||||
await using var connection = await _database.GetConnectionAsync();
|
||||
|
||||
string sql = "SELECT player_steamid, flags, immunity, ends FROM sa_admins WHERE (ends IS NULL OR ends > @CurrentTime) AND (server_id IS NULL OR server_id = @serverid)";
|
||||
List<dynamic>? activeFlags = (await connection.QueryAsync(sql, new { CurrentTime = now, serverid = CS2_SimpleAdmin.ServerId }))?.ToList();
|
||||
@@ -244,7 +244,7 @@ namespace CS2_SimpleAdmin
|
||||
|
||||
//_adminCache.TryRemove(playerSteamId, out _);
|
||||
|
||||
using var connection = await _database.GetConnection();
|
||||
await using var connection = await _database.GetConnectionAsync();
|
||||
|
||||
string sql = "";
|
||||
|
||||
@@ -273,7 +273,7 @@ namespace CS2_SimpleAdmin
|
||||
else
|
||||
futureTime = null;
|
||||
|
||||
using var connection = await _database.GetConnection();
|
||||
await using var connection = await _database.GetConnectionAsync();
|
||||
|
||||
var sql = "INSERT INTO `sa_admins` (`player_steamid`, `player_name`, `flags`, `immunity`, `ends`, `created`, `server_id`) " +
|
||||
"VALUES (@playerSteamid, @playerName, @flags, @immunity, @ends, @created, @serverid)";
|
||||
@@ -296,7 +296,7 @@ namespace CS2_SimpleAdmin
|
||||
{
|
||||
try
|
||||
{
|
||||
using var connection = await _database.GetConnection();
|
||||
await using var connection = await _database.GetConnectionAsync();
|
||||
|
||||
string sql = "DELETE FROM sa_admins WHERE ends IS NOT NULL AND ends <= @CurrentTime";
|
||||
await connection.ExecuteAsync(sql, new { CurrentTime = DateTime.Now });
|
||||
|
||||
Reference in New Issue
Block a user