ISY Gameserver protocol¶
How your game program talks to the game server.
Not final yet
The basic rules will stay the same. Some command names and data fields may still change.
Where do I go?¶
| I want to... | Go to |
|---|---|
| start fast with working Java code | Java client |
| run the game server on my computer | Try it on your computer |
| know what a line looks like | Messages |
know what <id>, <m> or <name> means |
Placeholders |
| connect and say hello | Connecting |
| log in | Connecting |
| pick WebSocket or telnet | Connecting |
| know if my connection is alive | Connecting |
| come back after losing connection | Reconnecting |
| know what an error means | Errors |
| find a command | Commands |
| join a game | Commands |
| play Tic-Tac-Toe | Tic-Tac-Toe |
| play Battleship | Battleship |
| play Connect-4 | Connect-4 |
| check my client before I hand it in | Checklist |
A short game¶
C: REQ <id1> session.hello {"version": 1}
S: RES <id1> OK
C: REQ <id2> session.login {"player": "<name>"}
S: RES <id2> OK {"session_token": "<session_token>"}
C: REQ <id3> lobby.subscribe {"game": "tic-tac-toe"}
S: RES <id3> OK
S: EVT <m> game.match_started {"opponent": "<other>", "to_move": "<name>"}
S: EVT <m> game.your_turn
C: REQ <id4> <m> game.action {"type": "move", "move": <move>}
S: RES <id4> OK
S: EVT <m> game.action {"type": "move", "player": "<name>", "move": <move>}
C:= your program sends thisS:= the server sends thisREQ,RES,EVT: the tags that start each line<id>,<m>,<name>...: placeholders. Put in the real value.
Try it on your computer¶
Run the game server from the root of this repository. Pick one:
- With .NET 10:
dotnet run --project ISY-Gameserver/ISY-Gameserver.csproj - With Docker:
docker compose -f docker/compose.yaml up --build
Then connect to ws://localhost:8080/ws for WebSocket, or to localhost:8023 for telnet. See WebSocket or telnet?
Only Tic-Tac-Toe so far
You can play Tic-Tac-Toe. For battleship and connect4, lobby.subscribe answers ERR UNKNOWN_GAME until those games are added.
Not on these pages¶
- The old (legacy) protocol. It has its own server port and its own rules.