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

Use websocket for client communication #239

Open
nirs opened this issue Oct 23, 2017 · 2 comments
Open

Use websocket for client communication #239

nirs opened this issue Oct 23, 2017 · 2 comments

Comments

@nirs
Copy link
Member

nirs commented Oct 23, 2017

Currently we have listen to 2 ports:

  • TCP/8888 - using line based protocol, used by rose-client
  • TCP/8880 - used for web side, xmlrpc, and websocket

Trying to deploy on Heroku (see #187), it seems that we don't have a way to serve a custom port in this platform. I'm not sure if this is also an issue on OpenShift.

We discussed offline the option of replacing the custom port with websocket, enabling deployment on Heruko and other platforms that are optimized for web development.

New design

Player connection protocol

  • player: connect to server using websocket
  • server: accept connection, wait for message
  • player: send "join" message
  • server: register player, send "update" message to all clients

Watcher connection protocol

  • watcher: connect to server using websocket
  • server: accept connection, wait for message
  • watcher: send "watch" message
  • server: register watcher, send "update" message to all clients

Game protocol

  • server: send "update" message with "started: true" to all clients
  • player: send "drive" message
  • watcher: update the UI

Game completion

  • server: send "update" message with "started: false"
  • player: ignore
  • watcher: update the UI

Changes needed

@nirs
Copy link
Member Author

nirs commented Oct 23, 2017

@cben, @yaacov, @rollandf, can you review this?

@nirs
Copy link
Member Author

nirs commented Oct 23, 2017

I think we need to convert this proposal to documentation. We should have docs/architecture.md document explaining how the game works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants