Source

futurecrew / protocol.txt

Full commit
All protocol messages are plain text.
Maybe JSON.

- Clients register with server
-- There is no capabilities list.  Just a client ID.
-- We assume that each can at least:
* Display a line of text
* Indicate time remaining to do task
* Have some sort of mechanical interface
* Have some sort of game-over mechanism
* Have some sort of time-critical easy button or lever

- Server sends start of game message, failure count == 0, difficulty = N
- All clients choose from their random problems up to difficulty N.

- client 1 sends to server request, like "patch a to b" with time limit
- Server selects client 2, which is currently free, forwards request to 2
- Server tells client 1 that client 2 is handling it and starts timer
- Client 2 displays message along with some sort of display of remaining time

- if the player handles the request on client 1,
-- client 1 sends notice to server
-- server relays success to client 2
--- client 2 indicates success
--- client 2 clears display
--- client 2 goes back into free pool

- if time limit runs out before the player hanldes the request on client 1,
-- server increments failure count
-- server sends failure notice to client 2
--- client 2 clears display
--- client 2 indicates failure to player
--- client 2 goes back into the free pool
-- server sends failure notice to client 1
--- client 1 indicates failures to player
--- client 1 picks a new problem, goes back to 
-- server sends failure notice to all clients with increased failure count
--- clients can do specific failure modes based on count

- periodically give the players a short break
-- command everyone to switch places
-- flash central lights
-- etc

- when count reaches game limit (3 * number of clients?),
-- server sends game over message