r-type  0.0.0
R-Type main
Loading...
Searching...
No Matches
srv::Lobby Struct Reference

Represents a game lobby (room) where players gather before starting a game. More...

#include <AsioServer.hpp>

+ Collaboration diagram for srv::Lobby:

Public Member Functions

 Lobby ()
 Default constructor.
 
 Lobby (std::uint32_t id, const std::string &name, std::uint32_t host, std::uint8_t max, std::uint8_t mode)
 Parameterized constructor.
 

Public Attributes

std::uint32_t lobbyId
 Unique lobby identifier.
 
std::string lobbyName
 Human-readable lobby name.
 
std::uint32_t hostSessionId
 Session ID of the lobby host.
 
std::vector< std::uint32_t > playerSessions
 List of player session IDs in this lobby.
 
std::uint8_t maxPlayers
 Maximum number of players allowed (1-8)
 
std::uint8_t gameMode
 Game mode identifier.
 
rnp::LobbyStatus status
 Current lobby status.
 
std::chrono::steady_clock::time_point createdTime
 Timestamp when lobby was created.
 

Detailed Description

Represents a game lobby (room) where players gather before starting a game.

Contains all lobby metadata including players, host, game mode, and status. Lobbies are managed by the server and synchronized across all members.

Definition at line 82 of file AsioServer.hpp.

Constructor & Destructor Documentation

◆ Lobby() [1/2]

srv::Lobby::Lobby ( )
inline

Default constructor.

Creates an empty lobby with default values

Definition at line 97 of file AsioServer.hpp.

◆ Lobby() [2/2]

srv::Lobby::Lobby ( std::uint32_t id,
const std::string & name,
std::uint32_t host,
std::uint8_t max,
std::uint8_t mode )
inline

Parameterized constructor.

Parameters
idUnique lobby identifier
nameLobby display name
hostSession ID of the host player
maxMaximum number of players (1-8)
modeGame mode identifier

Definition at line 111 of file AsioServer.hpp.

Member Data Documentation

◆ createdTime

std::chrono::steady_clock::time_point srv::Lobby::createdTime

Timestamp when lobby was created.

Definition at line 91 of file AsioServer.hpp.

◆ gameMode

std::uint8_t srv::Lobby::gameMode

Game mode identifier.

Definition at line 89 of file AsioServer.hpp.

Referenced by srv::AsioServer::lobbyToLobbyInfo().

◆ hostSessionId

std::uint32_t srv::Lobby::hostSessionId

Session ID of the lobby host.

Definition at line 86 of file AsioServer.hpp.

Referenced by srv::AsioServer::lobbyToLobbyInfo().

◆ lobbyId

std::uint32_t srv::Lobby::lobbyId

Unique lobby identifier.

Definition at line 84 of file AsioServer.hpp.

Referenced by srv::AsioServer::lobbyToLobbyInfo().

◆ lobbyName

std::string srv::Lobby::lobbyName

Human-readable lobby name.

Definition at line 85 of file AsioServer.hpp.

Referenced by srv::AsioServer::lobbyToLobbyInfo().

◆ maxPlayers

std::uint8_t srv::Lobby::maxPlayers

Maximum number of players allowed (1-8)

Definition at line 88 of file AsioServer.hpp.

Referenced by srv::AsioServer::joinLobby(), and srv::AsioServer::lobbyToLobbyInfo().

◆ playerSessions

std::vector<std::uint32_t> srv::Lobby::playerSessions

List of player session IDs in this lobby.

Definition at line 87 of file AsioServer.hpp.

Referenced by srv::AsioServer::createLobby(), srv::AsioServer::joinLobby(), and srv::AsioServer::lobbyToLobbyInfo().

◆ status

rnp::LobbyStatus srv::Lobby::status

Current lobby status.

Definition at line 90 of file AsioServer.hpp.

Referenced by srv::AsioServer::joinLobby(), and srv::AsioServer::lobbyToLobbyInfo().


The documentation for this struct was generated from the following file: