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

stingray.Score namespace reference

Description

The interface to access score functionality on PlayStation 4.

As the object is a singleton (there is only one Score), you do not need to pass any Score object to the functions. All the functions operate on the Score singleton.

Asynchronous operations return an ID that you can pass in calls to status() in order 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.

Functions

Parameters

id :

integer

The ID of the ranking operation.

Returns
This function does not return any values.

You must call free() on all ids that you get back, no matter whether the operation completed successfully or not. Otherwise, the score system will eventually run out of memory.

Parameters

user_id :

integer

The ID of the player.

board :

integer

The ID of the board.

np_ids :

string[]

A table that contains the NP IDs of the users to retrieve.

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.
Returns

integer

An ID for the operation, which you can pass to stingray.Score.status() to track the progress of the operation.

Parameters

user_id :

integer

The ID of the player.

board :

integer

The ID of the board.

start :

integer

The ranking of the first score entry that must be fetched. The top ranking has the value 1. If you pass 0, an error occurs.

size :

integer

The number of entries that must be fetched. Must be less than or equal to 100.

Returns

integer

An ID for the operation, which you can pass to stingray.Score.status() to track the progress of the operation.

When the operation is complete, you can get the result by calling stingray.Score.ranking_result(). The results will be available and consume memory until you call stingray.Score.free().

Parameters

id :

integer

The ID of the ranking operation.

Returns

ps4_score_ranking_results

A table that contains the fetched rankings.

You can call this function only after the operation has completed, and before you have called stingray.Score.free() on the operation.

Parameters

user_id :

integer

The ID of the player.

board :

integer

The ID of the board.

score :

number

The score to record.

Returns

integer

An ID for the operation, which you can pass to stingray.Score.status() to track the progress of the operation.

Parameters

id :

integer

The ID of the ranking operation.

Returns

integer

The status of the operation with the specified ID. May be any of the status code constants.

Status codes

May be returned by calls to status().

COMPLETED : integer

The operation has successfully completed.

ERROR : integer

An error occurred during the operation.

STARTED : integer

The operation has started, but not yet finished.

UNKNOWN : integer

Either the ID was never created, or it has already been freed.