MultiplayerSession - stingray.MultiplayerSession namespace reference - Stingray Lua API Reference

stingray.MultiplayerSession namespace reference

Description

The interface to access session functionality on Xbox One.

Functions

Parameters

session_id :

integer

Id of the session.

custom_property_key :

string

The json property to retrieve

Returns

integer

Session lookup id, used to reference this session job in the lua interfaces.

Parameters

session_lookup_id :

integer

Id of the session lookup to get status for. returned by [stingray.MultiplayerSession.custom_properties_json()]

Returns

string

Returns the json string of the property or null.

Parameters

session_lookup_id :

integer

Id of the session lookup to get status for.

Returns

integer

Returns the status of the session lookup started with [stingray.MultiplayerSession.custom_properties_json()]. May be any of the SessionJobStatus(network.xbl.work_status) constants.

Parameters

session_id :

integer

Id of the session.

hopper_name :

string

Name of the hopper to delete.

ticket_id :

string

Ticket ID returned by start_smartmatch_result.

Returns
This function does not return any values.
Parameters

session_lookup_id :

integer

Id of the session lookup to be freed.

Returns
This function does not return any values.

Note that the result can only be freed when [stingray.MultiplayerSession.free_custom_property_json_status()] returns stingray.SessionJobStatus.COMPLETE or stingray.SessionJobStatus.FAILED.

Parameters

session_id :

integer

Id of the session to get session group id for.

Returns

integer

SessionGroupId of the session group the supplied session belongs to.

Parameters

session_id :

integer

Id of the session to set keywords for.

Returns

boolean

True if the session have changed.

Note that this change might not be visible.

Parameters

session_id :

integer

Id of the session to get host for.

Returns

string?

PeerId of the host. If there is no host nil will be returned.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Parameters

session_id :

integer

Id of the session to get keywords for.

Returns

string[]

List of session keywords

The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown.
Parameters

session_id :

integer

Id of the session to leave.

Returns
This function does not return any values.

When stingray.MultiplayerSession.status() returns stingray.MultiplayerSession.SHUTDOWN it is safe to free the session with stingray.Network.free_multiplayer_session().

Parameters

session_id :

integer

Id of the session from where to get member list.

Returns

session_member[]

List of members in the session

The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown.
Parameters

session_id :

string

Session id to retrieve the uri from

Returns

string

Session uri

Parameters

session_uri :

string

Session uri

Returns

string

Session name

string

Session template name

Parameters

session_id :

integer

Id of the session.

closed :

boolean

New closed state

Returns
This function does not return any values.
Parameters

session_id :

integer

Id of the session.

custom_property_key :

string

The json property to set

custom_property_json :

string

A string with the json value of the key

Returns
This function does not return any values.
Parameters

session_id :

integer

Id of the session.

custom_property_key :

string

The json property to set

custom_property_json :

string

A string with the json value of the key

Returns
This function does not return any values.
Parameters

user_id :

integer

Id of the user to set keywords for.

session_id :

integer

Id of the session to set keywords for.

session_keywords :

string[]?

Optional table of string representing keywords for the session. Strings must not be empty and at most made of 63 characters.

The [] notation indicates that this type is an array: a table in which the keys of the members are sequential integers, and the value of each element is an instance of the type shown.
The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns
This function does not return any values.

You can track the status of the session with stingray.MultiplayerSession.status(). If session_keywords isn't supplied then the keywords will be set to an empty array.

Parameters

session_id :

integer

Id of the session.

Returns

string

Name of the matched session.

string

Session template name of the matched session.

number

Typical wait time returned by SmartMatch.

Parameters

session_id :

integer

Id of the session.

Returns

integer

Status of the SmartMatch matchmaking. Will be one of the stingray.SmartMatchStatus constants.

Parameters

session_id :

integer

Id of the session.

hopper_name :

string

Name of the hopper to use for SmartMatch.

timeout :

number

SmartMatch timeout.

preserve_mode :

integer

Preserve mode for SmartMatch. Must be one of the stingray.PreserveSessionMode constants.

ticket_attributes_json :

string?

Optional json string with SmartMatch ticket attributes.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns
This function does not return any values.

When the job is completed you can get the result from starting the ticket with start_smartmatch_result.

You can track the matchmaking status on the session with smartmatch_status.

Use delete_smartmatch_ticket to cancel the matchmaking or to delete the ticket when finished.

Parameters

session_id :

integer

Id of the session.

Returns

string

Ticket ID of the SmartMatch matchmaking ticket.

number

Estimated waiting time returned by SmartMatch.

SessionStatus

Describes the current status of the session.

May be returned by calls to stingray.MultiplayerSession.status().

BROKEN : integer

An error occurred during an asynchronous job.

WORKING : integer

The session is waiting for an asynchronous job to be completed.