1.3.6b
- Fixed ban checking - Small changes - Updated css
This commit is contained in:
parent
2ab2f9c4dc
commit
525905194c
10 changed files with 62 additions and 45 deletions
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue