Redigera

PFMultiplayerConnectToLobby

Important

XBOX Docs are now on docs.xbox.com! This page is kept as an archive and is no longer being updated. Visit our documentation on docs.xbox.com for the latest information and updates.

Visit the latest docs on docs.xbox.com

Connect to a lobby in which the local PlayFab entity was already added as a member.

Syntax

HRESULT PFMultiplayerConnectToLobby(  
    PFMultiplayerHandle handle,  
    const PFEntityKey* newMember,  
    const char* lobbyId,  
    void* asyncContext,  
    PFLobbyHandle* lobby  
)  

Parameters

handle   PFMultiplayerHandle

The handle of the PFMultiplayer API instance.

newMember   PFEntityKey*

The local entity connecting to the lobby.

lobbyId   char*
is null-terminated

The ID of the Lobby to connect.

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

The optional, output lobby object which can be used to queue operations for immediate execution of this operation completes.

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 PFLobbyConnectToLobbyCompletedStateChange with the PFLobbyConnectToLobbyCompletedStateChange::result field set to S_OK. Upon a failed completion, the title will be provided a PFLobbyConnectToLobbyCompletedStateChange with the PFLobbyConnectToLobbyCompletedStateChange::result field set to a failure.

Requirements

Header: PFLobby.h

See also

PFLobby members