mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-10-18 04:47:04 +02:00
Fix connect penalty counts always showing 0 (1.9.1)
The admin notification on player connect always reported 0 bans, gags, mutes and silences. - MuteManager.GetPlayerMutes ran GetRetrieveMutesQuery (the unmute id lookup, which needs @pattern/@muteType) instead of GetMuteStatsQuery. The query threw, the catch returned (0,0,0), so mute counts were always 0. - CacheManager.GetPlayerBansBySteamId read _steamIdIndex, which only holds ACTIVE bans. Anyone with an active ban is kicked before the message is sent, so the count was always 0. It now counts all of the player's bans in _banCache (expired/unbanned included). The connect message is its only caller; the ban check still uses the active index.
This commit is contained in:
parent
2813e91b0b
commit
c7395e5061
4 changed files with 7 additions and 4 deletions
|
|
@ -159,7 +159,7 @@ internal class MuteManager(IDatabaseProvider? databaseProvider)
|
|||
{
|
||||
await using var connection = await databaseProvider.CreateConnectionAsync();
|
||||
|
||||
var sql = databaseProvider.GetRetrieveMutesQuery(CS2_SimpleAdmin.Instance.Config.MultiServerMode);
|
||||
var sql = databaseProvider.GetMuteStatsQuery(CS2_SimpleAdmin.Instance.Config.MultiServerMode);
|
||||
var result = await connection.QuerySingleAsync<(int TotalMutes, int TotalGags, int TotalSilences)>(sql, new
|
||||
{
|
||||
PlayerSteamID = playerInfo.SteamId.SteamId64,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue