You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OverflowException in CacheManager.InitializeCacheAsync — sa_players_ips.steamid mapped to int (SteamID64 doesn't fit) #283
Reopen of #264 — still reproducible on build-1.7.9a (SQLite). Root cause identified.
Stack
System.OverflowException: Arithmetic operation resulted in an overflow.
at Deserialize<…>(DbDataReader)
at Dapper.SqlMapper.QueryAsync[T](IDbConnection cnn, Type effectiveType, CommandDefinition command)
at CS2_SimpleAdmin.Managers.CacheManager.InitializeCacheAsync()
at CS2_SimpleAdmin.Managers.CacheManager.InitializeCacheAsync()
Root cause
sa_players_ips.steamid is declared INTEGER and stores SteamID64 values
(e.g. 76561197989223530), which exceeds Int32.MaxValue (2147483647).
The Dapper deserializer in CacheManager.InitializeCacheAsync maps that column
to int, so it throws OverflowException on every cache init after at least
one real player has connected and SA has written a row.
INSERT INTO sa_players_ips
VALUES (76561197989223530, 0, CURRENT_TIMESTAMP, 'x');
Next server start → OverflowException in CacheManager.InitializeCacheAsync.
Fix
The POCO / Dapper mapping for sa_players_ips.steamid (and any other steamid
columns currently typed as int server-side) needs to be long / ulong.
Same applies to address if SA ever stores IPs with the high bit set as
unsigned — currently only IPs < 128.0.0.0 happen to fit into signed int32.
Workaround for affected users
Set "CheckMultiAccountsByIp": false in CS2-SimpleAdmin.json — this skips
the failing query path. Multi-account-by-IP detection is then disabled.
Environment
CS2-SimpleAdmin: build-1.7.9a
DB: SQLite
Repro confirmed on a vanilla DB with a single connecting Steam account.
Activity