Skip to content

Architecture

Fabian Eberts edited this page Apr 25, 2026 · 1 revision

The diagram below illustrates how all the components interact. Each component (shown in bold) is implemented in a separate module.

Server and framework architecture

The API loosely follows the REST approach. TCP is used to connect to the server. The server handles each connection in a separate thread and passes the request to the framework. The corresponding handler then processes the request and eventually hands it to the specific game session and game class.

Abstraction

New games are added by deriving from a base class for games. Only a few methods need to be overridden. These methods supply the framework with all information needed to host a game session. This way, the complexity of the framework is hidden from the programmer who can in turn focus on the game logic.

Data exchange

JSON is used for data exchange. The API function to submit moves accepts keyword arguments. These are translated into a JSON string. On the server, the data is converted into a dictionary, which is then passed to the game class. To provide the client with the game state, it is packed into a dictionary within the game class. This way, no modifications to the API are required when adding new games.

Clone this wiki locally