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

stingray.XboxLive namespace reference

Description

The interface to access users and other miscellaneous functionality Xbox Live on Xbox One.

User Cache

Since there is a large performance cost associated with getting information on local users from the system, information on users is saved by the engine in an internal user cache.

The user cache is updated from events supplied by the system. You can check if the user cache has been updated with stingray.XboxLive.user_cache_changed().

You can fetch a list of all local users with stingray.XboxLive.users() or information on a single user with stingray.XboxLive.user_info().

The id member of the user_cached_info is a unique identifier local to the console, it is commonly referred to as user_id in the lua interface.

Functions

Parameters
This function does not accept any parameters.
Returns

boolean

Returns true if the user have accepted a game invite since last time this function was called.

This will be true on startup if the user launched the game by accepting an invite.

Parameters
This function does not accept any parameters.
Returns

map(string, string)?

If a game invite is accepted, this will return the key-value pairs for the invite, otherwise nil will be returned.

The map(...) notation indicates a table in which each key is an instance of the first type shown, and each value is an instance of the second type shown.
The ? notation indicates that this type is optional: there may be zero or one instances of it.

Details on the result from this function can be found under "How to: Join an MPSD Session from a Title Activation" in the XDK documentation.

If you are using stingray.MultiplayerSession.invite_friends() this map will have entries with keys matching the list for an accepted invite in the XDK documentaion.

You can use stingray.Network.handle_to_description() to get the name and session template name for the session matching the returned session handle.

Parameters
This function does not accept any parameters.
Returns

integer

Returns the number of users currently in the user cache.

Parameters
This function does not accept any parameters.
Returns

integer

Returns the current online state of the console. May be any of the OnlineState constants.

Parameters

user_index :

integer

The user index of the user the account picker should be shown for. Use 1 for the user using Pad1, 2 for Pad2, etc.

Returns
This function does not return any values.

You can use this when user_id() for the user's Pad returns nil, indicating that there is no signed in account for the user.

Parameters
This function does not accept any parameters.
Returns

user_cached_info*

All users in user cache, if there are no users nil will be returned.

The * notation indicates that there may be zero or more instances of the specified type.

Use stingray.XboxLive.user_cache_changed() to check if the user cache has changed.

Parameters
This function does not accept any parameters.
Returns

boolean

Returns true if the user cache has changed since last time this function was called.

Parameters

user_id :

integer

Id of the user whose info is to be fetched from the user cache.

Returns

user_cached_info

Information about the user