* Add test pooling and global test setup
* WIP test pooling changes
* Make asynchronous tests the default again
* Finish fixing tests, make test threads background threads
* Un-pool tests with custom cvars
* Fix not changing FailureLogLevel cvar on instance return
* Fix error when overriding already overriden cvar
* Don't pool some physics integration tests
* Unpool engine tests, the technology just isn't there yet
* Remove explicit Pool = false from physics tests
* Change default pooling setting to false
* Didn't need this anyway
* Remove ConfigurationManager.ResetOverrides
* Bring back enum cvar override parsing
* Make integrationInstances name clearer > notPooledInstaces
Make clients ready and servers ready internal
* Add logging test instances
* Give more info on ran tests
* Show total clients and servers in test output
* Wipe LayerMap on SpriteComponent.AfterDeserialize
* Fix server not properly kicking clients
* Rider shut
* Make all test metrics report totals
* Format tests ran better
* Replace Console.WriteLine with TestContext.Out.WriteLine
* Fix two server test pooling info prints using total clients instead of total servers
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
* Adds ServerOptions, improve GameControllerOptions, fix engine integration tests
* Do component auto-registration in engine integration tests by default
* Fix integration tests on content, register components ONLY if not contentstarted or options are null
* Add integration test for engine integration tests working correctly
* Move cvar overrides out of content and into engine.
* Removed the Interfaces folder.
* All objects inside the GameObjects subfolders are now in the GameObjects namespace.
* Added a Resharper DotSettings file to mark the GameObjects subfolders as not providing namespaces.
* Simplified Robust.client.Graphics namespace.
* Automated remove redundant using statements.
* Renamed shared ICommand to IConsoleCommand.
* Lots of refactoring into a shared context.
* Removed ICommonSession from server concmd Execute.
* Added argStr parameter to concmd execute.
* The execute function of client concmds now returns void, use the new shell.RemoteExecuteCommand function to forward commands.
# Conflicts:
# Robust.Client/Console/Commands/Debug.cs
* Finally move shells and commands into shared.
* Console commands can now be registered directly without a class in a shared context.
* Pulled up ConsoleHost and Console shell into a shared context.
* Pulled up half the functions of ConsoleHost into a shared context.
* Repair rebase damage.
* Make LoadConsoleCommands function not remove any previously registered commands.
1. Set timeBeginPeriod(3) on the server to reduce scheduler latency in the lidgren thread.
2. Add 16ms of guaranteed lag bias to client prediction calculations to account for scheduler latency.
Both of these changes are to account for how the windows scheduler seems to handle time periods in related to socket polls. See this Discord conversation for why, details down below as well: https://discord.com/channels/310555209753690112/770682801607278632/798309250291204107
Basically Windows has this thing called time periods which determines the precision of sleep operations and such. By default it's like 16ms so a sleep will only be accurate to within 16ms.
Problem: Lidgren polls the socket with a timeout of 1ms.
The way Windows seems to handle this is that:
1. if a message comes into the socket, the poll immediately ends and Lidgren can handle it.
2. If nothing comes in, it takes the whole 16ms time period to actually process stuff.
Oh yeah, and Lidgren's thread needs to keep pumping at a steady rate or else it *won't flush its send queue*. On Windows it seems to normally pump at 65/125 Hz. On Linux it goes like 950 Hz as intended.
Now, the worst part is that (1) causes Lidgren's latency calculation to always read 0 (over localhost) instead of the 30~ms it SHOULD BE (assuming client and server localhost).
That 30ms of unaccounted delay worst caseis enough to cause prediction undershoot and have messages arrive too late. Yikes.
So, to fix this...
On the server we just decrease the tick period and call it a day. Screw your battery life players don't have local servers running anyways.
On the client we bias the prediction calculations to account for this "unmeasurable" lag.
Of course, all this can be configured via CVars.
This allows us to make Content.Client and Content.Server Exe projects so that they can be executed directly via your IDE. This'll help wtih not forgetting to do a full rebuild and such.
They no longer load system-wide config or user data.
User data is emulated through a VFS.
Also added more hooks to improve the customizability of the test,
for example allowing content to hijack their IoC registrations.
* Server works if not connected to a tty.
* Rich presence does not run IoC resolution at runtime anymore.
* Work towards integration tests.
Mostly work related to making it so the server and client can run in
parallel, and allowing more control over main loop for testing.
* Lots of code relating to integration tests.