-
Notifications
You must be signed in to change notification settings - Fork 1
Description
A lobby is a "room" for players that will play together (free-for-all).
Each lobby consists of:
- Unique identifier (UUIDv4). May be used to join lobbies (both public and private).
- Lobby name.
- Player limit - max amount of simultaneous players.
- Joined player list - username, role.
- Creator/owner username.
- Whether the lobby is started (match is ongoing).
- Whether the lobby is public or private.
- Game Settings (explained later).
Lobbies are stored in memory without any sort of persistence.
Each lobby (probably) should be in a separate task/thread.
Any player (client) may create a lobby, but simultaneous lobby count is limited to 1 per user.
If a player leaves an empty lobby (i.e. there only was him and nobody else), the lobby gets removed.
Otherwise if at least 1 player stays in the lobby after the leave, he becomes an owner of this particular lobby. New owner is chosen randomly.
The owner, and owner only, may start a new match at any time.
Each match may have different game settings. See the structure below:
Quader/src/engine/src/game_settings.rs
Line 93 in c552734
| pub struct GameSettings { |
Owner is able to change settings at any time if the lobby is not started.
Only authorized users may join and create lobbies.
Subtasks:
- Basic lobby creation
- Ability to create and join lobbies
- Ability to change lobby settings (name, player limit, publicity)
- Correct lobby handling (lobby count per player, lobby invalidation, etc)
- Support for custom game settings, as well as changing it on the fly is the lobby is not started
- Check user authorization