Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[server] Implement lobbies #5

Open
6 tasks
lunacys opened this issue Apr 24, 2024 · 0 comments
Open
6 tasks

[server] Implement lobbies #5

lunacys opened this issue Apr 24, 2024 · 0 comments
Labels
feature A new feature server Game Server related tasks

Comments

@lunacys
Copy link
Collaborator

lunacys commented Apr 24, 2024

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:

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
@lunacys lunacys added server Game Server related tasks feature A new feature labels Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature server Game Server related tasks
Projects
None yet
Development

No branches or pull requests

2 participants