Show / Hide Table of Contents

Class ISN_GKLocalPlayer

An object representing the authenticated Game Center player on a device.

At any given time, only one player may be authenticated on the device; this player must log out before another player can log in. Your game must authenticate the local player before using any Game Center features. Authenticating the player ensures that the player has created an account and is connected to Game Center.

Inheritance
System.Object
ISN_GKPlayer
ISN_GKLocalPlayer
Inherited Members
ISN_GKPlayer.PlayerId
ISN_GKPlayer.PlayerID
ISN_GKPlayer.Alias
ISN_GKPlayer.DisplayName
ISN_GKPlayer.GuestIdentifier
ISN_GKPlayer.GamePlayerId
ISN_GKPlayer.TeamPlayerId
ISN_GKPlayer.ScopedIDsArePersistent
ISN_GKPlayer.LoadPhoto(GKPhotoSize, Action<ISN_GKImageLoadResult>)
Namespace: SA.iOS.GameKit
Assembly: cs.temp.dll.dll
Syntax
public class ISN_GKLocalPlayer : ISN_GKPlayer

Properties

Authenticated

A Boolean value that indicates whether a local player is currently signed in to Game Center.

Declaration
public bool Authenticated { get; }
Property Value
Type Description
System.Boolean

LocalPlayer

Declaration
public static ISN_GKLocalPlayer LocalPlayer { get; }
Property Value
Type Description
ISN_GKLocalPlayer

Underage

A Boolean value that declares whether the local player is underage. Some Game Center features are disabled if the local player is underage. Your game can also test this property if it wants to disable some of its own features based on the player’s age.

Declaration
public bool Underage { get; }
Property Value
Type Description
System.Boolean

Methods

DeleteSavedGame(ISN_GKSavedGame, Action<SA_Result>)

Deletes a specific saved game.

Declaration
public static void DeleteSavedGame(ISN_GKSavedGame game, Action<SA_Result> callback)
Parameters
Type Name Description
ISN_GKSavedGame game
Action<SA_Result> callback

FetchSavedGames(Action<ISN_GKSavedGameFetchResult>)

Retrieves all available saved games.

Declaration
public static void FetchSavedGames(Action<ISN_GKSavedGameFetchResult> callback)
Parameters
Type Name Description
Action<ISN_GKSavedGameFetchResult> callback

GenerateIdentityVerificationSignatureWithCompletionHandler(Action<ISN_GKIdentityVerificationSignatureResult>)

Generates a signature that allows a third party server to authenticate the local player.

When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion callback. The completion handler is always called on the main thread.

Declaration
public void GenerateIdentityVerificationSignatureWithCompletionHandler(Action<ISN_GKIdentityVerificationSignatureResult> callback)
Parameters
Type Name Description
Action<ISN_GKIdentityVerificationSignatureResult> callback

Background task completion callback.

LoadDefaultLeaderboardIdentifier(Action<ISN_GKLoadDefaultLeaderboardResult>)

Loads the category identifier for the local player’s default leaderboard.

This method loads the default leaderboard set in App Store Connect. this method to retrieve the default leaderboard.

When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion handler. The completion handler is always called on the main thread.

Declaration
public void LoadDefaultLeaderboardIdentifier(Action<ISN_GKLoadDefaultLeaderboardResult> callback)
Parameters
Type Name Description
Action<ISN_GKLoadDefaultLeaderboardResult> callback

A block to be called when the request completes.

LoadGameData(ISN_GKSavedGame, Action<ISN_GKSavedGameLoadResult>)

Loads specific saved game data.

Declaration
public static void LoadGameData(ISN_GKSavedGame game, Action<ISN_GKSavedGameLoadResult> callback)
Parameters
Type Name Description
ISN_GKSavedGame game
Action<ISN_GKSavedGameLoadResult> callback

ResolveConflictingSavedGames(List<String>, Byte[], Action<ISN_GKSavedGameFetchResult>)

Resolves conflicted saved games.

Declaration
public static void ResolveConflictingSavedGames(List<string> conflictedGames, byte[] data, Action<ISN_GKSavedGameFetchResult> callback)
Parameters
Type Name Description
List<System.String> conflictedGames
System.Byte[] data
Action<ISN_GKSavedGameFetchResult> callback

SavedGame(String, Byte[], Action<ISN_GKSavedGameSaveResult>)

Saves game data under the specified name.

Declaration
public static void SavedGame(string name, byte[] data, Action<ISN_GKSavedGameSaveResult> callback)
Parameters
Type Name Description
System.String name
System.Byte[] data
Action<ISN_GKSavedGameSaveResult> callback

SetAuthenticateHandler(Action<SA_Result>)

A handler called to process an authentication-related event.

Your game should authenticate the player as early as possible after launching, ideally as soon as you can present a user interface to the player. For example, your game may be launched because the player accepted an invitation to join a match or to take a turn in a turn-based match, so you want your game to authenticate the player and process the match invitation as quickly as possible. After you set a handler, authentication begins automatically and is repeated when your game moves to the background and then back to the foreground.

Declaration
public static void SetAuthenticateHandler(Action<SA_Result> callback)
Parameters
Type Name Description
Action<SA_Result> callback

Authentication Result

SetDefaultLeaderboardIdentifier(String, Action<SA_Result>)

Sets the default leaderboard for the current game.

When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your completion handler. The completion handler is always called on the main thread.

The default leaderboard is configured in App Store Connect as part of configuring your game’s leaderboards. All players normally start with this leaderboard as the default leaderboard. Calling this method changes the default leaderboard only for the local player.

Declaration
public void SetDefaultLeaderboardIdentifier(string leaderboardIdentifier, Action<SA_Result> callback)
Parameters
Type Name Description
System.String leaderboardIdentifier

The identifier of the leaderboard to be set as the default leaderboard.

Action<SA_Result> callback

A block to be called when the request completes.

In This Article
Back to top Generated by DocFX