Skip to content

Fix SQLite IP history materialization#290

Open
playaopindo-dev wants to merge 1 commit into
daffyyyy:mainfrom
playaopindo-dev:fix/sqlite-ip-history-row-dto
Open

Fix SQLite IP history materialization#290
playaopindo-dev wants to merge 1 commit into
daffyyyy:mainfrom
playaopindo-dev:fix/sqlite-ip-history-row-dto

Conversation

@playaopindo-dev

Copy link
Copy Markdown

Summary

  • replace IpHistoryRow's positional ulong/uint record with a parameterless DTO for Dapper/SQLite mapping
  • keep the public PascalCase accessors used by CacheManager
  • preserve signed SQLite IPv4 bit patterns with an unchecked uint cast

Why

In 1.8.2a, SQLite can still fail during CacheManager.InitializeCacheAsync when CheckMultiAccountsByIp is enabled. SQLite/Dapper materializes integer values as Int64, and existing sa_players_ips.address rows may contain signed 32-bit IPv4 values. The current positional record can fail either during materialization or when converting address values to uint.

Verification

  • Built CS2-SimpleAdmin with net10.0: 0 errors
  • Runtime-verified on a SQLite server with CheckMultiAccountsByIp=true: SimpleAdmin logs Loaded server with ip ... followed by Loaded admins!, with no IpHistoryRow/DataException/OverflowException stack trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant