GKTurnBasedMatchmakerViewController¶
Inherits: RefCounted < Object
Presents Apple’s turn-based matchmaking UI.
Description¶
Wrapper around GKTurnBasedMatchmakerViewController. Use create_controller() when you want to keep the controller instance and listen to its signals, or request_match() for a one-shot request/callback flow.
Properties¶
int |
|
|
bool |
|
Methods¶
create_controller(request: GKMatchRequest) static |
|
void |
present() |
void |
request_match(request: GKMatchRequest, callback: Callable) static |
Signals¶
cancelled(detail: String) 🔗
Emitted when the matchmaking UI is canceled.
did_find_match(match: GKTurnBasedMatch) 🔗
Emitted when a turn-based match is found.
failed_with_error(message: String) 🔗
Emitted when matchmaking fails with an error message.
player_quit_for_match(match: GKTurnBasedMatch) 🔗
Emitted when a player quits the specified turn-based match from the matchmaking UI flow.
Enumerations¶
enum MatchmakingMode: 🔗
MatchmakingMode DEFAULT = 0
Use Apple’s default turn-based matchmaking behavior.
MatchmakingMode NEARBY_ONLY = 1
Restrict matchmaking to nearby players.
MatchmakingMode AUTOMATCH_ONLY = 2
Restrict to automatch players only.
MatchmakingMode INVITE_ONLY = 3
Restrict to invited players only.
Property Descriptions¶
int matchmaking_mode = 0 🔗
void set_matchmaking_mode(value: int)
int get_matchmaking_mode()
Controls how players are matched. See MatchmakingMode.
bool show_existing_matches = true 🔗
void set_show_existing_matches(value: bool)
bool get_show_existing_matches()
If true, the UI can show the player’s existing turn-based matches.
Method Descriptions¶
GKTurnBasedMatchmakerViewController create_controller(request: GKMatchRequest) static 🔗
Creates a controller for the provided GKMatchRequest. Call present() to show it and connect to signals such as did_find_match and failed_with_error.
void present() 🔗
Presents this controller’s matchmaking UI.
void request_match(request: GKMatchRequest, callback: Callable) static 🔗
Shows turn-based matchmaking UI and returns the result through callback. The callback receives (GKTurnBasedMatch match, Variant error). On failure or cancel, match is null and error contains a GKError.