diff --git a/CS2-SimpleAdmin/CS2-SimpleAdmin.cs b/CS2-SimpleAdmin/CS2-SimpleAdmin.cs index 7c93924..d4e25d1 100644 --- a/CS2-SimpleAdmin/CS2-SimpleAdmin.cs +++ b/CS2-SimpleAdmin/CS2-SimpleAdmin.cs @@ -22,7 +22,7 @@ public partial class CS2_SimpleAdmin : BasePlugin, IPluginConfig "CS2-SimpleAdmin" + (Helper.IsDebugBuild ? " (DEBUG)" : " (RELEASE)"); public override string ModuleDescription => "Simple admin plugin for Counter-Strike 2 :)"; public override string ModuleAuthor => "daffyy"; - public override string ModuleVersion => "1.9.0"; + public override string ModuleVersion => "1.9.1"; public override void Load(bool hotReload) { diff --git a/CS2-SimpleAdmin/Managers/CacheManager.cs b/CS2-SimpleAdmin/Managers/CacheManager.cs index 56daa8d..2e515fa 100644 --- a/CS2-SimpleAdmin/Managers/CacheManager.cs +++ b/CS2-SimpleAdmin/Managers/CacheManager.cs @@ -442,7 +442,10 @@ internal class CacheManager: IDisposable /// /// 64-bit Steam ID of the player. /// List of objects associated with the Steam ID. - public List GetPlayerBansBySteamId(ulong steamId) => _steamIdIndex.TryGetValue(steamId, out var bans) ? bans : []; + // _steamIdIndex holds only ACTIVE bans, so scan the full cache for history (expired/unbanned included). + // ponytail: O(n) over all cached bans per call; add an all-status index if this gets hot. + public List GetPlayerBansBySteamId(ulong steamId) => + _banCache.Values.Where(b => b.PlayerSteamId == steamId).ToList(); /// /// Gets all known Steam accounts that have used the specified IP address. diff --git a/CS2-SimpleAdmin/Managers/MuteManager.cs b/CS2-SimpleAdmin/Managers/MuteManager.cs index 01d83df..7ae2376 100644 --- a/CS2-SimpleAdmin/Managers/MuteManager.cs +++ b/CS2-SimpleAdmin/Managers/MuteManager.cs @@ -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, diff --git a/CS2-SimpleAdmin/VERSION b/CS2-SimpleAdmin/VERSION index abb1658..ee672d8 100644 --- a/CS2-SimpleAdmin/VERSION +++ b/CS2-SimpleAdmin/VERSION @@ -1 +1 @@ -1.9.0 \ No newline at end of file +1.9.1 \ No newline at end of file