Class: GKMatchRequest

Inherits:
NSObject show all

Overview

A GKMatchRequest object is used to specify the parameters for a new match. You pass the GKMatchRequest object to a GKMatchmaker object when you want to programmatically create the match, or you pass it to a GKMatchmakerViewController object to present the default user interface.

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Methods inherited from NSObject

#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version

Constructor Details

This class inherits a constructor from NSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NSObject

Instance Attribute Details

- (Integer) defaultNumberOfPlayers

The default number of players for the match. If this property is not set, then the default number of players is equal to the value stored in the maxPlayers property. The default number of players determines the number of invitees shown in the standard matchmaking user interface. The player can choose to override this to add or remove slots.

Returns:

- (String) inviteMessage

The string displayed on another player’s device when invited to join a match.

Returns:

- (Integer) maxPlayers

The maximum number of players that may join the match. The maximum number of players must be equal or greater than the minimum number of players. The maximum number of players may be no more than value returned by the maxPlayersAllowedForMatchOfType: method for the kind of match you plan to create.

Returns:

- (Integer) minPlayers

The minimum number of players that may join the match. The minimum number of players must be at least 2.

Returns:

- (Integer) playerAttributes

A mask that specifies the role that the local player would like to play in the game. If this value is 0 (the default), this property is ignored. If the value is nonzero, then automatching uses the value as a mask that restricts the role the player can play in the group. Automatching with player attributes matches new players into the game so that the bitwise OR of the masks of all the players in the resulting match equals 0xFFFFFFFF.For more information, see Game Center Programming Guide.

Returns:

- (Integer) playerGroup

A number identifying a subset of players allowed to join the match. If your game sets the playerGroup property, only players whose requests share the same playerGroup value are automatched by Game Center. The value of a player group is arbitrary. For example, you could define different playerGroup values to implement any of the following filters:A game could restrict players based on skill level.A game that provides multiple game modes could use it to filter players into the specific game they want to play.A game that provides bonus content through in-app purchase could match players who own the same content with each other.

Returns:

- (Array) playersToInvite

A list of players to invite to the match. If nil (the default), no players are invited. If non-nil, Game Kit invites the provided list of players to the match.

Returns:

Class Method Details

+ (Integer) maxPlayersAllowedForMatchOfType(matchType)

Returns the maximum number of players allowed in the match request for a given match type.

Parameters:

  • matchType (GKMatchType)

    The kind of match. See “Match Type.”

Returns:

  • (Integer)

    The maximum number of allowed players for that type of match.