Package apple.gamekit
Class GKLocalPlayer
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.gamekit.GKBasePlayer
-
- apple.gamekit.GKPlayer
-
- apple.gamekit.GKLocalPlayer
-
- All Implemented Interfaces:
GKSavedGameListener,NSObject
public class GKLocalPlayer extends GKPlayer implements GKSavedGameListener
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.gamekit.GKPlayer
GKPlayer.Block_loadPhotoForSizeWithCompletionHandler, GKPlayer.Block_loadPlayersForIdentifiersWithCompletionHandler
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedGKLocalPlayer(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()static GKLocalPlayeralloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)static java.lang.ObjectanonymousGuestPlayerWithIdentifier(java.lang.String guestIdentifier)GKLocalPlayer.Block_authenticateHandler_retauthenticateHandler()voidauthenticateWithCompletionHandler(GKLocalPlayer.Block_authenticateWithCompletionHandler completionHandler)Deprecated.static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)static NSArray<java.lang.String>classFallbacksForKeyedArchiver()static org.moe.natj.objc.ClassclassForKeyedUnarchiver()static java.lang.StringdebugDescription_static()voiddeleteSavedGamesWithNameCompletionHandler(java.lang.String name, GKLocalPlayer.Block_deleteSavedGamesWithNameCompletionHandler handler)Asynchronously delete saved games with the given name.static java.lang.Stringdescription_static()voidfetchItemsForIdentityVerificationSignature(GKLocalPlayer.Block_fetchItemsForIdentityVerificationSignature completionHandler)Generates a signature allowing 3rd party server to authenticate the GKLocalPlayer Possible reasons for error: 1.voidfetchSavedGamesWithCompletionHandler(GKLocalPlayer.Block_fetchSavedGamesWithCompletionHandler handler)Asynchronously fetch saved games.NSArray<java.lang.String>friends()Deprecated.voidgenerateIdentityVerificationSignatureWithCompletionHandler(GKLocalPlayer.Block_generateIdentityVerificationSignatureWithCompletionHandler completionHandler)Generates a signature allowing 3rd party server to authenticate the GKLocalPlayer Possible reasons for error: 1.static longhash_static()GKLocalPlayerinit()static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)booleanisAuthenticated()Authentication statebooleanisMultiplayerGamingRestricted()A Boolean value that declares whether or not multiplayer gaming is restricted on this device.booleanisPersonalizedCommunicationRestricted()A Boolean value that declares whether personalized communication is restricted on this device.static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)booleanisUnderage()Indicates if a player is under agestatic NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)voidloadChallengableFriendsWithCompletionHandler(GKLocalPlayer.Block_loadChallengableFriendsWithCompletionHandler completionHandler)Asynchronously load the challengable friends list as an array of GKPlayer.voidloadDefaultLeaderboardCategoryIDWithCompletionHandler(GKLocalPlayer.Block_loadDefaultLeaderboardCategoryIDWithCompletionHandler completionHandler)Deprecated.voidloadDefaultLeaderboardIdentifierWithCompletionHandler(GKLocalPlayer.Block_loadDefaultLeaderboardIdentifierWithCompletionHandler completionHandler)Load the default leaderboard identifier for the local player Possible reasons for error: 1.voidloadFriendPlayersWithCompletionHandler(GKLocalPlayer.Block_loadFriendPlayersWithCompletionHandler completionHandler)voidloadFriendsWithCompletionHandler(GKLocalPlayer.Block_loadFriendsWithCompletionHandler completionHandler)Deprecated.static voidloadPlayersForIdentifiersWithCompletionHandler(NSArray<java.lang.String> identifiers, GKPlayer.Block_loadPlayersForIdentifiersWithCompletionHandler completionHandler)voidloadRecentPlayersWithCompletionHandler(GKLocalPlayer.Block_loadRecentPlayersWithCompletionHandler completionHandler)Asynchronously load the recent players list as an array of GKPlayer.static GKLocalPlayerlocal()Obtain the primary GKLocalPlayer object.static GKLocalPlayerlocalPlayer()static java.lang.Objectnew_objc()voidplayerDidModifySavedGame(GKPlayer player, GKSavedGame savedGame)Called when a player’s saved game data has been modified.voidplayerHasConflictingSavedGames(GKPlayer player, NSArray<? extends GKSavedGame> savedGames)Called when a conflict has arisen between different versions of the same saved game.voidregisterListener(GKLocalPlayerListener listener)A single listener may be registered once.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)voidresolveConflictingSavedGamesWithDataCompletionHandler(NSArray<? extends GKSavedGame> conflictingSavedGames, NSData data, GKLocalPlayer.Block_resolveConflictingSavedGamesWithDataCompletionHandler handler)Asynchronously resolve a saved game conflict.static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)voidsaveGameDataWithNameCompletionHandler(NSData data, java.lang.String name, GKLocalPlayer.Block_saveGameDataWithNameCompletionHandler handler)Asynchronously save game data.voidsetAuthenticateHandler(GKLocalPlayer.Block_setAuthenticateHandler value)voidsetDefaultLeaderboardCategoryIDCompletionHandler(java.lang.String categoryID, GKLocalPlayer.Block_setDefaultLeaderboardCategoryIDCompletionHandler completionHandler)Deprecated.voidsetDefaultLeaderboardIdentifierCompletionHandler(java.lang.String leaderboardIdentifier, GKLocalPlayer.Block_setDefaultLeaderboardIdentifierCompletionHandler completionHandler)Set the default leaderboard for the current game Possible reasons for error: 1.static voidsetVersion_static(long aVersion)static org.moe.natj.objc.Classsuperclass_static()voidunregisterAllListeners()voidunregisterListener(GKLocalPlayerListener listener)static longversion_static()-
Methods inherited from class apple.gamekit.GKPlayer
alias, displayName, gamePlayerID, guestIdentifier, isFriend, isInvitable, loadPhotoForSizeWithCompletionHandler, playerID, scopedIDsArePersistent, teamPlayerID
-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static GKLocalPlayer alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
anonymousGuestPlayerWithIdentifier
public static java.lang.Object anonymousGuestPlayerWithIdentifier(java.lang.String guestIdentifier)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
loadPlayersForIdentifiersWithCompletionHandler
public static void loadPlayersForIdentifiersWithCompletionHandler(NSArray<java.lang.String> identifiers, GKPlayer.Block_loadPlayersForIdentifiersWithCompletionHandler completionHandler)
-
localPlayer
public static GKLocalPlayer localPlayer()
-
new_objc
public static java.lang.Object new_objc()
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
authenticateHandler
public GKLocalPlayer.Block_authenticateHandler_ret authenticateHandler()
-
authenticateWithCompletionHandler
@Deprecated public void authenticateWithCompletionHandler(GKLocalPlayer.Block_authenticateWithCompletionHandler completionHandler)
Deprecated.
-
deleteSavedGamesWithNameCompletionHandler
public void deleteSavedGamesWithNameCompletionHandler(java.lang.String name, GKLocalPlayer.Block_deleteSavedGamesWithNameCompletionHandler handler)Asynchronously delete saved games with the given name. The completion handler will indicate whether or not the deletion was successful.
-
fetchSavedGamesWithCompletionHandler
public void fetchSavedGamesWithCompletionHandler(GKLocalPlayer.Block_fetchSavedGamesWithCompletionHandler handler)
Asynchronously fetch saved games. The handler is called with an array of GKSavedGame objects or an error. If there is more than one saved game with the same name then a conflict exists. The application should determine the correct data to use and call resolveConflictingSavedGames:withData:completionHandler:. This may require data merging or asking the user.
-
friends
@Deprecated public NSArray<java.lang.String> friends()
Deprecated.Array of player identifiers of friends for the local player. Not valid until loadFriendsWithCompletionHandler: has completed.
-
generateIdentityVerificationSignatureWithCompletionHandler
public void generateIdentityVerificationSignatureWithCompletionHandler(GKLocalPlayer.Block_generateIdentityVerificationSignatureWithCompletionHandler completionHandler)
Generates a signature allowing 3rd party server to authenticate the GKLocalPlayer Possible reasons for error: 1. Communications problem 2. Unauthenticated player
-
init
public GKLocalPlayer init()
-
isAuthenticated
public boolean isAuthenticated()
Authentication state
-
isUnderage
public boolean isUnderage()
Indicates if a player is under age
-
loadDefaultLeaderboardCategoryIDWithCompletionHandler
@Deprecated public void loadDefaultLeaderboardCategoryIDWithCompletionHandler(GKLocalPlayer.Block_loadDefaultLeaderboardCategoryIDWithCompletionHandler completionHandler)
Deprecated.
-
loadDefaultLeaderboardIdentifierWithCompletionHandler
public void loadDefaultLeaderboardIdentifierWithCompletionHandler(GKLocalPlayer.Block_loadDefaultLeaderboardIdentifierWithCompletionHandler completionHandler)
Load the default leaderboard identifier for the local player Possible reasons for error: 1. Communications problem 2. Unauthenticated player 3. Leaderboard not present
-
loadFriendPlayersWithCompletionHandler
public void loadFriendPlayersWithCompletionHandler(GKLocalPlayer.Block_loadFriendPlayersWithCompletionHandler completionHandler)
-
loadFriendsWithCompletionHandler
@Deprecated public void loadFriendsWithCompletionHandler(GKLocalPlayer.Block_loadFriendsWithCompletionHandler completionHandler)
Deprecated.This method is obsolete. It will never be invoked and its implementation does nothing**
-
loadRecentPlayersWithCompletionHandler
public void loadRecentPlayersWithCompletionHandler(GKLocalPlayer.Block_loadRecentPlayersWithCompletionHandler completionHandler)
Asynchronously load the recent players list as an array of GKPlayer. A recent player is someone that you have played a game with or is a legacy game center friend. Calls completionHandler when finished. Error will be nil on success. Possible reasons for error: 1. Communications problem 2. Unauthenticated player
-
playerDidModifySavedGame
public void playerDidModifySavedGame(GKPlayer player, GKSavedGame savedGame)
Description copied from interface:GKSavedGameListenerCalled when a player’s saved game data has been modified.- Specified by:
playerDidModifySavedGamein interfaceGKSavedGameListener
-
playerHasConflictingSavedGames
public void playerHasConflictingSavedGames(GKPlayer player, NSArray<? extends GKSavedGame> savedGames)
Description copied from interface:GKSavedGameListenerCalled when a conflict has arisen between different versions of the same saved game. This can happen when multiple devices write to the same saved game while one or more is offline. The application should determine the correct data to use, then call resolveConflictingSavedGames:withData:completionHandler:. This may require data merging or asking the user.- Specified by:
playerHasConflictingSavedGamesin interfaceGKSavedGameListener
-
registerListener
public void registerListener(GKLocalPlayerListener listener)
A single listener may be registered once. Registering multiple times results in undefined behavior. The registered listener will receive callbacks for any selector it responds to.
-
resolveConflictingSavedGamesWithDataCompletionHandler
public void resolveConflictingSavedGamesWithDataCompletionHandler(NSArray<? extends GKSavedGame> conflictingSavedGames, NSData data, GKLocalPlayer.Block_resolveConflictingSavedGamesWithDataCompletionHandler handler)
Asynchronously resolve a saved game conflict. This deletes all versions included in conflictingSavedGames and creates a new version with the given data. The completion handler is called with the newly created save and all other remaining versions or an error.
-
saveGameDataWithNameCompletionHandler
public void saveGameDataWithNameCompletionHandler(NSData data, java.lang.String name, GKLocalPlayer.Block_saveGameDataWithNameCompletionHandler handler)
Asynchronously save game data. If a saved game with that name already exists it is overwritten, otherwise a new one is created. The completion handler is called with the new / modified GKSavedGame or an error. If the saved game was in conflict then the overwritten version will be the one with the same deviceName if present, otherwise the most recent overall.
-
setAuthenticateHandler
public void setAuthenticateHandler(GKLocalPlayer.Block_setAuthenticateHandler value)
-
setDefaultLeaderboardCategoryIDCompletionHandler
@Deprecated public void setDefaultLeaderboardCategoryIDCompletionHandler(java.lang.String categoryID, GKLocalPlayer.Block_setDefaultLeaderboardCategoryIDCompletionHandler completionHandler)Deprecated.
-
setDefaultLeaderboardIdentifierCompletionHandler
public void setDefaultLeaderboardIdentifierCompletionHandler(java.lang.String leaderboardIdentifier, GKLocalPlayer.Block_setDefaultLeaderboardIdentifierCompletionHandler completionHandler)Set the default leaderboard for the current game Possible reasons for error: 1. Communications problem 2. Unauthenticated player 3. Leaderboard not present
-
unregisterAllListeners
public void unregisterAllListeners()
-
unregisterListener
public void unregisterListener(GKLocalPlayerListener listener)
-
isMultiplayerGamingRestricted
public boolean isMultiplayerGamingRestricted()
A Boolean value that declares whether or not multiplayer gaming is restricted on this device.
-
loadChallengableFriendsWithCompletionHandler
public void loadChallengableFriendsWithCompletionHandler(GKLocalPlayer.Block_loadChallengableFriendsWithCompletionHandler completionHandler)
Asynchronously load the challengable friends list as an array of GKPlayer. A challengable player is a friend player with friend level FL1 and FL2. Calls completionHandler when finished. Error will be nil on success. Possible reasons for error: 1. Communications problem 2. Unauthenticated player
-
local
public static GKLocalPlayer local()
Obtain the primary GKLocalPlayer object. The player is only available for offline play until logged in. A temporary player is created if no account is set up.
-
fetchItemsForIdentityVerificationSignature
public void fetchItemsForIdentityVerificationSignature(GKLocalPlayer.Block_fetchItemsForIdentityVerificationSignature completionHandler)
Generates a signature allowing 3rd party server to authenticate the GKLocalPlayer Possible reasons for error: 1. Communications problem 2. Unauthenticated player
-
isPersonalizedCommunicationRestricted
public boolean isPersonalizedCommunicationRestricted()
A Boolean value that declares whether personalized communication is restricted on this device. If it is restricted, the player will not be able to read or write personalized messages on game invites, challenges, or enable voice communication in multiplayer games. Note: this value will always be true when isUnderage is true.
-
-