Configuration

The server is configured through a TOML file. For available options see comprl.server.config.Config below. Entries in the config file should have same name as the Config class attributes. Default value “???” means that the parameter is required. For all others the corresponding default value is used if not set.

class comprl.server.config.Config(port: int = 8080, server_update_interval: float = 1.0, timeout: int = 10, log_level: str = 'INFO', game_path: Path = '???', game_class: str = '???', database_path: Path = '???', data_dir: Path = '???', gauss_leaderboard_rater_sigma: float = 20.0, match_quality_threshold: float = 0.3, percentage_min_players_waiting: float = 0.1, percental_time_bonus: float = 0.1, max_parallel_games: int = 100, monitor_log_path: Path | None = None, registration_key: str = '', server_url: str = 'comprl.example.com')

Configuration settings.

data_dir : Path = '???'

Path to the data directory (used to save data like game actions)

database_path : Path = '???'

Path to the database file

game_class : str = '???'

Class name of the game

game_path : Path = '???'

File containing the game class to run

gauss_leaderboard_rater_sigma : float = 20.0

Sigma value for the GaussLeaderboardRater.

log_level : str = 'INFO'

Log level used by the server

match_quality_threshold : float = 0.3

Threshold for matching players

max_parallel_games : int = 100

Maximum number of games that can be played in parallel

monitor_log_path : Path | None = None

File to which monitoring information is written. Ideally use a in-memory file (e.g. in /dev/shm).

percentage_min_players_waiting : float = 0.1

Percentage of players always waiting in queue

percental_time_bonus : float = 0.1

(Minutes waiting * percentage) added as a time bonus for waiting players

port : int = 8080

Port to listen on

registration_key : str = ''

Key that has to be specified to register

server_update_interval : float = 1.0

Update interval for the matchmaking

server_url : str = 'comprl.example.com'

URL of the competition server

timeout : int = 10

Seconds to wait for a player to answer

Example

[CompetitionServer]
port = 65335
server_update_interval = 5
timeout = 10
log_level = "INFO"
game_path = "hockey_game.py"
game_class = "HockeyGame"
database_path = "hockey.db"
data_dir = "/tmp"

gauss_leaderboard_rater_sigma = 20.0
match_quality_threshold = 0.4
percentage_min_players_waiting = 0.1
percental_time_bonus = 0.1
max_parallel_games = 100
monitor_log_path = "/dev/shm/comprl_monitor"

registration_key = "secret"
server_url = "comprl.example.com"