XblMultiplayerManagerJoinGame
Joins a game session, using the globally unique session name.
Syntax
HRESULT XblMultiplayerManagerJoinGame(
const char* sessionName,
const char* sessionTemplateName,
const uint64_t* xuids,
size_t xuidsCount
)
Parameters
sessionName _In_z_
Type: char*
The globally unique session name for the game session.
sessionTemplateName _In_z_
Type: char*
The name of the session template for the game session to be based on.
xuids _In_opt_
Type: uint64_t*
An array of Xbox User IDs (XUIDs) that represents the users you want to be part of the game.
xuidsCount _In_
Type: size_t
The number of elements in the array specified for xuids
.
Return value
Type: HRESULT
HRESULT return code for this API operation.
Remarks
This function joins a list of Xbox users, specified in xuids
, to the game session identified by the globally unique session name specified in sessionName.
You can get the globally unique session name from the results of the title's third-party matchmaking, and you should call this function for all clients that need to join the game.
The result of this function is delivered as a multiplayer event with an event type set to XblMultiplayerEventType::JoinGameCompleted
. You can call XblMultiplayerManagerDoWork to retrieve multiplayer events.
When attempting to join a game session, the service returns HTTP_E_STATUS_BAD_REQUEST
if the server is full.
After joining, you can set the properties for the game session by calling XblMultiplayerManagerGameSessionSetProperties or XblMultiplayerManagerGameSessionSetSynchronizedProperties, or you can set the host for the game session by calling XblMultiplayerManagerGameSessionSetSynchronizedHost.
Requirements
Header: multiplayer_manager_c.h
Library: Microsoft.Xbox.Services.14x.GDK.C.lib