Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Join a lobby as the local PlayFab entity.
Syntax
HRESULT PFMultiplayerJoinLobby(
PFMultiplayerHandle handle,
const PFEntityKey* newMember,
const char* connectionString,
const PFLobbyJoinConfiguration* configuration,
void* asyncContext,
PFLobbyHandle* lobby
)
Parameters
handle PFMultiplayerHandle
The handle of the PFMultiplayer API instance.
newMember const PFEntityKey*
The local entity joining the lobby.
connectionString const char*
is null-terminated
The connection string used by the entity to join the lobby.
configuration const PFLobbyJoinConfiguration*
The initial configuration data used when joining the lobby.
asyncContext void*
optional
An optional, app-defined, pointer-sized context value that can be used to associate the completion state change with this call.
lobby PFLobbyHandle*
optional, library-allocated output
An optional output lobby handle. If the call succeeds, the handle is available immediately, before the asynchronous operation completes, and you can use it to queue other operations on the lobby.
Return value
Type: HRESULT
S_OK if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via PFMultiplayerGetErrorMessage().
Remarks
This is an asynchronous operation. Upon successful completion, the title will be provided a PFLobbyMemberAddedStateChange followed by a PFLobbyUpdatedStateChange and PFLobbyJoinLobbyCompletedStateChange with the PFLobbyJoinLobbyCompletedStateChange::result field set to S_OK. Upon a failed completion, the title will be provided a PFLobbyJoinLobbyCompletedStateChange with the PFLobbyJoinLobbyCompletedStateChange::result field set to a failure.
Before you call this function, call PFMultiplayerSetEntityToken for newMember. If no token is set for that entity, the call fails synchronously with 0x89236402 and no state change is provided. The call also fails synchronously with 0x89236404 if the id or type field of newMember is null or empty, and with E_POINTER if newMember, connectionString or configuration is null. If this call fails synchronously and you supplied the optional lobby output, *lobby is null. For all error codes, see PlayFab Multiplayer C++ SDK error codes.
Requirements
Header: PFLobby.h