This function will populate a DS map with the details of users in the specified session, or -1 if there is an error. You can get the session ID pointer from the async_load DS map that is returned in the Asynchronous Social Event when you found a session). The returned DS map will have the following key/value pairs:
- "num_results" - contains the number of users in the session
- "userId<index>" - contains the ID of the user (<index> is a value from 0 to "num_results" - 1)
- "userIsOwner<index>" - contains 1 if the user is the host, otherwise 0 (<index> is a value from 0 to "num_results" - 1)
When the map is no longer required it should be removed from memory using the ds_map_destroy() function otherwise you will get a memory leak.
This function is only valid when exporting using the UWP target for the Xbox One and it requires you to have checked the Enable XBox Live option in the UWP Game Options.
Argument Description session_id The Session ID pointer of the session to join.
global.GamerTag = xboxlive_gamertag_for_user();
The above code checks to see if a user is signed-in to XBox Live and if they are signed-in, the code will get the gamertag for the user and store it in a global variable for future use. If they are not signed-in then the code checks to see if they are in the process of signing-in, in which case nothing further will happen, and if they are not, then it will open the account picker, prompting them to sign-in.