- Fixed ban checking
- Small changes
- Updated css
This commit is contained in:
Dawid Bepierszcz
2024-03-09 12:06:50 +01:00
parent 2ab2f9c4dc
commit 525905194c
10 changed files with 62 additions and 45 deletions

View File

@@ -4,6 +4,7 @@ using Microsoft.Extensions.Logging;
using System.Collections.Concurrent;
namespace CS2_SimpleAdmin;
public class AdminSQLManager
{
private readonly Database _database;
@@ -222,4 +223,4 @@ public class AdminSQLManager
CS2_SimpleAdmin._logger.LogCritical("Unable to remove expired admins");
}
}
}
}

View File

@@ -2,6 +2,7 @@
using Microsoft.Extensions.Logging;
namespace CS2_SimpleAdmin;
internal class BanManager
{
private readonly Database _database;
@@ -188,14 +189,14 @@ internal class BanManager
*/
string sql = @"
UPDATE sa_bans
SET
UPDATE sa_bans
SET
status = 'EXPIRED'
WHERE
status = 'ACTIVE'
AND
`duration` > 0
AND
WHERE
status = 'ACTIVE'
AND
`duration` > 0
AND
ends <= @currentTime";
await connection.ExecuteAsync(sql, new { currentTime });
@@ -205,21 +206,20 @@ internal class BanManager
DateTime ipBansTime = currentTime.AddDays(-_config.ExpireOldIpBans).ToLocalTime();
sql = @"
UPDATE sa_bans
SET
UPDATE sa_bans
SET
player_ip = NULL
WHERE
status = 'ACTIVE'
AND
WHERE
status = 'ACTIVE'
AND
ends <= @ipBansTime";
await connection.ExecuteAsync(sql, new { ipBansTime });
}
}
catch (Exception)
{
CS2_SimpleAdmin._logger?.LogCritical("Unable to remove expired bans");
}
}
}
}

View File

@@ -2,6 +2,7 @@
using Microsoft.Extensions.Logging;
namespace CS2_SimpleAdmin;
internal class MuteManager
{
private readonly Database _database;
@@ -160,5 +161,4 @@ internal class MuteManager
CS2_SimpleAdmin._logger.LogCritical("Unable to remove expired mutes");
}
}
}
}

View File

@@ -1,6 +1,7 @@
using System.Collections.Concurrent;
namespace CS2_SimpleAdmin;
public enum PenaltyType
{
Mute,
@@ -134,4 +135,4 @@ public class PlayerPenaltyManager
}
}
}
}
}