Broadcast gameplay events for third-party use #263
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #169
Implements a
GameplayEventBroadcaster
which is responsible for transmitting events to clients. This allows for third party utilities or DIY setups to perhaps do fancy things using the events.The broadcaster uses a
NamedPipeServerStream
to transmit data. There is no reason as to why I chose that, it just worked. May consider using something else if deemed necessary.Clients can use a
NamedPipeClientStream
to connect to the mentioned server, and receive events. A basic client implementation can be found here. (Perhaps a compatible pipe implementation may work as well?)All event broadcasts are 8 bits long, the 5 largest bits used to determine event type, and the smallest 3 for auxiliary information like Lane numbers. The reference data structure for broadcasts can be found here.
Possible considerations
CI on ubuntu seems to fail spectacularly, as if pipes aren't functional. Unsure if it is a problem with dotnet, GitHub Actions, or something I didn't consider. Will get a ubuntu setup running this week to test.It was a problem with me not considering Linux specific exceptions due to the use of sockets