Documentation
¶
Overview ¶
Package gamelab is GameLab, a game backend: sign-in and a leaderboard over HTTP, matchmaking over WebSocket, and a UDP game server that players join with the ticket matchmaking gave them and send inputs to, answered on the server's tick. It is the reference app for the gaming pack.
Planted bottlenecks (see README.md), each switched off by a fix flag:
- matchmaking: every tick, each waiting player is compared with every other to find the closest ratings, while holding the queue lock that joins also need, so the work grows with the square of the queue during a rush (fix "matchmaking" sorts the queue by rating once and groups neighbours).
- leaderboard: each score re-sorts the whole leaderboard under its lock and each rank lookup scans it, so score submissions and reads slow down with the number of players (fix "leaderboard" keeps it sorted with binary-search inserts and finds ranks the same way).
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Modes = map[string]int{"duel": 2, "squad": 4}
Modes are the match sizes players can queue for.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.