:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/../../GodotApplePlugins/doc_classes/GKMatchRequest.xml. .. _class_GKMatchRequest: GKMatchRequest ============== **Inherits:** :ref:`RefCounted` **<** :ref:`Object` Configures how many players Game Center should recruit for a realtime match. .. rst-class:: classref-introduction-group Description ----------- Instantiate ``GKMatchRequest``, set the minimum/maximum player counts and invite message, then either create a ``GKMatchmakerViewController`` (for full UI control) or call :ref:`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: .. tabs:: .. code-tab:: gdscript 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) .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-----------------------------+-------------------------------------------------------------------------------------------+--------+ | :ref:`int` | :ref:`default_number_of_players` | ``0`` | +-----------------------------+-------------------------------------------------------------------------------------------+--------+ | :ref:`String` | :ref:`invite_message` | ``""`` | +-----------------------------+-------------------------------------------------------------------------------------------+--------+ | :ref:`int` | :ref:`max_players` | ``2`` | +-----------------------------+-------------------------------------------------------------------------------------------+--------+ | :ref:`int` | :ref:`min_players` | ``2`` | +-----------------------------+-------------------------------------------------------------------------------------------+--------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`max_players_allowed_for_match`\ (\ forType\: :ref:`int`\ ) |static| | +-----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerations ------------ .. _enum_GKMatchRequest_MatchType: .. rst-class:: classref-enumeration enum **MatchType**: :ref:`🔗` .. _class_GKMatchRequest_constant_peerToPeer: .. rst-class:: classref-enumeration-constant :ref:`MatchType` **peerToPeer** = ``0`` .. container:: contribute There is currently no description for this enum. Please help us by `contributing one `__! .. _class_GKMatchRequest_constant_hosted: .. rst-class:: classref-enumeration-constant :ref:`MatchType` **hosted** = ``1`` .. container:: contribute There is currently no description for this enum. Please help us by `contributing one `__! .. _class_GKMatchRequest_constant_turnBased: .. rst-class:: classref-enumeration-constant :ref:`MatchType` **turnBased** = ``2`` .. container:: contribute There is currently no description for this enum. Please help us by `contributing one `__! .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_GKMatchRequest_property_default_number_of_players: .. rst-class:: classref-property :ref:`int` **default_number_of_players** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_default_number_of_players**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_default_number_of_players**\ (\ ) Default number of players your UI suggests when presenting the matchmaking sheet. .. rst-class:: classref-item-separator ---- .. _class_GKMatchRequest_property_invite_message: .. rst-class:: classref-property :ref:`String` **invite_message** = ``""`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_invite_message**\ (\ value\: :ref:`String`\ ) - :ref:`String` **get_invite_message**\ (\ ) Optional text Apple shows when the player sends invitations (see the ``invite_message`` example in the guide). .. rst-class:: classref-item-separator ---- .. _class_GKMatchRequest_property_max_players: .. rst-class:: classref-property :ref:`int` **max_players** = ``2`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_max_players**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_max_players**\ (\ ) Maximum desired players in the match. .. rst-class:: classref-item-separator ---- .. _class_GKMatchRequest_property_min_players: .. rst-class:: classref-property :ref:`int` **min_players** = ``2`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_min_players**\ (\ value\: :ref:`int`\ ) - :ref:`int` **get_min_players**\ (\ ) Minimum player count required before the match can start. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_GKMatchRequest_method_max_players_allowed_for_match: .. rst-class:: classref-method :ref:`int` **max_players_allowed_for_match**\ (\ forType\: :ref:`int`\ ) |static| :ref:`🔗` Returns Apple's maximum supported player count for the supplied match type (``peer_to_peer``, ``hosted``, or ``turn_based``). .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`