cs2-SimpleAdmin/CS2-SimpleAdmin/Managers
playaopindo-dev 1f56b5b251 Fix css_unban/css_unmute silently failing on SQLite
On SQLite, INTEGER PRIMARY KEY AUTOINCREMENT values flow through
Dapper as boxed long. `int banId = ban.id;` / `int muteId = mute.id;`
against a dynamic row triggers RuntimeBinderException
("Cannot implicitly convert type 'long' to 'int'") before any
INSERT/UPDATE runs, and the surrounding bare `catch { }` in
BanManager.UnbanPlayer swallows it — leaving sa_bans.status='ACTIVE',
sa_unbans empty, and the admin staring at a cosmetic
"Unbanned with pattern X." reply. MySQL is unaffected because
MySqlConnector materialises INT as int.

Normalise the conversion path via Convert.ToInt32((object)x.id),
which handles both boxed int (MySQL) and boxed long (SQLite)
without invoking the C# dynamic binder. Same pattern fixed in
both UnbanPlayer and UnmutePlayer.

Also tighten BanManager.UnbanPlayer's bare `catch { }` to log via
the existing CS2_SimpleAdmin.Instance.Logger, matching the style
of BanPlayer/AddBanBySteamid/AddBanByIp in the same file. This is
what surfaced the bug during root-cause analysis.
2026-05-29 00:19:36 +02:00
..
BanManager.cs Fix css_unban/css_unmute silently failing on SQLite 2026-05-29 00:19:36 +02:00
CacheManager.cs Version bump and multi-account/IP ban fixes 2026-04-23 22:15:44 +02:00
DiscordManager.cs Refactor database layer and add module/plugin improvements 2025-10-03 01:37:03 +02:00
MuteManager.cs Fix css_unban/css_unmute silently failing on SQLite 2026-05-29 00:19:36 +02:00
PermissionManager.cs Refactor database layer and add module/plugin improvements 2025-10-03 01:37:03 +02:00
PlayerManager.cs Version bump and multi-account/IP ban fixes 2026-04-23 22:15:44 +02:00
PlayerPenaltyManager.cs Refactor database layer and add module/plugin improvements 2025-10-03 01:37:03 +02:00
ServerManager.cs Update ServerManager.cs 2026-01-27 09:51:12 +01:00
WarnManager.cs Version bump and multi-account/IP ban fixes 2026-04-23 22:15:44 +02:00