PlayFlowLobbyManagerV2
class.
Properties
Singleton instance of the Lobby Manager. Access all lobby functionality through this.
Returns true if the manager has been successfully initialized.
Gets the full data for the lobby the player is currently in. Returns null if not in a lobby.
Gets the unique ID of the current player, as provided during initialization.
Gets the current state of the lobby session (e.g., Disconnected, InLobby).
Provides access to all lobby-related UnityEvents (e.g., OnLobbyJoined, OnPlayerLeft).
A cached list of all currently available public lobbies. This list is updated automatically if auto-refresh is enabled.
A quick check to see if the player is currently in a lobby.
Returns true if the current player is the host of the lobby they are in.
Gets the invite code for the current private lobby. Returns null if not in a private lobby.
Methods
Initialize
Initialize
CreateLobby
CreateLobby
Creates a new lobby. There are two overloads for this method.Simple:Detailed:
The public name of the lobby.
The maximum number of players.
If true, the lobby will not appear in public searches.
Callback invoked with the created lobby data on success.
Callback invoked with an error message on failure.
The public name of the lobby.
The maximum number of players that can join.
If true, the lobby will not appear in public searches.
If true, players can join even after the match has started.
The server region for the lobby (e.g., “us-west”).
A dictionary of custom game-specific settings.
Callback invoked with the created lobby data on success.
Callback invoked with an error message on failure.
JoinLobby
JoinLobby
JoinLobbyByCode
JoinLobbyByCode
LeaveLobby
LeaveLobby
UpdatePlayerState
UpdatePlayerState
Updates the local player’s custom state data within the lobby. This is useful for synchronizing data like character selection or ready status.
A dictionary representing the player’s custom data.
Callback invoked with the updated lobby data on success.
Callback invoked with an error message on failure.
UpdateStateForPlayer
UpdateStateForPlayer
Updates another player’s custom state data within the lobby. This is a host-only action, useful for things like assigning teams or roles.
The unique ID of the player whose state you want to update.
A dictionary representing the new data for the target player.
Callback invoked with the updated lobby data on success.
Callback invoked with an error message on failure.
KickPlayer
KickPlayer
Kicks a player from the lobby. This can only be called by the host.
The unique ID of the player to remove from the lobby.
Callback invoked with the updated lobby data on success.
Callback invoked with an error message on failure.
TransferHost
TransferHost
Transfers host privileges to another player in the lobby. This can only be called by the current host.
The unique ID of the player who will become the new host.
Callback invoked with the updated lobby data on success.
Callback invoked with an error message on failure.
StartMatch
StartMatch
EndMatch
EndMatch
GetGameServerConnectionInfo
GetGameServerConnectionInfo
Gets the connection details (IP and Port) for the game server if the lobby is in an active match.Returns: A
ConnectionInfo
struct if the server is running, otherwise null
.