Stratego server protocol description


contents:ASCII-lines terminated with \n (0x0a)
  • client connects to the server at port 8890
  • server sends 'auth-req'
  • client responds with a username and password, each on a new line and terminated with a linefeed (\n or 0x0a). to register a new account, just use an account that is not in use yet. the server then automatically creates a new account for you with the password you selected
  • if authentication succeeded, the server sends 'auth-ok' or 'auth-err'
  • then the client waits until the server sends 'new'. if a game ended, the client should go back to this point where it waits for this new command (*1)
  • the server sends you 'color red' or 'color blue'; the color you need to use
  • at this point you send your board-setup, line 1 to 4 and if you're blue line 10 to 7
  • after that the server sends 'endsetup'
  • if it is your turn to move, the server sends you 'get-move' - if you battled an opponent piece the server sends you the type of the opponent ('V', 'M', see below) or 'none' if you moved to an empty field. if the other client moves, you'll receive a move in ff-tt[-t] format (*2)
  • each move is in ff-tt[-t] format: xy(from)-xy(to) and if the opponent was batteling an object of you, '-t' is one of the types as listed below ('G', 'R', etc.). all uppercase and A1 is red-side left bottom, J10 is right side, first line of blue. so red stars with [a-j][1-4] while blue starts with [a-j][7-10]
  • when the end of the game is reached, the server send 'winner red' or 'winner blue' and the client should go to step *1, if the game has not finished, go to step *2

Characters to use for a piece-type

  • V: VLAG (flag)
  • M: MAARSCHALK (marshal)
  • G: GENERAAL (general)
  • K: KOLONEL (colonel)
  • J: MAJOOR (majoor)
  • P: KAPITEIN (captain)
  • L: LUITENANT (lieutenant)
  • S: SERGEANT (sergeant)
  • I: MINEUR (minor)
  • R: VERKENNER (explorer)
  • O: SPION (spy)
  • B: BOM (bomb)

Example dump

S: auth-req
C: username
S: auth-ok
S: new
S: color red
C: VMGKKJJJPP  (line 1)
   PPLLLLSSSS  (line 2)
   IIIIIRRRRR  (etc.)
S: endsetup
S: get-move
C: B4-B5
S: A7-A4-R   Here an explorer moves to catch a piece at A4, so the server tells using '-R' its type.
S: winner red

The Lotter allows you to participate in lotteries from all over the world!