GKMatchRequest¶
Inherits: RefCounted < Object
Configures how many players Game Center should recruit for a realtime match.
Description¶
Instantiate GKMatchRequest, set the minimum/maximum player counts and invite message, then either create a GKMatchmakerViewController (for full UI control) or call GKMatchmakerViewController.request_match() as shown in GameCenterGuide.md. The optional MatchType argument lets you switch between peer-to-peer, hosted, or turn-based matchmaking. Apple’s guide is at Apple’s GKMatchRequest reference.
Configuration snippet from the guide:
var request := GKMatchRequest.new()
request.max_players = 2
request.min_players = 1
request.invite_message = "Join me in a quest to fun"
var max_supported := GKMatchRequest.max_players_allowed_for_match(GKMatchRequest.MatchType.peerToPeer)
print("Peer-to-peer supports up to %d players" % max_supported)
Properties¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods¶
max_players_allowed_for_match(forType: MatchType) static |
Enumerations¶
enum MatchType: 🔗
MatchType PEER_TO_PEER = 0
There is currently no description for this enum. Please help us by contributing one!
MatchType HOSTED = 1
There is currently no description for this enum. Please help us by contributing one!
MatchType TURN_BASED = 2
There is currently no description for this enum. Please help us by contributing one!
enum InviteRecipientResponse: 🔗
InviteRecipientResponse ACCEPTED = 0
There is currently no description for this enum. Please help us by contributing one!
InviteRecipientResponse DECLINED = 1
There is currently no description for this enum. Please help us by contributing one!
InviteRecipientResponse FAILED = 2
There is currently no description for this enum. Please help us by contributing one!
InviteRecipientResponse INCOMPATIBLE = 3
There is currently no description for this enum. Please help us by contributing one!
InviteRecipientResponse UNABLE_TO_CONNECT = 4
There is currently no description for this enum. Please help us by contributing one!
InviteRecipientResponse NO_ANSWER = 5
There is currently no description for this enum. Please help us by contributing one!
InviteRecipientResponse UNKNOWN = 6
There is currently no description for this enum. Please help us by contributing one!
Property Descriptions¶
int default_number_of_players = 0 🔗
Default number of players your UI suggests when presenting the matchmaking sheet.
Optional text Apple shows when the player sends invitations (see the invite_message example in the guide).
Maximum desired players in the match.
Minimum player count required before the match can start.
int player_attributes = 4294967295 🔗
There is currently no description for this property. Please help us by contributing one!
There is currently no description for this property. Please help us by contributing one!
Dictionary properties = {} 🔗
void set_properties(value: Dictionary)
Dictionary get_properties()
There is currently no description for this property. Please help us by contributing one!
There is currently no description for this property. Please help us by contributing one!
Dictionary recipient_properties = {} 🔗
void set_recipient_properties(value: Dictionary)
Dictionary get_recipient_properties()
There is currently no description for this property. Please help us by contributing one!
There is currently no description for this property. Please help us by contributing one!
There is currently no description for this property. Please help us by contributing one!
Method Descriptions¶
int max_players_allowed_for_match(forType: MatchType) static 🔗
Returns Apple’s maximum supported player count for the supplied match type (peer_to_peer, hosted, or turn_based).