-
-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adds a memory mirrored ring buffer for networking. (#1533)
## Breaking Changes Incoming packet registration signature has changed to: ```cs delegate* void OnReceiveCallback(NetState state, SpanReader reader, int packetLength); IncomingPackets.Register(int packetID, int length, bool ingame, OnReceiveCallback onReceive); ``` For example, an incoming packet handler signature would now look like this: ```cs public static void SomeIncomingPacket(NetState state, SpanReader reader, int packetLength) { // Parse the data } ``` ## Summary Updates the network Pipe class to use a mirrored memory technique. This technique involves mapping the same physical memory to two contiguous virtual memory spaces so the byte buffer appears duplicated. This allows writing to a double-sized array to wrap around without the need for the `CircularBuffer` classes. In practice this allows us to use `Span<byte>` as if the buffer was a regular array. ### Bug Fixes - [X] Fixes bad fixed length string parsing
- Loading branch information
1 parent
629a500
commit 10a69bf
Showing
83 changed files
with
925 additions
and
2,399 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 0 additions & 103 deletions
103
Projects/Server.Tests/Tests/Buffers/CircularBufferReaderTests.cs
This file was deleted.
Oops, something went wrong.
82 changes: 0 additions & 82 deletions
82
Projects/Server.Tests/Tests/Buffers/CircularBufferWriterTests.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.