Score - stingray.Score namespace reference - Stingray Lua API Reference
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.
|
Frees all data that the score system keeps track of for the operation with the specified ID.
|
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.
|
|
Requests a sequence of rankings from the server.
|
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().
|
Returns the result of a ranking operation.
|
Parameters id : | integer | The ID of the ranking operation. |
Returns
You can call this function only after the
operation has completed, and before you have called stingray.Score.free() on the operation.
|
record ( user_id, board, score ) : integer
Records the score for the specified user on the board.
|
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.
|
|
Returns the status of the operation with the specified id.
|
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.
|
May be returned by calls to status().
|
The operation has successfully completed.
|
|
An error occurred during the operation.
|
|
The operation has started, but not yet finished.
|
|
Either the ID was never created, or it has already been freed.
|