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: int) static |
Enumerations¶
enum MatchType: 🔗
MatchType peerToPeer = 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 turnBased = 2
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.
Method Descriptions¶
int max_players_allowed_for_match(forType: int) static 🔗
Returns Apple’s maximum supported player count for the supplied match type (peer_to_peer, hosted, or turn_based).