The interface to access the title user storage (TUS) functionality on PlayStation 4.
As the object is a singleton (there is only one Tus), you do not need to pass any Tus object to the functions. All the functions operate on the Tus singleton.
Asynchronous operations return an ID that you can pass in calls to status() to fetch progress during the operation. You must free the memory that is used for this object by calling free() when the operation is done. Otherwise, the game will eventually run out of memory.
Other related reference items
delete ( target, options ) : integerDeletes the listed slots for the target.
|
target : | any | The target whose slots you want to delete. |
options : | integer[] | The slots to delete. 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. |
integer |
An ID for the operation, which you can pass to stingray.Tus.status() to track the progress of the operation. |
For example:
stingray.Tus.delete(target, slot_1, slot_2, ...)
delete_data ( target, options ) : integerDeletes the listed data slots for the target.
|
target : | any | The target whose data slots you want to delete. |
options : | integer[] | The slots to delete. 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. |
integer |
An ID for the operation, which you can pass to stingray.Tus.status() to track the progress of the operation. |
For example:
stingray.Tus.delete_data(target, slot_1, slot_2, ...)
free ( id )Frees all data that the system keeps track of for the operation with the specified ID.
|
id : | integer | The ID of the operation whose memory you want to free. |
This function does not return any values. |
You must call free() on all ids that you get back, whether or not the operation completed successfully. Otherwise, the TUS system will eventually run out of memory.
get ( target, options ) : integerGets the values stored in the specified slots for the target.
|
target : | any | The target whose values you want to retrieve. |
options : | integer* | The slots from which to get the stored values. The * notation indicates that there may be zero or more instances of the specified type. |
integer |
Returns an ID for the operation, which you can pass to stingray.Tus.status() to track the progress of the operation. |
When the operation has completed, you can use stingray.Tus.has_get_result() and stingray.Tus.get_result() to get the result of the operation. For example:
stingray.Tus.get(target, slot_1, slot_2, ...)
Other related reference items
get_data ( target, slot ) : integerGets the data stored in the specified slot for the target.
|
target : | any | The target for the operation. |
slot : | integer | The slot whose data you want to retrieve. |
integer |
An ID for the operation, which you can pass to stingray.Tus.status() to track the progress of the operation. |
Other related reference items
get_data_result ( id ) : ps4_tus_slot_dataReturns the result of a stingray.Tus.get_data() operation.
|
id : | integer | The ID of the stingray.Tus.get_data() operation. |
A table that contains the data retrieved for a specified slot. |
Call this only when stingray.Tus.has_get_data_result() returns true.
Other related reference items
get_info ( target, options ) : integerGets information about multiple data slots without fetching the actual data.
|
target : | any | The target for the operation. |
options : | integer[] | The slots for which the information has to be fetched. 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. |
integer |
An ID for the operation, which you can pass to stingray.Tus.status() to track the progress of the operation. |
For example:
stingray.Tus.get_info(target, slot_1, slot_2, ....)
Other related reference items
get_info_result ( id ) : ps4_tus_slot_dataReturns the result of a stingray.Tus.get_info() operation.
|
id : | integer | The ID of the stingray.Tus.get_info() operation. |
A table with an entry for each slot requested in the stingray.Tus.get_info() call. Each entry has the same fields as in the ps4_tus_slot_data table returned by stingray.Tus.get_data_result(), but without the data field. |
Call this only when stingray.Tus.has_get_info_result() returns true.
get_result ( id, format ) : ps4_tus_slot_data[]Returns the result of the stingray.Tus.get() operation with the specified ID.
|
id : | integer | The ID of the stingray.Tus.get() operation. |
format : | integer | If you specify the Tus.DETAILS format, this function returns a list of tables, each of which provides the results for a given slot. |
A list of tables with an entry for each slot. 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. |
Call this only when stingray.Tus.has_get_result() returns true.
get_result ( id, format ) : number*Returns the result of the stingray.Tus.get() operation with the specified ID.
|
id : | integer | The ID of the stingray.Tus.get() operation. |
format : | integer | If you specify the Tus.JUST_VALUES format, this function returns the values of the slots directly on the Lua stack. |
number* |
Returns values of the slots directly on the Lua stack. If a slot does not have a value, nil is returned for that slot. The * notation indicates that there may be zero or more instances of the specified type. |
Call this only when stingray.Tus.has_get_result() returns true.
Other related reference items
has_get_data_result ( id ) : booleanReturns true if there is a usable result for the stingray.Tus.get_data() operation with the specified ID.
|
id : | integer | The ID of the stingray.Tus.get_data() operation. |
boolean |
Returns true if there is a usable result for the stingray.Tus.get_data() operation with the specified ID. |
You can retrieve the result by calling stingray.Tus.get_data_result().
Other related reference items
has_get_info_result ( id ) : booleanReturns true if there is a usable result for a stingray.Tus.get_info() operation.
|
id : | integer | The ID of the stingray.Tus.get_info() operation. |
boolean |
Returns true if there is a usable result for the stingray.Tus.get_info() operation with the specified ID. |
Other related reference items
has_get_result ( id ) : booleanIndicates whether or not there is a usable result for the stingray.Tus.get() operation with the specified ID.
|
id : | integer | The ID of the stingray.Tus.get() operation. |
boolean |
Returns true if there is a usable result for the stingray.Tus.get() operation. |
You can retrieve the result by calling stingray.Tus.get_result().
Other related reference items
set ( target, options ) : integerSets the values to store in the specified slots for the target.
|
target : | string? | The target for which you want to set the values. This can be nil (in which case the first logged in user is used), a SceNpId to set the value for a user, or a SceNpTusVirtualUserId to set the value for a virtual user. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
options : | any(integer, number)* | The slots followed by their values. The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses. The * notation indicates that there may be zero or more instances of the specified type. |
integer |
Returns an ID for the operation, which you can pass to stingray.Tus.status() to track the progress of the operation. |
For example:
stingray.Tus.set(target, slot_1, value_1, slot_2, value_2, ...)
set_data ( target, slot, data, info ) : integerSets the data and info for the specified slot.
|
target : | any | The target for the operation. |
slot : | integer | The slot for setting the data and info. |
data : | string | The data to set. |
info : | string? | Optional. The information to set. The ? notation indicates that this type is optional: there may be zero or one instances of it. |
integer |
An ID for the operation, which you can pass to stingray.Tus.status() to track the progress of the operation. |
status ( id ) : integerReturns the status of the operation with the specified ID.
|
id : | integer | The ID for the operation. |
integer |
The status of the operation with the specified ID. May be any of the status code constants. |
Other related reference items
Pass one of these values in each call to [get_results()] in order to specify the level of detail you want to retrieve about the slots.
DETAILS : integerInstructs [get_results()] to return a list of tables that contain detailed information about each slot.
|
Other related reference items
JUST_VALUES : integerInstructs [get_results()] to return only the current value of each slot.
|
Other related reference items
May be returned by calls to status().
COMPLETED : integerThe operation has successfully completed.
|
ERROR : integerAn error occurred during the operation.
|
STARTED : integerThe operation has started, but not yet finished.
|
UNKNOWN : integerEither the ID was never created, or it has already been freed.
|