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.
God bloody christ. There's like three layers of shit here.
So firstly, apparently we were still using Npgsql.EnableLegacyTimestampBehavior. This means that time values (which are stored UTC in the database) were converted to local time when read out. This meant they were passed around as kind Local to clients (instead of UTC in the case of SQLite). That's easy enough to fix just turn off the flag and fix the couple spots we're passing a local DateTime ez.
Oh but it turns out there's a DIFFERENT problem with SQLite: See SQLite we definitely store the DateTimes as UTC, but when Microsoft.Data.Sqlite reads them it reads them as Kind Unspecified instead of Utc.
Why are these so bad? Because the admin notes system passes DateTime instances from EF Core straight to the rest of the game code. And that means it's a PAIN IN THE ASS to run the necessary conversions to fix the DateTime instances. GOD DAMNIT now I have to make a whole new set of "Record" entities so we avoid leaking the EF Core model entities. WAAAAAAA.
Fixes#19897
* Give .props files 2-space indents.
* Move to Central Package Management.
Allows us to store NuGet package versions all in one place. Yay!
* Update NuGet packages and fix code for changes.
Notable:
Changes to ILVerify.
Npgsql doesn't need hacks for inet anymore, now we need hacks to make the old code work with this new reality.
NUnit's analyzers are already complaining and I didn't even update it to 4.x yet.
TerraFX changed to GetLastSystemError so error handling had to be changed.
Buncha APIs have more NRT annotations.
* Remove dotnet-eng NuGet package source.
I genuinely don't know what this was for, and Central Package Management starts throwing warnings about it, so YEET.
* Remove Robust.Physics project.
Never used.
* Remove erroneous NVorbis reference.
Should be VorbisPizza and otherwise wasn't used.
* Sandbox fixes
* Remove unused unit test package references.
Castle.Core and NUnit.ConsoleRunner.
* Update NUnit to 4.0.1
This requires replacing all the old assertion methods because they removed them 🥲
* Oh so that's what dotnet-eng was used for. Yeah ok that makes sense.
* Add Robust.Analyzers.Test
* Update submodule
* commit to re-run CI
Thanks to julian figuring out IDesignTimeDbContextFactory exists in #6327.
All this DbContext configuration and options setup stuff is insane. Microsoft should be absolutely ashamed for coming up with this load of garbage.
* Holy crap auth works
* Fix some usages of UserID instead of UserName
* Refactor preferences.
They be non-async now. Also faster.
* Rename DbContext.
* Guest username assignment.
* Fix saving of profiles.
* Don't store data for guests.
* Fix generating invalid random colors.
* Don't allow dumb garbage for char preferences.
* Bans.
* Lol forgot to fill out the command description.
* Connection log.
* Rename all the tables and columns to be snake_case.
* Re-do migrations.
* Fixing tests and warnings.
* Update submodule