Skip to content

LocalPlayer

Francisco Dias edited this page Apr 9, 2024 · 3 revisions

LocalPlayer

Functions

This module offers a collection of functions designed to address specific tasks and provide utilities for various purposes. Explore the available functions to make the most of the functionalities provided by this module.



Back To Top

GameCenter_LocalPlayer_Authenticate

This function requests the API for user authentication with GameCenter credentials. When using the Apple GameCenter extension you need to call this function before using any other functions. The function will not return any value but it will create a request that will trigger a Social Async Event callback upon completion.

This function operates asynchronously, which means that it does not immediately return the requested result. Instead, upon completion of the task, it will trigger the Social Async Event.


Syntax:

GameCenter_LocalPlayer_Authenticate()

Returns:

N/A


Triggers:

Social Async Event

Key Type Description
type String "GameCenter_Authenticate"
success Boolean Whether or not the task succeeded.

Example:

GameCenter_LocalPlayer_Authenticate();



Back To Top

GameCenter_LocalPlayer_IsAuthenticated

This function checks if the currently logged in user is authenticated or not.


Syntax:

GameCenter_LocalPlayer_IsAuthenticated()

Returns:

Boolean


Example:

var _auth = GameCenter_LocalPlayer_IsAuthenticated();



Back To Top

GameCenter_LocalPlayer_IsUnderage

This function checks if the currently logged in user is underage or not.


Syntax:

GameCenter_LocalPlayer_IsUnderage()

Returns:

Boolean


Example:

var _underage = GameCenter_LocalPlayer_IsUnderage();



Back To Top

GameCenter_LocalPlayer_GetInfo

This function queries the Apple GameCenter server for information on the current player. The function will return a JSON formatted string that can be parsed into a struct using json_parse.


Syntax:

GameCenter_LocalPlayer_GetInfo()

Returns:

String


Example:

var _json = GameCenter_LocalPlayer_GetInfo();
var _player_info = json_parse(_json);



Back To Top

GameCenter_LocalPlayer_IsMultiplayerGamingRestricted

This function returns whether multiplayer gaming is restricted or not.


Syntax:

GameCenter_LocalPlayer_IsMultiplayerGamingRestricted()

Returns:

Boolean


Example:

var _multiplayer_restricted = GameCenter_LocalPlayer_IsMultiplayerGamingRestricted();



Back To Top

GameCenter_LocalPlayer_IsPersonalizedCommunicationRestricted

A value that indicates whether the player can use personalized communication on the device.

See: personalizedCommunicationRestricted


Syntax:

GameCenter_LocalPlayer_IsPersonalizedCommunicationRestricted()

Returns:

Boolean


Example:

GameCenter_LocalPlayer_IsPersonalizedCommunicationRestricted();