mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-11-29 04:27:05 +01:00
Fix mutes lost on map change; fix SQLite penalty reads
OnMapStart clears all in-memory penalties and CounterStrikeSharp resets
voice flags, so mutes, gags and silences must be reloaded on reconnect.
- LoadPlayerData only reloaded them when the player was not already in
PlayersInfo (since eea700b, 1.7.9a). An entry that outlives the map
change skips the reload. Gate on fullConnect again.
- On SQLite the reload always threw: INTEGER columns come back as long
and dynamic cannot convert that to int implicitly. Same cast fixed in
UnmutePlayer and UnbanPlayer, which failed silently (#284).
- SQLite dates are stored as UTC but were read back shifted by the
machine's UTC offset, so restored mutes ended early or late. The
connection now uses DateTimeKind=Utc.
This commit is contained in:
parent
03a454b1b5
commit
31172f38f7
4 changed files with 8 additions and 5 deletions
|
|
@ -5,7 +5,8 @@ namespace CS2_SimpleAdmin.Database;
|
|||
|
||||
public class SqliteDatabaseProvider(string filePath) : IDatabaseProvider
|
||||
{
|
||||
private readonly string _connectionString = $"Data Source={filePath}";
|
||||
// Dates are stored as UTC; without DateTimeKind=Utc they are read back shifted by the machine's UTC offset
|
||||
private readonly string _connectionString = $"Data Source={filePath};DateTimeKind=Utc";
|
||||
|
||||
public async Task<DbConnection> CreateConnectionAsync()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue