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

stingray.NpCheck namespace reference

Description

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.

Functions

Parameters

np_id :

string

The SceNpId of the player.

Returns

integer

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

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.

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

integer

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

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:

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.

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.

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:

id = stingray.NpCheck.notify_plus(stingray.Pad1.user_id(), stingray.NpCheck.ASYNC_MULTIPLAY)
Parameters

id :

integer

The ID of the stingray.NpCheck.check_availability() or stingray.NpCheck.check_plus() operation.

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.

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:

stingray.NpCheck.set_content_restriction( 15, {{country="se", age=18}, {country="de", age=16}, {country="no", age=18}})
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.

Access values

Values that you can pass to stingray.NpCheck.check_plus() in order to check access to Playstation Plus features.

Status codes

May be returned by calls to status().

STARTED : integer

The operation has started, but not yet finished.

UNKNOWN : integer

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