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

Proposals for some new WebSocket structs/events #14

Closed
CrsiX opened this issue Mar 28, 2023 · 3 comments
Closed

Proposals for some new WebSocket structs/events #14

CrsiX opened this issue Mar 28, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@CrsiX
Copy link
Member

CrsiX commented Mar 28, 2023

Requesting a few new WebSocket message types (maybe as a form of "subtype" of one another, but a dedicated type should be fine as well for most of them):

  • lobby_invitation self-explanatory, user gets invited to a lobby (already exists as HTTP API, but there's no way to signal it to a client yet)
  • lobby_kick user gets kicked out of his current lobby (of course, only when kicking of users gets implemented)
  • lobby_closed user's current lobby gets closed (may be combined with the previous, but please differentiate those two cases by some flag); the result is the same: the lobby is (temporarily?) inaccessible
  • game_finished if a game has been finished for some reason, e.g. victory or resigning (which means: the player may attempt to download the latest game state, but should remove the game from the active list)
  • friend_request for new incoming friend requests (same form as FriendRequestResponse?)
  • friendship_change if the other user rejected established friendship or dropped a friend request (to update the client's local view)
  • account_updated if the user's local account has been changed (e.g. new username)
  • account_deleted same as above, may be combined; the WebSocket may be closed after this message, but it's useful to tell a client that his account got removed, because otherwise it would try to-relogin due to invalid session and ultimately break with "unknown username", which is not very user-friendly and there's no better way to determine this situation otherwise

Use snake_case or CamelCase or whatever you want.

Of course, all of those are up to discussion and refinement.

@CrsiX CrsiX added the enhancement New feature or request label Mar 28, 2023
@myOmikron
Copy link
Member

myOmikron commented Apr 8, 2023

Some comments:

  • lobby_invitation is already implemented. If an inventation is created, a WsMessage::IncomingInvite is sent
  • lobby_kick: Sounds fine
  • lobby_closed: If a client was kicked, I'll only invoke lobby_kick. If he tries to rejoin the lobby, he will receive either receive a MissingPrivileges or a new error type (I've not decided that yet). If the lobby was closed this message will be invoked.
  • game_finished: How does the server know this?
  • friend_request: Sounds fine
  • friendship_change: Sounds fine
  • account_updated: Sounds fine
  • I don't see the point in account_deleted. If a user has deleted its account, he shouldn't be very surprised by a unknown username.

@myOmikron
Copy link
Member

myOmikron commented Apr 8, 2023

TODO for me:

  • Lobby Kick message
  • Lobby leave message
  • Lobby Closed message
  • Incoming friend request
  • Friendship change
  • Account updated

@myOmikron
Copy link
Member

As everything is implemented by now, closing this issue.

Please reopen another issue, when we get to the point to check for game_finished

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

No branches or pull requests

2 participants