View Source Teiserver.Game.Lobby (Teiserver v0.0.4)
Lobby
A lobby is a place for users to gather and form a game instance. Once the lobby starts it becomes a match, once the match ends the users return to the lobby.
For a guide on the lifecycle of lobbies and matches please see the Match lifecycle guide
.
Attributes
:id
- The id of the lobby in question:match_id
- The id of the match for this lobby:host_id
- The user_id of the creator of the lobby:match_ongoing?
- True if the match is currently in progress:host_data
- A map of the data relevant to the host of the game, if the data is set to nil it means the host is currently disconnected but the ClientServer process has yet to time out:name
- The name of the lobby as displayed in lobby lists:tags
- A list of strings representing tagged values:password
- The (plaintext) password for the lobby, nil if no password:passworded?
- Boolean of the room having a password or not, overloads the :password property for ease of use:locked?
- Boolean of the room being locked to the general public at this stage:public?
- Boolean of the room being public or not, when set to false updates to this lobby won't appear in global_battle updates:match_type
- MatchType.id of the type of match this will be:rated?
- When set to true it means the game will be rated (assuming all other requirements are met):queue_id
- The ID of the queue (matchmaking) this lobby belongs to:game_name
- String of the game name:game_version
- String of the game version:game_settings
- Map of the settings to be used in starting the game:players
- List of user_ids as players, source of truth is still client state:spectators
- List of user_ids spectating, source of truth is still client state:members
- Total list of all user_ids who are members of the lobby:approved_members
- A list of users approved to join the lobby bypassing some of the normal checks:update_id
- The version ID of the update to ensure updates can be discarded if out of date or duplicates
Summary
Types
@type id() :: Ecto.UUID.t()
@type name() :: String.t()
@type t() :: %Teiserver.Game.Lobby{ approved_members: [Teiserver.user_id()], game_name: String.t() | nil, game_settings: map(), game_version: String.t() | nil, host_data: map() | nil, host_id: Teiserver.user_id() | nil, id: id() | nil, locked?: boolean(), match_id: Teiserver.Game.Match.id() | nil, match_ongoing?: boolean(), match_type: Teiserver.Game.MatchType.id(), members: [Teiserver.user_id()], name: name() | nil, password: String.t(), passworded?: boolean(), players: [Teiserver.user_id()], public?: boolean(), queue_id: Teiserver.queue_id(), rated?: boolean(), spectators: [Teiserver.user_id()], tags: [String.t()], update_id: non_neg_integer() | nil }
A lobby
Functions
@spec new(Teiserver.user_id(), name()) :: t()