Project Concepts

IDs

This Project has 3 types of IDs:

User-ID (int)

  • Primary Key for the User database

  • is linked to the matchmaking parameters and elo

Player-ID (UUID)

  • Is used to handle and identify clients internally

  • Only used during runtime

  • There can be different players with the same User-ID

Game-ID (UUID)

  • Is used to identify the game during runtime

  • Is used as a primary key in the game database

  • files name of the game files with all actions

Password/Token

Username and Password

  • Used for login to the website.

  • Can be freely chosen during registration.

  • Username is used for leaderboard.

Token

  • Used for authentication when connecting an agent to the server.

  • Unique for every user (automatically generated).

  • Users can see their access token when logging in to the web interface.

Network Communication

Network communication between server and clients is done using the twisted library.

AMP Protocol - shared/commands

Diagram showing the communication protocol between Server and Client.

Database

Information about users and played games are stored in a database.

UserData

class comprl.server.data.sql_backend.User(username, password, token, role='user', mu=25.0, sigma=8.333)

A User.

mu : Mapped[float]
password : Mapped[bytes]
role : Mapped[str]
sigma : Mapped[float]
token : Mapped[str]
user_id : Mapped[int]
username : Mapped[str]

GameData

class comprl.server.data.sql_backend.Game(game_id, user1, user2, score1, score2, start_time, end_state, winner, disconnected)

Games.

disconnected : Mapped[int | None]
disconnected_ : Mapped['User']
end_state : Mapped[int]
game_id : Mapped[str]
id : Mapped[int]
score1 : Mapped[float]
score2 : Mapped[float]
start_time : Mapped[datetime.datetime]
user1 : Mapped[int]
user1_ : Mapped['User']
user2 : Mapped[int]
user2_ : Mapped['User']
winner : Mapped[int | None]
winner_ : Mapped['User']

Matchmaking

See Ranking and matchmaking.