diff --git a/CS2-SimpleAdmin/CS2-SimpleAdmin.cs b/CS2-SimpleAdmin/CS2-SimpleAdmin.cs index d4e25d1..7c93924 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.1"; + public override string ModuleVersion => "1.9.0"; public override void Load(bool hotReload) { diff --git a/CS2-SimpleAdmin/Managers/CacheManager.cs b/CS2-SimpleAdmin/Managers/CacheManager.cs index 2e515fa..56daa8d 100644 --- a/CS2-SimpleAdmin/Managers/CacheManager.cs +++ b/CS2-SimpleAdmin/Managers/CacheManager.cs @@ -442,10 +442,7 @@ internal class CacheManager: IDisposable /// /// 64-bit Steam ID of the player. /// List of objects associated with the Steam ID. - // _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(); + public List GetPlayerBansBySteamId(ulong steamId) => _steamIdIndex.TryGetValue(steamId, out var bans) ? bans : []; /// /// 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 7ae2376..01d83df 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.GetMuteStatsQuery(CS2_SimpleAdmin.Instance.Config.MultiServerMode); + var sql = databaseProvider.GetRetrieveMutesQuery(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 ee672d8..abb1658 100644 --- a/CS2-SimpleAdmin/VERSION +++ b/CS2-SimpleAdmin/VERSION @@ -1 +1 @@ -1.9.1 \ No newline at end of file +1.9.0 \ No newline at end of file