Edit

PFMultiplayerJoinLobbyAsServer

Join a client-owned lobby as a server.

Syntax

HRESULT PFMultiplayerJoinLobbyAsServer(  
    PFMultiplayerHandle handle,  
    const PFEntityKey* server,  
    const char* connectionString,  
    const PFLobbyServerJoinConfiguration* configuration,  
    void* asyncContext,  
    PFLobbyHandle* lobby  
)  

Parameters

handle   PFMultiplayerHandle

The handle of the PFMultiplayer API instance.

server   const PFEntityKey*

The PlayFab Entity Key of the server joining the lobby. Its entity type must be game_server.

connectionString   const char*
is null-terminated

The connection string used by the server to join the lobby.

configuration   const PFLobbyServerJoinConfiguration*

The initial server-owned data to be stored 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

To use this feature, you must define PFMULTIPLAYER_INCLUDE_SERVER_APIS before including PFLobby.h.

This is an asynchronous operation. Completion of this method's execution isn't necessarily completion of the operation.

Upon successful completion, the title is provided a PFLobbyUpdatedStateChange with the PFLobbyUpdatedStateChange::serverUpdated member appropriately populated, and a PFLobbyJoinLobbyAsServerCompletedStateChange with the PFLobbyJoinLobbyAsServerCompletedStateChange::result field set to S_OK.

Upon a failed completion, the title is provided a PFLobbyJoinLobbyAsServerCompletedStateChange with the PFLobbyJoinLobbyAsServerCompletedStateChange::result field set to a failure.

This operation is restricted to client-owned lobbies that are using connections.

Before you call this function, call PFMultiplayerSetEntityToken for server. If no token is set for that entity, the call fails synchronously.

Requirements

Header: PFLobby.h

See also

PFLobby members