Discord Social SDK
|
A LobbyMemberHandle represents the state of a single user in a Lobby.
The SDK separates lobby membership into two concepts:
Connected
boolean tells you whether the user is actively connected to the lobby.Handle objects in the SDK hold a reference both to the underlying data, and to the SDK instance. Changes to the underlying data will generally be available on existing handles objects without having to re-create them. If the SDK instance is destroyed, but you still have a reference to a handle object, note that it will return the default value for all method calls (ie an empty string for methods that return a string).
Public Member Functions | |
LobbyMemberHandle (LobbyMemberHandle &&other) noexcept | |
Move constructor for LobbyMemberHandle. | |
LobbyMemberHandle & | operator= (LobbyMemberHandle &&other) noexcept |
Move assignment operator for LobbyMemberHandle. | |
operator bool () const | |
Returns true if the instance contains a valid object. | |
LobbyMemberHandle (const LobbyMemberHandle &other) | |
Copy constructor for LobbyMemberHandle. | |
LobbyMemberHandle & | operator= (const LobbyMemberHandle &other) |
Copy assignment operator for LobbyMemberHandle. | |
bool | CanLinkLobby () const |
Returns true if the user is allowed to link a channel to this lobby. | |
bool | Connected () const |
Returns true if the user is currently connected to the lobby. | |
uint64_t | Id () const |
The user id of the lobby member. | |
std::unordered_map< std::string, std::string > | Metadata () const |
Metadata is a set of string key/value pairs that the game developer can use. | |
std::optional< discordpp::UserHandle > | User () const |
The UserHandle of the lobby member. | |
Static Public Attributes | |
static const LobbyMemberHandle | nullobj |
Uninitialized instance of LobbyMemberHandle. | |
|
noexcept |
Move constructor for LobbyMemberHandle.
discordpp::LobbyMemberHandle::LobbyMemberHandle | ( | const LobbyMemberHandle & | other | ) |
Copy constructor for LobbyMemberHandle.
bool discordpp::LobbyMemberHandle::CanLinkLobby | ( | ) | const |
Returns true if the user is allowed to link a channel to this lobby.
Under the hood this checks if the LobbyMemberFlags::CanLinkLobby flag is set. This flag can only be set via the server API, add_lobby_member The use case for this is for games that want to restrict a lobby so that only the clan/guild/group leader is allowed to manage the linked channel for the lobby.
bool discordpp::LobbyMemberHandle::Connected | ( | ) | const |
Returns true if the user is currently connected to the lobby.
uint64_t discordpp::LobbyMemberHandle::Id | ( | ) | const |
The user id of the lobby member.
std::unordered_map< std::string, std::string > discordpp::LobbyMemberHandle::Metadata | ( | ) | const |
Metadata is a set of string key/value pairs that the game developer can use.
A common use case may be to store the game's internal user ID for this user so that every member of a lobby knows the discord user ID and the game's internal user ID mapping for each user.
|
inline |
Returns true if the instance contains a valid object.
LobbyMemberHandle & discordpp::LobbyMemberHandle::operator= | ( | const LobbyMemberHandle & | other | ) |
Copy assignment operator for LobbyMemberHandle.
|
noexcept |
Move assignment operator for LobbyMemberHandle.
std::optional< discordpp::UserHandle > discordpp::LobbyMemberHandle::User | ( | ) | const |
The UserHandle of the lobby member.
|
static |
Uninitialized instance of LobbyMemberHandle.