xboxlive_matchmaking_create

This function will create a multi-player session using the Session Template, matchmaking hopper and Secure Device Association template, which you should have created beforehand in the XDP dashboard. The user ID you can retrieve for a particular game pad by calling the xboxlive_user_for_pad() function and visibility will be one of the following constants:

Xbox Match Visibility Constant
ConstantDescription
xboxlive_match_visibility_openspecifies that the session can be joined by the others.
xboxlive_match_visibility_privatespecifies that the session is not visible to users who are not session members.
xboxlive_match_visibility_usetemplatespecifies that the value used in the session template should be used (this should normally be used as you can't override a template's value if one has been set in XDP).

The function returns a unique Request ID value, which can then be used to identify the correct Social Asynchronous Event for this function. This event will be triggered when the session has been created and will contain a DS Map in the variable async_load with the following key/value pairs:

 

Syntax:

xboxlive_matchmaking_create(user_id, visibility, template, hopper, sdatemplate, [matchattributes]);

ArgumentTypeDescription
user_idXbox User IDThe user ID pointer to use
visibilityXbox Match Visibility ConstantOne of the constants listed above
templateStringThe name of the session template
hopperStringThe name of the matchmaking hopper
sdatemplateStringThe name of the secure device association template
matchattributesRealOPTIONAL The match attributes

 

Returns:

Async Request ID

 

Example:

var userID = xboxlive_user_for_pad(global.PadIndex);
result = xboxlive_matchmaking_create(userID, xboxlive_match_visibility_usetemplate, "MatchTicketSession", "MatchTicketHopper", "PeerServerTraffic");

The above will retrieve the user ID for the user on the given gamepad and then initialise a matchmaking session for them.