PFLobbyGetMemberConnectionStatus

Determines a member's connection status to the notification service.

Syntax

HRESULT PFLobbyGetMemberConnectionStatus(  
    PFLobbyHandle lobby,  
    const PFEntityKey* member,  
    PFLobbyMemberConnectionStatus* connectionStatus  
)  

Parameters

lobby   PFLobbyHandle

The handle of the lobby.

member   PFEntityKey*

The member whose connection status will be inspected.

connectionStatus   PFLobbyMemberConnectionStatus*
output

The output connection status of the member.

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

When joining a lobby, the library establishes a WebSocket connection to the PlayFab PubSub notification service. This connection is used to provide real-time updates to the library about the lobby. This method can be used to determine a member's connection status, which is useful for diagnosing a member's ability to receive updates about the lobby.

A local member which is still in the process of asynchronously joining the lobby, via a call to any of PFMultiplayerCreateAndJoinLobby(), PFMultiplayerJoinLobby(), or PFLobbyAddMember, will see their connection status as PFLobbyMemberConnectionStatus::NotConnected until the connection is established.

When a user's connection status changes, a PFLobbyMemberUpdateSummary will be provided to the title with the PFLobbyMemberUpdateSummary::member field set to the user's entity key and the PFLobbyMemberUpdateSummary::connectionStatusUpdated field set to true. The PFLobbyMemberUpdateSummary will be provided to the title as a memberUpdates entry on a PFLobbyUpdatedStateChange struct via PFMultiplayerStartProcessingLobbyStateChanges().

When a user's connection status changes from PFLobbyMemberConnectionStatus::Connected to PFLobbyMemberConnectionStatus::NotConnected, they may be experiencing connectivity issues - or their game may have crashed. The lobby owner can remove such users from the lobby via PFLobbyForceRemoveMember().

Requirements

Header: PFLobby.h

See also

PFLobby members