]> git.smokeofanarchy.ru Git - space-station-14.git/commit
Fix preference loading bugs (#27742)
authorPieter-Jan Briers <pieterjan.briers+git@gmail.com>
Tue, 7 May 2024 04:21:03 +0000 (06:21 +0200)
committerGitHub <noreply@github.com>
Tue, 7 May 2024 04:21:03 +0000 (14:21 +1000)
commit7a38b22ddbf03814680277d54c285dcc70345e20
tree684ad49ec57ed8b2b25f812d93125095eda2d949
parent61c1aeddf369e46c269c2b03cace3f0b25ebf470
Fix preference loading bugs (#27742)

First bug: if an error occured during pref loading code, it would fail. If the person then readied up, it would likely cause the round to fail to start.

Why could they ready up? The code only checks that the prefs finished loading, not that they finished loading *successfully*. Whoops.

Anyways, now people get kicked if their prefs fail to load. And I improved the error handling.

Second bug: if a user disconnected while their prefs were loading, it would cause an exception. This exception would go unobserved on lobby servers or raise through gameticker on non-lobby servers.

This happened even on a live server once and then triggered the first bug, but idk how.

Fixed this by properly plumbing through cancellation into the preferences loading code. The stuff is now cancelled properly.

Third bug: if somebody has a loadout item with a playtime requirement active, load-time sanitization of player prefs could run into a race condition because the sanitization can happen *before* play time was loaded.

Fixed by moving pref sanitizations to a later stage in the load process.
Content.Server/Database/ServerDbBase.cs
Content.Server/Database/ServerDbManager.cs
Content.Server/Database/ServerDbPostgres.cs
Content.Server/Database/ServerDbSqlite.cs
Content.Server/Database/UserDbDataManager.cs
Content.Server/GameTicking/GameTicker.Player.cs
Content.Server/Players/PlayTimeTracking/PlayTimeTrackingManager.cs
Content.Server/Preferences/Managers/IServerPreferencesManager.cs
Content.Server/Preferences/Managers/ServerPreferencesManager.cs