uwp_check_privilege OBSOLETE

With this function you can check that a given user has a chosen privilege. The function will return true or false in the System Asynchronous Event depending on whether the privilege is enabled or not, and if you set the attempt_resolution argument to true and the privilege isn't enabled, it will also open a system dialog (suspending the game) to prompt the user to upgrade the account or whatever is required to get the privilege. If the user then enables the required option, the function will return true.

The function requires that you use one of the following UWP Privilege Constants for the privilege request:

UWP Privilege Constant
ConstantDescription
uwp_privilege_internet_browsingCheck to see if internet browsing is permitted
uwp_privilege_social_network_sharingCheck to see if sharing to social networks is permitted
uwp_privilege_share_kinect_contentCheck whether sharing the Kinect controller is permitted
uwp_privilege_video_communicationsCheck to see if video communication is permitted
uwp_privilege_communicationsCheck to see if internet communication is permitted
uwp_privilege_user_created_contentCheck if access to user created content is permitted
uwp_privilege_multiplayer_sessionsCheck to see if online multiplayer sessions are permitted
uwp_privilege_sessionsCheck to see if online sessions are permitted
uwp_privilege_fitness_uploadCheck to see if fitness data uploading is permitted

 

Once the function has been called, on XBox One it will trigger an Asynchronous System event when the callback result has been received, which will have the special DS map async_load. This map should then be parsed for the following key:

If the event type relates to this function, then there will also be the following additional keys when the function is called on XBox:

If the project is run on a UWP platform that is not XBox One, then the Async Event will not be triggered, and instead the function will immediately return wither -1, 0, or 1 where:

 

Syntax:

uwp_check_privilege(user_id, privilege, attempt_resolution);

ArgumentTypeDescription
user_idXbox User IDThe User ID pointer to check.
privilegeUWP Privilege ConstantThe privilege constant to check (see description, above).
attempt_resolutionBooleanEnable attempting a resolution if set to true, or ignore if set to false.

 

Returns:

Real

 

Example:

var user_one = xboxlive_get_user(0);
if (xboxlive_user_is_signed_in(user_one))
{
    uwp_check_privilege(user_one, xboxlive_privilege_multiplayer_sessions, true);
}

The above checks to see if the user is signed in and if they are it checks the multiplayer sessions permission.