Commit Graph
14 Commits
Author SHA1 Message Date
b8e5b47e7a Use 'new' expression in places where the type is evident for the engine (#1415)
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-11-26 00:16:55 +01:00
Pieter-Jan Briers 362b7804d9 Fix issues with .NET 5. 2020-11-11 00:46:35 +01:00
DrSmugleafandGitHub 23c0984d2e Change integration tests to use LoginType.GuestAssigned instead of Guest (#1308) 2020-10-09 11:38:53 +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
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 9e5374ac86 Assert that messages have been registerd in integration tests. 2020-07-06 21:24:03 +02:00
Pieter-Jan Briers aaa09881cb Enable NRTs for unit tests. 2020-06-12 17:11:32 +02:00
Pieter-Jan Briers 9eeb1d1afa Fix compiler warnings 2020-05-28 17:44:31 +02:00
Pieter-Jan Briers b7f3627ef1 Remove List<>/Dictionary<,> usage from low-level GameState serialization.
NetSerializer does not handle these well and sends the entire backing array instead of a more compact representation. This can then cause it to start sending lists of length 1 with a *capacity* of 4096 resulting in 250 KiB/s down to send updates for a single entity. As it just did on the public server...
2020-05-12 18:34:16 +02:00
Jackson LewisandGitHub 10f98e2fca ServerEntityNetworkManager doesn't dispatch messages if the client got disconnected (#1030) 2020-04-20 15:46:11 +02:00
Pieter-Jan Briers ba933f7db0 Improvements to allow better connection dialog in content. 2020-04-17 14:41:22 +02:00
Pieter-Jan Briers 9cca7ce8ef Expose client connection state. 2020-04-04 15:07:31 +02:00
Pieter-Jan Briers ada2c3f39c Fix handling of disconnects in the integration test netmanager.
Clients would treat any message coming in as being from the server they're connected to, instead of ignoring them if they're not correct.

This made the client crash inside integration tests because messages came in while disconnected.

This fixes that.
2020-01-26 23:51:57 +01:00
Pieter-Jan Briers 9a4c1cae1e Networked integration tests work. 2019-06-28 16:03:58 +02:00