NpCheck - stingray.NpCheck namespace reference - Stingray Lua API Reference
The interface to access the check plus and check availability functionality on PlayStation 4.
As the object is a singleton (there is only one NpCheck), you do not need to pass any NpCheck
object to the functions. All the functions operate on the NpCheck 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.
|
Checks whether or not the user has access to network features.
|
Parameters np_id : | string | The SceNpId of the player. |
Returns
For example:
You can use stingray.NpCheck.result() to fetch the result after completion. When the operation has completed, you must call
stingray.NpCheck.free() to free the memory used by the operation.
|
Checks whether or not the player has access to the specified Playstation Plus features.
|
Parameters user_id : | integer | The ID of the player. |
features : | integer+ | One or more of the features to check. The + notation indicates that there may be one or more instances of the specified type. |
Returns
You can use stingray.NpCheck.result()
to fetch the result after completion. When the operation has completed, you must call stingray.NpCheck.free() to free the memory
used by the operation.
For example:
|
Returns the last error code encountered by the operation, if any.
|
Parameters id : | integer | The ID of the operation. |
Returns integer? |
Returns the last error code, or nil if no error was encountered.
The ? notation indicates that this type is optional: there may be zero or one instances of it. |
Call this only if stingray.NpCheck.status() returns
NpCheck.ERROR or NpCheck.COMPLETED.
|
Frees all data that the NpCheck system keeps track of for the operation with the specified ID.
|
Parameters id : | integer | The ID of the operation. |
Returns | 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 system will eventually run out of memory.
|
Use this function to send a notification to the system each time a PlayStation Plus feature is used.
|
Parameters user_id : | integer | The ID of the player. |
features : | integer+ | The features to notify. The + notation indicates that there may be one or more instances of the specified type. |
Returns | This function does not return any values. |
You can specify the same features as in stingray.NpCheck.check_plus().
For example:
|
Indicates whether or not the user has access to the specified features.
|
Parameters Returns boolean |
Returns true if the user has access to the specified features, or false otherwise.
|
Call this only after
stingray.NpCheck.status() returns NpCheck.COMPLETED for the operation.
|
Sets the content age restriction.
|
Parameters default_age_restriction : | integer | Sets the default age for restriction. |
t : | ps4_npcheck_country_age_restriction[] | Optional. Allows you to set up different age restrictions for different countries. 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 | This function does not return any values. |
For example:
|
Returns the status of the operation with the specified ID.
|
Parameters id : | integer | The ID of the operation. |
Returns integer |
The status of the operation. May be any of the status code constants.
|
Note: If the result is NpCheck.ERROR, the stingray.NpCheck.error_code() function returns the related error code.
Values that you can pass to stingray.NpCheck.check_plus() in order to check access to Playstation Plus features.
|
To check access to the real-time multiplayer feature.
|
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.
|