xboxlive_matchmaking_session_get_users


Description

This function will create and populate a DS map with the details of the 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 created or found a session (see xboxlive_matchmaking_create() for more details). The returned DS map will have the following key/value pairs:

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.


Syntax:

xboxlive_matchmaking_session_get_users(session_id);

Argument Description
session_id The session ID pointer to use


Returns:

Request ID (integer)


Example:

var session_map = xboxlive_matchmaking_session_get_users(global.SessionID);
if (session_map != -1)
    {
    for (var i = 0; i < session_map[? "num_results"]; i++)
        {
        if session_map[? "userIsOwner" + string(i)] == 1
            {
            global.OwnerID = session_map[? "userId" + string(i)];
            }
        }
    }

The above will retrieve the user data for all users participating in the matchmaking session and set a global variable to the ID of the session owner.