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

Things to change for a protocol v2 #573

Open
12 of 31 tasks
Askaholic opened this issue Apr 11, 2020 · 6 comments
Open
12 of 31 tasks

Things to change for a protocol v2 #573

Askaholic opened this issue Apr 11, 2020 · 6 comments
Labels
proposal A feature or change that is up for discussion
Milestone

Comments

@Askaholic
Copy link
Collaborator

Askaholic commented Apr 11, 2020

I'd like to start keeping track of things we want to change in a new protocol.

Stuff to remove

Stuff to change

  • Rework command_avatar
    • Rename action list_avatar to list
    • Return avatar id's in avatar list
    • Select avatar via id instead of url
  • Move from UTF-16 to UTF-8 Support multiple servercontexts #629
    We are just wasting bytes
  • Move the protocol to websocket, choose a websocket subprotocol (e.g. STOMP?)
    This would allow more web interactions
  • Guarantee that every message is a json dictionary (not a list)
    Simplifies parsing
  • Change all unix timestamps to ISO timestamps. For example launched_at in game_info
  • Remove or rework ping and pong commands? Maybe only send them if no other messages have been sent
  • Rework game_info so that messages are not sent sometimes as a list and sometimes as individual games
  • Use player id instead of username in game_info teams section Lobby list json additional info. #812
  • Don't send game_launch message when match is cancelled v2 - Remove Deprecations #816
    Handle match_cancelled instead
  • Rework command_ask_session
    What is the point? What does the policy server use this for? Can it be removed?

Stuff to add

Fancy features

  • Auto-generate documentation or describe protocol in a formal language that allows creation of code in multiple languages
    Use dataclasses to describe message fields
@Brutus5000
Copy link
Member

Brutus5000 commented Apr 11, 2020

  • Move from UTF-16 to UTF-8
  • Add messageId to every message (or a message envelope)
  • Move the protocol to websocket, choose a websocket subprotocol (e.g. STOMP?)
  • Auto-generate documentation of the new protocol or describe protocol in a formal language that allows creation of code from it in multiple languages
  • Some messages are either Object or List.
    • every message should be a json object
    • if it needs a list, make it contain a list
    • if the list only contains one item, it's still a list

@Askaholic
Copy link
Collaborator Author

Which messages are sent as a list?

@Brutus5000
Copy link
Member

I think it's the list of open games.

Also documenting the new protocol is not a fancy feature, it should be mandatory. Otherwise in 3 years the next dev sits here and tries to find all the details of the protocol

@Askaholic Askaholic added the proposal A feature or change that is up for discussion label Feb 24, 2021
@Askaholic Askaholic added this to the v2.0 milestone Aug 1, 2021
@Brutus5000
Copy link
Member

Additional things I'd like to see:

  • Publish all events on RabbitMQ as well
  • New "a player logged in" event (skip if there is already an open session from another connection)
  • New "a player logged of" event (only if the last connection is closed)
  • New "player joined game" event
  • New "player left game" event
  • New "game started" event

@Askaholic
Copy link
Collaborator Author

I think that could just be a normal issue as it doesn’t require breaking changes to the protocol.

@Sheikah45
Copy link
Member

Saying now that we shouldn't remove ping and pong as I am now going to use them to check if the connection is still alive client side as I realized that the client will only say the connection is closed due to internet outage when it fails on write which right now all write actions require user action so the client doesn't know a connection is dead until the user takes action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal A feature or change that is up for discussion
Projects
None yet
Development

No branches or pull requests

3 participants