Package apple.gamekit

Class GKMatch

  • All Implemented Interfaces:
    NSObject

    public class GKMatch
    extends NSObject
    GKMatch represents an active networking sessions between players. It handles network communications and can report player connection status. All matches are created by a GKMatchmaker.
    • Constructor Detail

      • GKMatch

        protected GKMatch​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • alloc

        public static GKMatch alloc()
      • allocWithZone

        public static GKMatch allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull 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()
      • 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

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • new_objc

        public static GKMatch 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()
      • chooseBestHostPlayerWithCompletionHandler

        @Deprecated
        public void chooseBestHostPlayerWithCompletionHandler​(@NotNull
                                                              @NotNull GKMatch.Block_chooseBestHostPlayerWithCompletionHandler completionHandler)
        Deprecated.
        This method is obsolete. It will never be invoked and its implementation does nothing** API-Since: 6.0 Deprecated-Since: 8.0
      • chooseBestHostingPlayerWithCompletionHandler

        public void chooseBestHostingPlayerWithCompletionHandler​(@NotNull
                                                                 @NotNull GKMatch.Block_chooseBestHostingPlayerWithCompletionHandler completionHandler)
        Choose the best host from among the connected players using gathered estimates for bandwidth and packet loss. This is intended for applications that wish to implement a client-server model on top of the match. The returned player ID will be nil if the best host cannot currently be determined (e.g. players are still connecting). API-Since: 8.0
      • delegate

        @Nullable
        public @Nullable GKMatchDelegate delegate()
        all the GKPlayers in the match
      • disconnect

        public void disconnect()
        Disconnect the match. This will show all other players in the match that the local player has disconnected. This should be called before releasing the match instance.
      • expectedPlayerCount

        public long expectedPlayerCount()
      • playerIDs

        @Nullable
        @Deprecated
        public @Nullable NSArray<java.lang.String> playerIDs()
        Deprecated.
        NSStrings of player identifiers in the match API-Since: 4.1 Deprecated-Since: 8.0
      • players

        @NotNull
        public @NotNull NSArray<? extends GKPlayer> players()
        API-Since: 8.0
      • rematchWithCompletionHandler

        public void rematchWithCompletionHandler​(@Nullable
                                                 @Nullable GKMatch.Block_rematchWithCompletionHandler completionHandler)
        Automatching to recreate a previous peer-to-peer match that became disconnected. A new match with the same set of players will be returned by the completion handler. All players should perform this when the match has ended for automatching to succeed. Error will be nil on success. Possible reasons for error: 1. Communications failure 2. Timeout API-Since: 6.0
      • sendDataToPlayersDataModeError

        public boolean sendDataToPlayersDataModeError​(@NotNull
                                                      @NotNull NSData data,
                                                      @NotNull
                                                      @NotNull NSArray<? extends GKPlayer> players,
                                                      long mode,
                                                      @Nullable
                                                      @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Asynchronously send data to one or more GKPlayers. Returns YES if delivery started, NO if unable to start sending and error will be set. API-Since: 8.0
      • sendDataToPlayersWithDataModeError

        @Deprecated
        public boolean sendDataToPlayersWithDataModeError​(@NotNull
                                                          @NotNull NSData data,
                                                          @NotNull
                                                          @NotNull NSArray<java.lang.String> playerIDs,
                                                          long mode,
                                                          @Nullable
                                                          @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Deprecated.
        This method is obsolete. It will never be invoked and its implementation does nothing** API-Since: 4.1 Deprecated-Since: 8.0
      • sendDataToAllPlayersWithDataModeError

        public boolean sendDataToAllPlayersWithDataModeError​(@NotNull
                                                             @NotNull NSData data,
                                                             long mode,
                                                             @Nullable
                                                             @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        Asynchronously broadcasts data to all players. Returns YES if delivery started, NO if unable to start sending and error will be set.
      • setDelegate_unsafe

        public void setDelegate_unsafe​(@Nullable
                                       @Nullable GKMatchDelegate value)
        all the GKPlayers in the match
      • setDelegate

        public void setDelegate​(@Nullable
                                @Nullable GKMatchDelegate value)
        all the GKPlayers in the match
      • voiceChatWithName

        @Nullable
        public @Nullable GKVoiceChat voiceChatWithName​(@NotNull
                                                       @NotNull java.lang.String name)
        Join a named voice chat channel Will return nil if parental controls are turned on
      • playerProperties

        @Nullable
        public @Nullable NSDictionary<? extends GKPlayer,​?> playerProperties()
        API-Since: 17.2
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.