Skip to content

Instantly share code, notes, and snippets.

@lambda-fairy
Last active August 29, 2015 14:24
Show Gist options
  • Select an option

  • Save lambda-fairy/5974e06bc85ae213455a to your computer and use it in GitHub Desktop.

Select an option

Save lambda-fairy/5974e06bc85ae213455a to your computer and use it in GitHub Desktop.
Rock Paper Scissors Protocol 1.0

Flow

Handshake

  1. Client: ayy
  2. Server: lmao

Game start

  1. Server: come

Game progress

  1. Client: move
  2. Server: reply
  3. Client: move
  4. ...

Game end

  1. Server: done

Messages

ayy (C)

"ayy" protocol_version client_name client_secret

lmao (S)

"lmao" protocol_version server_name

come (S)

"come" number_of_turns

move (C)

"move" move

reply (S)

"reply" move

done (S)

"done" is_winner opponent_name

error (C, S)

"error" error_code error_message

Errors

  • MismatchedVersion
  • InvalidCommand
  • NameAlreadyTaken
  • IncorrectSecret
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment