Lobby Data
Steam Lobby Functionality in an easy to use struct
Last updated
Steam Lobby Functionality in an easy to use struct
Last updated
Support us as a and get instant access to all our assets, exclusive tools and assets, escalated support and issue tracking and our gratitude. These articles are made possible by our ... become a sponsor today!
The LobbyData object is a custom CSteamId that carries tools and functions unique to the Steam Lobby system. This object is common between both Unity and Godot game engine integrations.
All data is read on demand and is always up to date with the Lobby object. The only information it stores in local memory is the ID of the lobby its operating on.
The following are constant strings used internally to manage Heathen standard metadata values
DataName
key = name
DataVersion
key = z_heathenGameVersion
DataReady
key = z_heathenReady
DataKick
key = z_heathenKick
DataMode
key = z_heathenMode
DataType
key = z_heathenType
This iterates over the Members array
Returns true if all of the players 'IsReady' is false
This iterates over the Members array
Returns true if all of the players 'IsReady' is true
Returns true if the lobby is full e.g. has no more open slots
Returns the lobby game server data if any
Gets or sets the version of the game the lobby is configured for ... this should match the owners version. This can only be set by the owner of the lobby.
Does this lobby have a game server registered to it
Indicates rather or not this lobby is a group (aka party) lobby. When set to true a metadata value `z_heathenMode` will be set to `Group` and the lobby type will be set to a invisible.
Returns true if the local user is the owner of this lobby
Sets the ready flag for this player on this lobby
Indicates rather or not this lobby is a session lobby. When set to true a metadata value `z_heathenMode` will be set to `Session`. Lobby type is not automatic set when writing to this field. Session type lobbies can technically be of any type.
This returns true if the Lobby Type is known
This indicates rather or not the underlying CSteamID is of the proper Universe and Type it does not indicate that it is a valid entry. E.g. this tells you if the data is of the right shape ... not that it equates to a valid entry in Steam client.
this must create the array each time it is called, so call it once, cash it and use it do not call it multiple times a frame.
Returns an array of all the lobby members.
Gets or sets the max members permitted in this lobby, this can only be set by the owner.
Returns the number of members currently in this lobby
The name of the lobby if stored in the lobby's metadata. Only the owner of the lobby can set this value.
The underlying ulong value of the CSteamID
Returns the type of the lobby if set, if not set this will default to Private, you can check if the type is set with IsTypeSet. Only the owner of the lobby can set this value.
read and write metadata values on the lobby much as you would access members in a dictionary.
This will never throw a key not found exception, if a key is not present it will simply return an empty string.
Functionally the same as setting the Type field, this only works for the owner of the lobby
Sets the lobby as joinable or not. A lobby always starts as joinable, a lobby that is not joinable cannot be joined by anyone not even a friend or an invited user. This can only be used by the owner of the lobby.
Returns all the metadata for the lobby as a string dictionary. This creates the dictionary each time it is called so cashรฉ the value before use or read the values directly from the lobby such as via the indexer.
We have a number of static create methods you can use to quickly create common types of lobbies.
This attempts to join the player to this lobby. The callback parameter of this event expects a handler method such as
This method has several static overloads that can be useful for friend join UI features and similar
In all cases these static members fetch the lobby indicated by either an account ID or the Lobby value its self and then attempts to join it. The callback parameter takes the same for as the instanced method.
Leaves the lobby, if the owner leaves Steam will assigne a new owner.
These methods simply return a valid Lobby object representing the lobby indicated by the provided data.
Get the group lobby the user is a member of if any
Get the session lobby the user is a member of if any
Removes the indicated metadata entry if present, can only be used by the owner of the lobby
Invites the indicated user to the lobby
Searches for a lobby that matches the arguments
Note that Steam's lobby chat sends byte[] data so it can send more than simple text if you need.
Does the kick list contain the members ID;
Removes a member from the kick list if present
Clears the kick list
Gets a list of the IDs in the kick list. This must build the array every time its called so cashe the results and only update when needed.
Set metadata on the local user's LobbyMember
Gets the metadata field from the local user's LobbyMember
Gets the metadata field for the indiacated user
The account ID segment of the full CSteamID, to understand more read .
The underlying uint value of the AccountID_t segment of the CSteamID, to understand more read .
Returns the local user's value for this Lobby.
The data for the owner of the lobby, only the current owner can set this value to some other .
Sends a message over the Lobby chat system. You can use tools like the to help you manage incoming chat messages.
Sets the Game Server information and causes the EventLobbyGameServer event to be raised on the interface and on any attached components.
Marks the ID as a member that should be removed from the lobby. This simply sets the ID to a "kick list" on the lobbies metadata and will cause the EventLobbyAskedToLeave event to be raised for the effected user on the event is present on the interface and .