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

Add matchmaking/cancelled event #34

Merged
merged 1 commit into from
Sep 15, 2024

Conversation

geekingfrog
Copy link
Contributor

Adding an event to boot a player out of matchmaking. 2 reasons I can see where this is needed:

  1. a party member leave the matchmaking, and thus other party members are evicted
  2. server's component crash. If something goes wrong and the server cannot recover the matchmaking state of the player, it's better to eject them so they can retry/reset.

@geekingfrog geekingfrog marked this pull request as ready for review September 11, 2024 18:59
"Server may send this event at any point when the user is queuing to indicate that the user has been booted out the matchmaking system.",
event: {
data: Type.Object({
reason: Type.String(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to try and keep properties like this as explicit as possible where we can, unless it really doesn't make sense. For example, here I would change Type.String() to Type.Union([ Type.Literal("intentional"), Type.Literal("party_user_left"), Type.Literal("server_playlists_changed") ]). If we need to add or remove reasons later we can easily do so, but this approach improves the typing for protocol consumers and makes it easy for client devs to see what possible reasons to expect here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And for any free form text there can be additional details field as in responses

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amended the commit to hardcode some reasons.

@p2004a p2004a merged commit 1b77a23 into beyond-all-reason:master Sep 15, 2024
1 check passed
@geekingfrog geekingfrog deleted the add-cancelled branch September 30, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants