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.
Add a local user as a member to the lobby.
Syntax
HRESULT PFLobbyAddMember(
PFLobbyHandle lobby,
const PFEntityKey* localUser,
uint32_t memberPropertyCount,
const char* const* memberPropertyKeys,
const char* const* memberPropertyValues,
void* asyncContext
)
Parameters
lobby PFLobbyHandle
The handle of the lobby.
localUser const PFEntityKey*
The PlayFab Entity Key of the local user to add to the lobby as a member.
memberPropertyCount uint32_t
input in range 0,PFLobbyMaxMemberPropertyCount
The number of initial member properties to set for this user when they join the lobby.
memberPropertyKeys const char* const*
input array of size memberPropertyCount
The keys of the initial member properties to set for this user when they join the lobby.
memberPropertyValues const char* const*
input array of size memberPropertyCount
The values of the initial member properties to set for this user when they join 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.
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 PFLobbyAddMemberCompletedStateChange with the PFLobbyAddMemberCompletedStateChange::result field set to S_OK. Upon a failed completion, the title will be provided a PFLobbyAddMemberCompletedStateChange with the PFLobbyAddMemberCompletedStateChange::result field set to a failure HRESULT.
This method is used to add another local PlayFab entity to a pre-existing lobby object. Because the lobby object must have already been created either via a call to PFMultiplayerCreateAndJoinLobby or PFMultiplayerJoinLobby, this method is primarily useful for multiple local user scenarios.
This is an asynchronous operation. The member added via this method will not be reflected in the lists returned by PFLobbyGetMembers until the asynchronous operation successfully completes and a PFLobbyMemberAddedStateChange struct is provided by PFMultiplayerStartProcessingLobbyStateChanges.
Before you call this function, call PFMultiplayerSetEntityToken for localUser. 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 localUser is null or empty, and with E_POINTER if localUser is null. For all error codes, see PlayFab Multiplayer C++ SDK error codes.
Requirements
Header: PFLobby.h