Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broadcast gameplay events for third-party use #263

Draft
wants to merge 41 commits into
base: master
Choose a base branch
from
Draft

Conversation

LumpBloom7
Copy link
Owner

@LumpBloom7 LumpBloom7 commented Sep 21, 2021

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

  • A different method may need to be considered if named pipes are inadequate, for platform/language compatibility or any other reasons.
  • I believe the 8 bits we use is sufficient to transmit all of the events that I could think of, most of which are to program ring button behavior. This may need to be expanded based on needs.
  • Currently, only one client can receive events. The first one to connect will get all the events. Will we even need more than one client running locally on any given machine?
  • 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

@LumpBloom7 LumpBloom7 added the enhancement New feature or request label Sep 21, 2021
@LumpBloom7 LumpBloom7 self-assigned this Sep 21, 2021
@LumpBloom7 LumpBloom7 force-pushed the pipe-dreams branch 2 times, most recently from 925f883 to 5b8c17c Compare September 21, 2021 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Share sentakki gameplay events with other programs
1 participant