Murl Engine Lua Addon API  Version 1.0 beta
Murl.IGameCenterControl

The IGameCenterControl interface.

The game center is currently supported on iOS/OSX/tvOS only.


Table members

Inherited


Murl.IControlable

Enumerations


AuthenticationStatus

Enumeration of the authentication status. Use GetAuthenticationStatus() to get the current status.

Murl.IGameCenterControl.STATUS_AUTHENTICATION_IDLEThe authentication is idle.
Murl.IGameCenterControl.STATUS_AUTHENTICATINGThe authentication is in progress.
Murl.IGameCenterControl.STATUS_AUTHENTICATEDThe authentication is succesful.
Murl.IGameCenterControl.STATUS_AUTHENTICATION_FAILEDThe authentication failed.
Murl.IGameCenterControl.STATUS_AUTHENTICATION_IMPOSSIBLEThe authentication is not possible.

LoadFriendsStatus

Enumeration of the load friends status. Use GetLoadFriendsStatus() to get the current status.

Murl.IGameCenterControl.STATUS_LOAD_FRIENDS_IDLELoading friends is idle.
Murl.IGameCenterControl.STATUS_LOAD_FRIENDS_LOADINGLoading friends is in progress.

LeaderboardStatus

Enumeration of the leaderboard status. Use GetLeaderboardStatus() to get the current status.

Murl.IGameCenterControl.STATUS_LEADERBOARD_IDLEThe leaderboard is idle.
Murl.IGameCenterControl.STATUS_LEADERBOARD_SHOWINGThe leaderboard overlay is showing.
Murl.IGameCenterControl.STATUS_LEADERBOARD_REPORTINGReporting a leaderboard score is in progress.
Murl.IGameCenterControl.STATUS_LEADERBOARD_LOADINGLoading leaderboard scores is in progress.

AchievementStatus

Enumeration of the achievement status. Use GetAchievementStatus() to get the current status.

Murl.IGameCenterControl.STATUS_ACHIEVEMENT_IDLEThe achievement is idle.
Murl.IGameCenterControl.STATUS_ACHIEVEMENT_SHOWINGThe achievements overlay is showing.
Murl.IGameCenterControl.STATUS_ACHIEVEMENT_REPORTINGReporting achievements is in progress.
Murl.IGameCenterControl.STATUS_ACHIEVEMENT_RESETTINGResetting all achievements is in progress.
Murl.IGameCenterControl.STATUS_ACHIEVEMENT_LOADINGLoading achievements is in progress.

Error

Enumeration of error status. Use GetError() to get the current status.

Murl.IGameCenterControl.ERROR_NONENo error.
Murl.IGameCenterControl.ERROR_UNKNOWNUnknown error.
Murl.IGameCenterControl.ERROR_CANCELLEDAction is cancelled.
Murl.IGameCenterControl.ERROR_COMMUNICATIONS_FAILURECommunication failed.
Murl.IGameCenterControl.ERROR_USER_DENIEDUser was denied.
Murl.IGameCenterControl.ERROR_INVALID_CREDENTIALSInvalid credentials.
Murl.IGameCenterControl.ERROR_NOT_AUTHENTICATEDNot authenticated.
Murl.IGameCenterControl.ERROR_AUTHENTICATION_IN_PROGRESSAuthentication is in progress.
Murl.IGameCenterControl.ERROR_INVALID_PLAYERPlayer identifier is invalid.
Murl.IGameCenterControl.ERROR_SCORE_NOT_SETScore was not set.
Murl.IGameCenterControl.ERROR_PARENTAL_CONTROLS_BLOCKEDParental control block.
Murl.IGameCenterControl.ERROR_PLAYER_STATUS_EXCEEDS_MAXIMUM_LENGTHPlayer status exceeds maximum length.
Murl.IGameCenterControl.ERROR_PLAYER_STATUS_INVALIDPlayer status is invalid.
Murl.IGameCenterControl.ERROR_MATCH_REQUEST_INVALIDMatch request is invalid.
Murl.IGameCenterControl.ERROR_UNDERAGEPlayer is underage.
Murl.IGameCenterControl.ERROR_GAME_UNRECOGNIZEDGame is not recognized.
Murl.IGameCenterControl.ERROR_NOT_SUPPORTEDNot supported.
Murl.IGameCenterControl.ERROR_INVALID_PARAMETERInvalid parameter.


Functions



Methods


GetAuthenticationStatus()

Get the game-center authentication status. Authentication operation works asynchronously, the application can check the current status to operate correctly.

Murl.IGameCenterControl.AuthenticationStatus GetAuthenticationStatus()

Returns
Murl.IGameCenterControl.AuthenticationStatus The game-center authentication status.

AuthenticateLocalPlayer()

Start authenticating the local user to the game-center. When starting the authentication, the authentication status changes to IGameCenterControl::STATUS_AUTHENTICATING immediately. When the authentication is finished the authentication status changes to IGameCenterControl::STATUS_AUTHENTICATED.

Boolean AuthenticateLocalPlayer()

Returns
Boolean true if successful.

GetLocalPlayer()

Get the game-center local user. The local user is available when AuthenticateLocalPlayer() is finished.

Murl.IGameCenterPlayer GetLocalPlayer()

Returns
Murl.IGameCenterPlayer The game-center local user.

IsLocalPlayerUnderage()

Check if the game-center local user is underage. The local user underage is available when AuthenticateLocalPlayer() is finished.

Boolean IsLocalPlayerUnderage()

Returns
Boolean true if the game-center local user is underage.

IsAuthenticationIdle()

Check if the game-center authentication status is IGameCenterControl::STATUS_AUTHENTICATION_IDLE.

Boolean IsAuthenticationIdle()

Returns
Boolean true if the status is IGameCenterControl::STATUS_AUTHENTICATION_IDLE.

IsAuthenticating()

Check if the game-center authentication status is IGameCenterControl::STATUS_AUTHENTICATING.

Boolean IsAuthenticating()

Returns
Boolean true if the status is IGameCenterControl::STATUS_AUTHENTICATING.

IsAuthenticated()

Check if the game-center authentication status is IGameCenterControl::STATUS_AUTHENTICATED.

Boolean IsAuthenticated()

Returns
Boolean true if the status is IGameCenterControl::STATUS_AUTHENTICATED.

IsAuthenticationFailed()

Check if the game-center authentication status is IGameCenterControl::STATUS_AUTHENTICATION_FAILED.

Boolean IsAuthenticationFailed()

Returns
Boolean true if the status is IGameCenterControl::STATUS_AUTHENTICATION_FAILED.

IsAuthenticationImpossible()

Check if the game-center authentication status is IGameCenterControl::STATUS_AUTHENTICATION_IMPOSSIBLE.

Boolean IsAuthenticationImpossible()

Returns
Boolean true if the status is IGameCenterControl::STATUS_AUTHENTICATION_IMPOSSIBLE.

GetLoadFriendsStatus()

Get the game-center load friends status. Load friends operation works asynchronously, the application can check the current status to operate correctly.

Murl.IGameCenterControl.LoadFriendsStatus GetLoadFriendsStatus()

Returns
Murl.IGameCenterControl.LoadFriendsStatus The game-center load friends status.

LoadFriends()

Load all game-center friends player entries. When start loading, the load friends status changes to IGameCenterControl::STATUS_LOAD_FRIENDS_LOADING immediately. When the friends loading is finished the friends status changes to IGameCenterControl::STATUS_LOAD_FRIENDS_IDLE. The friends player entries can be accessed by GetFriends().

Boolean LoadFriends()

Returns
Boolean true if successful.

LoadFriends(friendIds)

Load specified game-center friends player entries. When start loading, the load friends status changes to IGameCenterControl::STATUS_LOAD_FRIENDS_LOADING immediately. When the friends loading is finished the friends status changes to IGameCenterControl::STATUS_LOAD_FRIENDS_IDLE. The friends player entries can be accessed by GetFriends().

Boolean LoadFriends(Murl.Array.String friendIds)

Parameters
friendIdsA string array containing the player identifiers to load.
Returns
Boolean true if successful.

GetFriends()

Get an array of friends player entries. The friends player entries are available when LoadFriends() is finished.

Murl.Array.IGameCenterPlayerConst GetFriends()

Returns
Murl.Array.IGameCenterPlayerConst The array of friends player entries.

IsLoadFriendsIdle()

Check if the game-center load load friends status is IGameCenterControl::STATUS_LOAD_FRIENDS_IDLE.

Boolean IsLoadFriendsIdle()

Returns
Boolean true if the status is IGameCenterControl::STATUS_LOAD_FRIENDS_IDLE.

IsLoadFriendsLoading()

Check if the game-center load load friends status is IGameCenterControl::STATUS_LOAD_FRIENDS_LOADING.

Boolean IsLoadFriendsLoading()

Returns
Boolean true if the status is IGameCenterControl::STATUS_LOAD_FRIENDS_LOADING.

GetLeaderboardStatus()

Get the game-center leaderboard status. Leaderboard operation works asynchronously, the application can check the current status to operate correctly.

Murl.IGameCenterControl.LeaderboardStatus GetLeaderboardStatus()

Returns
Murl.IGameCenterControl.LeaderboardStatus The game-center leaderboard status.

ShowLeaderboard(category)

Show the game-center leaderboard overlay. When showing the leaderboard overlay, the leaderboard status changes to IGameCenterControl::STATUS_LEADERBOARD_SHOWING immediately. When the leaderboard overlay is closed the leaderboard status changes to IGameCenterControl::STATUS_LEADERBOARD_IDLE.

Boolean ShowLeaderboard(String category)

Parameters
categoryThe name of the leaderboard category to show or an empty string to show the default leaderboard.
Returns
Boolean true if successful.

ReportLeaderboard(category, score)

Report a score to the game-center leaderboard. When start reporting, the leaderboard status changes to IGameCenterControl::STATUS_LEADERBOARD_REPORTING immediately. When the leaderboard reporting is finished the leaderboard status changes to IGameCenterControl::STATUS_LEADERBOARD_IDLE.

Boolean ReportLeaderboard(String category, Integer score)

Parameters
categoryThe name of the leaderboard category.
scoreThe score to report.
Returns
Boolean true if successful.

LoadLeaderboard(category, startRank, numberOfRanks)

Load the game-center leaderboard entries. When start loading, the leaderboard status changes to IGameCenterControl::STATUS_LEADERBOARD_LOADING immediately. When the leaderboard loading is finished the leaderboard status changes to IGameCenterControl::STATUS_LEADERBOARD_IDLE. The leaderboard entries can be accessed by GetLeaderboard() and GetLeaderboardCategory().

Boolean LoadLeaderboard(String category, Integer startRank, Integer numberOfRanks)

Parameters
categoryThe name of the leaderboard category.
startRankThe first rank to load.
numberOfRanksThe number of ranks to load.
Returns
Boolean true if successful.

GetLeaderboard()

Get an array of leaderboard entries. The leaderboard entries are available when LoadLeaderboard() is finished.

Murl.Array.IGameCenterLeaderboardEntryConst GetLeaderboard()

Returns
Murl.Array.IGameCenterLeaderboardEntryConst The array of leaderboard entries.

IsLeaderboardIdle()

Check if the game-center leaderboard status is IGameCenterControl::STATUS_LEADERBOARD_IDLE.

Boolean IsLeaderboardIdle()

Returns
Boolean true if the status is IGameCenterControl::STATUS_LEADERBOARD_IDLE.

IsLeaderboardShowing()

Check if the game-center leaderboard status is IGameCenterControl::STATUS_LEADERBOARD_SHOWING.

Boolean IsLeaderboardShowing()

Returns
Boolean true if the status is IGameCenterControl::STATUS_LEADERBOARD_SHOWING.

IsLeaderboardReporting()

Check if the game-center leaderboard status is IGameCenterControl::STATUS_LEADERBOARD_REPORTING.

Boolean IsLeaderboardReporting()

Returns
Boolean true if the status is IGameCenterControl::STATUS_LEADERBOARD_REPORTING.

IsLeaderboardLoading()

Check if the game-center leaderboard status is IGameCenterControl::STATUS_LEADERBOARD_LOADING.

Boolean IsLeaderboardLoading()

Returns
Boolean true if the status is IGameCenterControl::STATUS_LEADERBOARD_LOADING.

GetAchievementStatus()

Get the game-center achievement status. Achievement operation works asynchronously, the application can check the current status to operate correctly.

Murl.IGameCenterControl.AchievementStatus GetAchievementStatus()

Returns
Murl.IGameCenterControl.AchievementStatus The game-center achievement status.

ShowAchievements()

Show the game-center achievements overlay. When showing the achievements overlay, the achievement status changes to IGameCenterControl::STATUS_ACHIEVEMENT_SHOWING immediately. When the achievements overlay is closed the achievement status changes to IGameCenterControl::STATUS_ACHIEVEMENT_IDLE.

Boolean ShowAchievements()

Returns
Boolean true if successful.

ReportAchievement(identifier, percentComplete, showsCompletionBanner)

Report a game-center achievement. When start reporting, the achievement status changes to IGameCenterControl::STATUS_ACHIEVEMENT_REPORTING immediately. When the achievement reporting is finished the achievement status changes to IGameCenterControl::STATUS_ACHIEVEMENT_IDLE.

Boolean ReportAchievement(String identifier, Number percentComplete, Boolean showsCompletionBanner)

Parameters
identifierThe achievement identifier.
percentCompleteThe percentage of achievement complete, report 0 to unhide achievement.
showsCompletionBannerIf true, a banner will be momentarily displayed after reporting a completed achievement.
Returns
Boolean true if successful.

ResetAchievements()

Reset all game-center achievements. When start resetting, the achievement status changes to IGameCenterControl::STATUS_ACHIEVEMENT_RESETTING immediately. When the achievement resetting is finished the achievement status changes to IGameCenterControl::STATUS_ACHIEVEMENT_IDLE.

Boolean ResetAchievements()

Returns
Boolean true if successful.

LoadAchievements()

Load the game-center achievement entries. When start loading, the achievement status changes to IGameCenterControl::STATUS_ACHIEVEMENT_LOADING immediately. When the achievement loading is finished the achievement status changes to IGameCenterControl::STATUS_ACHIEVEMENT_IDLE. The achievement entries can be accessed by GetAchievements().

Boolean LoadAchievements()

Returns
Boolean true if successful.

GetAchievements()

Get an array of achievement entries. The achievements entries are available when LoadAchievements() is finished.

Murl.Array.IGameCenterAchievementEntryConst GetAchievements()

Returns
Murl.Array.IGameCenterAchievementEntryConst The array of achievement entries.

IsAchievementIdle()

Check if the game-center achievement status is IGameCenterControl::STATUS_ACHIEVEMENT_IDLE.

Boolean IsAchievementIdle()

Returns
Boolean true if the status is IGameCenterControl::STATUS_ACHIEVEMENT_IDLE.

IsAchievementShowing()

Check if the game-center achievement status is IGameCenterControl::STATUS_ACHIEVEMENT_SHOWING.

Boolean IsAchievementShowing()

Returns
Boolean true if the status is IGameCenterControl::STATUS_ACHIEVEMENT_SHOWING.

IsAchievementReporting()

Check if the game-center achievement status is IGameCenterControl::STATUS_ACHIEVEMENT_REPOTRING.

Boolean IsAchievementReporting()

Returns
Boolean true if the status is IGameCenterControl::STATUS_ACHIEVEMENT_REPOTRING.

IsAchievementResetting()

Check if the game-center achievement status is IGameCenterControl::STATUS_ACHIEVEMENT_RESETTING.

Boolean IsAchievementResetting()

Returns
Boolean true if the status is IGameCenterControl::STATUS_ACHIEVEMENT_RESETTING.

IsAchievementLoading()

Check if the game-center achievement status is IGameCenterControl::STATUS_ACHIEVEMENT_LOADING.

Boolean IsAchievementLoading()

Returns
Boolean true if the status is IGameCenterControl::STATUS_ACHIEVEMENT_LOADING.

GetError()

Get the game-center error status.

Murl.IGameCenterControl.Error GetError()

Returns
Murl.IGameCenterControl.Error The game-center error status.

ClearLastError()

Clear the last error status. Set the error status to IGameCenterControl::ERROR_NONE.

Boolean ClearLastError()

Returns
Boolean true if successful.