Commit Graph
201 Commits
Author SHA1 Message Date
f131f367d8 Componentdependency (#1311)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers@gmail.com>
Co-authored-by: Víctor Aguilera Puerto <zddm@outlook.es>
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
2020-10-13 14:22:45 +02:00
Pieter-Jan Briers 50311afe9f Group VV members lists by declaring type. 2020-10-13 13:43:50 +02:00
DrSmugleafandGitHub 75238b183b Fix chunk to string test and PhysicsComponent file name (#1321)
* Fix chunk to string test and PhysicsComponent file name

* AAAAAAAAA

* Fix accidentally deanchoring everything
2020-10-12 01:01:27 +02:00
DrSmugleafandGitHub da76788751 Replace MapIndices to Vector2i (#1318) 2020-10-11 14:33:09 +02:00
DrSmugleafandGitHub 23c0984d2e Change integration tests to use LoginType.GuestAssigned instead of Guest (#1308) 2020-10-09 11:38:53 +02:00
Pieter-Jan Briers ade03ceb13 Adds non-predicate FirstOrNull. 2020-10-06 15:03:27 +02:00
DrSmugleafandGitHub 8dc78cdfec Add YAML serialization for nullable primitive types (#1299)
* Add YAML serialization for nullable primitive types

* Add tests and fix null serialization

* Merge primitive and nullable primitive checks

* Fix null primitive serialization test

* This kills the analyzer
2020-10-03 15:29:27 +02:00
DrSmugleafandGitHub 9a809040a8 Add HashSet YAML serialization (#1291)
* Add HashSet YAML serialization

* consider this

* Revert "consider this"

This reverts commit f542f2c0bf.

* you think you are so funny c#

* Remove reflection call, fix equals and add tests

* Make this code slightly less bad

* Fix hashset equality and add test
2020-10-02 14:52:26 +02:00
Pieter-Jan BriersandGitHub aa64528a03 Auth (#1289)
* Some stuff for auth

* Holy crap auth works

* Enable encryption even if no auth token is provided.

It's still possible that the public key was retrieved over HTTPS via the status API, in which case it will be secure.

* Fix integration test compile.

* Secure CVar API.

* Literally rewrite the auth protocol to be minecraft's.

* Better exception tolerance in server handshake.

* Auth works from launcher.

* Fix some usages of UserID instead of UserName

* Fix auth.server CVar

* Kick existing connection if same account connects twice.

* Username assignment, guest session distinguishing.

* Necessary work to make bans work.

* Expose LoginType to OnConnecting.

* Fixing tests and warnings.
2020-09-29 14:18:12 +02:00
DrSmugleafandGitHub ab86b59bc8 Fix build (#1298) 2020-09-28 23:18:34 +02:00
Pieter-Jan Briers d7526e61bb Fix raycasting and tests. 2020-09-24 16:00:54 +02:00
Pieter-Jan Briers d134f31d66 Re-implement DynamicTree<T> on top of B2DynamicTree<T>. 2020-09-24 11:51:50 +02:00
Pieter-Jan Briers 4ce4fb9a9f A more true-to-Box2D DynamicTree.
It's fast.

Could still do with some bounds check elimination I guess.
2020-09-23 19:48:31 +02:00
Pieter-Jan Briers e80b6a238d Add Keyboard.Key.IsMouseKey().
I needed this for something but didn't end up using it, whatever.
2020-09-07 10:55:40 +02:00
Pieter-Jan Briers 482c8e1317 Fix ISelfSerialize serialization. 2020-09-07 10:55:40 +02:00
0a67cecfa5 Replace every usage of GridCoordinates with EntityCoordinates (#1280)
* Added struct skeleton for EntityCoordinates.

* Polish EntityCoordinates, add tests, add EntityCoordinates to Transforms

* Doc cleanup

* Remove useless code

* Return offset 0 when you don't have a parent

* Test for making sure EntityCoordinates for entities without parents have offset 0

* Use parent transform's GridId for GetGridId.

* Adds various methods, checks and tests

* Replace GridCoordinates with EntityCoordinates

* EyeManager.WorldToScreen fix

* Address reviews

* Fix za buildo

* Fix one transform test

* Fix the remaining tests

* Remove duplicate

* Remove another merge duplicate

* Fix property

* Rename most usages of GridCoordinates to EntityCoordinates.

* Add WithEntityId method to EntityCoordinates.

* Fix EntityCoordinates usage in GetEntitiesInRange

* Remove cursed IMapGrid method, change naming.

* Makes GridTileLookupSystem use EntityCoordinates

Co-authored-by: Acruid <shatter66@gmail.com>
Co-authored-by: Víctor Aguilera Puerto <zddm@outlook.es>
2020-09-06 16:09:19 +02:00
0701b040ee EntityCoordinates (#1277)
* Added struct skeleton for EntityCoordinates.

* Polish EntityCoordinates, add tests, add EntityCoordinates to Transforms

* Doc cleanup

* Remove useless code

* Return offset 0 when you don't have a parent

* Test for making sure EntityCoordinates for entities without parents have offset 0

* Use parent transform's GridId for GetGridId.

* Adds various methods, checks and tests

* Adds new constructor to EntityCoordinates and add WithPosition method

Co-authored-by: Acruid <shatter66@gmail.com>
2020-09-04 23:08:18 +02:00
Pieter-Jan Briers 3f43e86530 NetMessageAccept, NetMessage dispatch cleanup.
Net message functions are now cached when the message is registered or the string table updates (client side). This removes the cache call from DispatchNetMessage.

Receiving net messages that we don't have reception callbacks for, or that are blocked with the new NetMessageAccept enum, will instantly cause the net manager to drop the offending connection to avoid malicious use.

This means trying to send string tables to the server will just result in an instant kick without even hitting ReadFromBuffer().

This allows us to move some if() checks to asserts.
2020-09-01 01:03:06 +02:00
Pieter-Jan Briers 5faa8a59c1 Add some [Pure] annotations. 2020-08-29 07:53:50 +02:00
Pieter-Jan BriersandGitHub 6b92db35f0 Deterministic RobustMappedStringSerializer (#1265) 2020-08-29 07:53:29 +02:00
Pieter-Jan Briers 3f0e2fa429 Fix GameStateProcessor skipping over necessary game states in some extrapolation cases.
Fixes #1246
2020-08-26 13:45:15 +02:00
9d1bec9bb2 Merge FloatMath and MathHelper (#1234)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-08-20 19:21:07 +02:00
Pieter-Jan Briers 21d493a6ec Ensure that paths are rooted in WritableDirProvider. 2020-08-20 18:52:31 +02:00
Pieter-Jan Briers 2fb60f7129 Actually disable runtime log output in integration tests. 2020-08-20 18:52:31 +02:00
Pieter-Jan Briers 3148371d18 Use virtual file system on server integration tests. 2020-08-20 18:52:31 +02:00
Pieter-Jan Briers 773ea34ee3 Make integration tests TearDown OneTimeTearDown.
Fixes concurrency issues.
2020-08-20 18:52:30 +02:00
VinceandGitHub 6a546dadf1 Fixes most warnings (#1233) 2020-08-16 14:04:15 +02:00
Pieter-Jan Briers 1e89c5f1fd IWritableDirProvider does not allow access to parent directories.
Fixes #1229

Added tests.
2020-08-16 01:32:19 +02:00
7bfd5eb72e Add NetSerializer dictionary test (#1214)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-08-14 23:55:07 +02:00
DrSmugleafandGitHub 5c10050f9e Add NetSerializer HashSet test (#1213) 2020-08-14 23:27:17 +02:00
Acruid 64a3916c04 Added the Robust.Physics project.
Added BenchmarkDotNet to the Robust.UnitTesting project.
2020-08-09 13:43:57 -07:00
Acruid 6c3c22affe Added AlignedRectangle (Box2) collision features. 2020-08-09 01:23:03 -07:00
Acruid 900bf76a7d Attempt #2 to fix the timing bugs. CurTime increases again, and all the unit tests pass this time.
This resolves https://github.com/space-wizards/space-station-14/issues/1560.
Special thanks to PJB's prediction unit tests.
2020-07-31 23:20:35 -07:00
Acruid 3fd1a2f3fb Fill out cases for the shape switch.
Circle-Box collisions!

Circle Collisions!

PhysShapeCircle!
2020-07-31 12:02:41 -07:00
Pieter-Jan Briers 53288ffd2b YamlObjectSerializer.IsSerializedEqual now handles dictionaries. 2020-07-31 01:44:56 +02:00
Pieter-Jan Briers 2fc6614118 Add NUnit.Analyzers analyzer
Caught numerous cases of expected/actual being mixed and even a few broken test cases in content.
2020-07-30 18:38:17 +02:00
Pieter-Jan Briers 6a62b618dc More NetSerializer unit tests. 2020-07-30 15:06:45 +02:00
Acruid 350e05c152 Adds new functions to IComponentManager that can efficiently query for all entities with a set of components. 2020-07-29 15:48:32 -07:00
Pieter-Jan BriersandGitHub 3648f43f5c Include NetSerializer as a submodule, add List<T> serializer. (#1195)
* Include NetSerializer as a submodule.

* NetSerializer list serializer.

* Update Actions workflows to handle the new submodule.

* Whoops
2020-07-28 18:56:20 -07:00
Pieter-Jan Briers 406e5277a6 Integration testing improvements.
Run Update in Integration game loop.
Ability to load extra prototypes from a string.
2020-07-26 14:07:24 +02:00
Pieter-Jan Briers a3d250a5c4 Allow YamlObjectSerializer to read/write immutable interface collections. 2020-07-26 01:35:43 +02:00
ShadowCommanderandGitHub 30108cf992 Refactor DetachParent (#1188) 2020-07-25 17:04:14 +02:00
Acruid 8475c1ae4b Moves all of the PhysicsComponent data to the CollidableComponent, and marks the PhysicsComponent as obsolete. 2020-07-21 23:36:42 -07:00
Pieter-Jan Briers 0297464af5 Fix MapID assignment in transform init. 2020-07-22 01:51:17 +02:00
Pieter-Jan Briers bbbaef5da4 Fix integration tests.
They weren't pumping networking anymore because Acruid moved it to Input.
2020-07-20 12:12:56 +02:00
63720cd034 Feature/the macro (#1165)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-07-11 15:03:28 +02:00
Pieter-Jan Briers 93fcb0df9b Move back to per-component-type-dictionaries for component storage.
It's much faster than the single dictionary approach.
2020-07-11 13:15:44 +02:00
Pieter-Jan Briers a2617312d9 Use Serilog internally for logging, add Grafana Loki log handler. 2020-07-10 20:55:31 +02:00
Pieter-Jan Briers 9e5374ac86 Assert that messages have been registerd in integration tests. 2020-07-06 21:24:03 +02:00
Pieter-Jan BriersandGitHub 31fb65bcb9 Movement prediction work. (#1144)
* Fix client-side input system not sending sequence numbers for input messages.

This caused message ordering issues and keys getting stuck down.

* Make sure EyeUpdateSystem runs after physics.

* IGameTiming.TickFraction helper.

* Subtick data for input commands.

* Literally a unit test to verify that I wasn't going insane while debugging input message ordering issues.

* More prediction logs behind net.predict.

* Move physics to shared and run it on the client.

* Synchronize grid gravity.

* Fix ResetPredictedEntities crash when entities get deleted server-side.

* Fix CollidableComponent setters not calling Dirty()

* Fix going into space while predicting.

* Watch window uses history line edit.

* Fix unpredicted objects stuck-jittering.

* VV tags for interp vars on transform.

* Fix 0 mass objects on client.

* Fix friction calculations being TPS dependent.

* Reset predict flag on handelComponentState
2020-06-24 20:47:20 +02:00