Modifier

Partager via


PFMultiplayerInitialize

Initializes an instance of the PlayFab Multiplayer library.

Syntax

HRESULT PFMultiplayerInitialize(  
    const char* playFabTitleId,  
    PFMultiplayerHandle* handle  
)  

Parameters

playFabTitleId   char*
is null-terminated

The app's PlayFab Title ID.

handle   PFMultiplayerHandle*
library-allocated output

The output handle of the newly initialized PFMultiplayer API instance.

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 must be called before any other method, aside from PFMultiplayerSetMemoryCallbacks(), and PFMultiplayerSetThreadAffinityMask(). PFMultiplayerInitialize() cannot be called again without a subsequent PFMultiplayerUninitialize() call.

Every call to PFMultiplayerInitialize() should have a corresponding PFMultiplayerUninitialize() call.

Apps using the Microsoft Game Core version of the Multiplayer library will need to wait for the Game Core Networking stack to be initialized prior to calling this method. Determining the status of the network stack can be done using the Game Core XNetworkingGetConnectivityHint API.

The provided playFabTitleId must be the same PlayFab Title ID used to acquire the PlayFab Entity Keys and Entity Tokens that will be passed to PFMultiplayerSetEntityToken().

Requirements

Header: PFMultiplayer.h

See also

PFMultiplayer members
PFMultiplayerSetEntityToken
PFMultiplayerUninitialize
PFMultiplayerSetMemoryCallbacks
PFMultiplayerSetThreadAffinityMask