.. 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/docs/gdscript/jam_launch/JamConnect.xml. .. _class_JamConnect: JamConnect ========== **Inherits:** :ref:`Node` **<** :ref:`Object` A :ref:`Node` that simplifies integration with the Jam Launch API. .. rst-class:: classref-introduction-group Description ----------- The JamConnect Node serves as an all-in-one Jam Launch integration that handles client and server initialization, and provides a session establishment GUI for clients. It is designed to be placed in a multiplayer game's main scene and connected to the player joining/leaving functions via the :ref:`player_connected` and :ref:`player_disconnected` signals. When a JamConnect node determines that a game is being started as a server (e.g. by checking a feature tag), it will add a :ref:`JamServer` child node which configures the Godot multiplayer peer in server mode and spins up things like the Jam Launch Data API (which is only accessible from the server). When a JamConnect node determines that a game is being started as a client, it will add a :ref:`JamClient` child node which configures the Godot multiplayer peer in client mode, and overlays a GUI for establishing the connection to the server via the Jam Launch API. The JamConnect Node is not strictly necessary for integrating a game with Jam Launch - it is just a reasonable all-in-one default. The various low-level clients and utilities being used by JamConnect could be recomposed by an advanced user into a highly customized solution. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-------------------------------------------------+-------------------------------------------------------------------+------------+ | :ref:`JamClient` | :ref:`client` | | +-------------------------------------------------+-------------------------------------------------------------------+------------+ | :ref:`JamServer` | :ref:`server` | | +-------------------------------------------------+-------------------------------------------------------------------+------------+ | :ref:`String` | :ref:`game_id` | | +-------------------------------------------------+-------------------------------------------------------------------+------------+ | :ref:`bool` | :ref:`allow_guests` | ``false`` | +-------------------------------------------------+-------------------------------------------------------------------+------------+ | :ref:`String` | :ref:`network_mode` | ``"enet"`` | +-------------------------------------------------+-------------------------------------------------------------------+------------+ | :ref:`bool` | :ref:`has_deployment` | ``false`` | +-------------------------------------------------+-------------------------------------------------------------------+------------+ | :ref:`JamThreadHelper` | :ref:`thread_helper` | | +-------------------------------------------------+-------------------------------------------------------------------+------------+ | :ref:`PackedScene` | :ref:`client_ui_scene` | | +-------------------------------------------------+-------------------------------------------------------------------+------------+ | :ref:`SceneMultiplayer` | :ref:`m` | | +-------------------------------------------------+-------------------------------------------------------------------+------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_init` **(** **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_notification` **(** :ref:`Variant` what **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_ready` **(** **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`start_up` **(** **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`start_as_dev_server` **(** **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_project_id` **(** **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_game_id` **(** **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_session_id` **(** **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_webrtc_mode` **(** **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`is_websocket_mode` **(** **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_dedicated_server` **(** **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_player_server` **(** **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`is_player` **(** **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_send_player_joined` **(** :ref:`int` pid, :ref:`String` username **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_send_player_left` **(** :ref:`int` pid, :ref:`String` username **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`_send_game_init_finalized` **(** **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`notify_players` **(** :ref:`String` msg **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`fetch_dev_localhost_key` **(** **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Variant` | :ref:`fetch_dev_localhost_cert` **(** **)** | +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Signals ------- .. _class_JamConnect_signal_log_event: .. rst-class:: classref-signal **log_event** **(** :ref:`String` msg **)** Emitted in clients whenever the server sends a notification message .. rst-class:: classref-item-separator ---- .. _class_JamConnect_signal_player_connected: .. rst-class:: classref-signal **player_connected** **(** :ref:`int` pid, :ref:`String` username **)** Emitted in the server whenever a player connects and authenticates with the server .. rst-class:: classref-item-separator ---- .. _class_JamConnect_signal_player_disconnected: .. rst-class:: classref-signal **player_disconnected** **(** :ref:`int` pid, :ref:`String` username **)** Emitted in the server whenever a player disconnects from the server .. rst-class:: classref-item-separator ---- .. _class_JamConnect_signal_server_pre_ready: .. rst-class:: classref-signal **server_pre_ready** **(** **)** Emitted in the server immediately before a "READY" notification is provided to Jam Launch - this can be used for configuring things before players join. .. rst-class:: classref-item-separator ---- .. _class_JamConnect_signal_server_post_ready: .. rst-class:: classref-signal **server_post_ready** **(** **)** Emitted in the server immediately after a "READY" notification is provided to Jam Launch .. rst-class:: classref-item-separator ---- .. _class_JamConnect_signal_server_shutting_down: .. rst-class:: classref-signal **server_shutting_down** **(** **)** Emitted in the server before shutting down - this can be used for last minute logging or Data API interactions. .. rst-class:: classref-item-separator ---- .. _class_JamConnect_signal_local_player_joining: .. rst-class:: classref-signal **local_player_joining** **(** **)** Emitted in the client when it starts trying to connect to the server .. rst-class:: classref-item-separator ---- .. _class_JamConnect_signal_local_player_joined: .. rst-class:: classref-signal **local_player_joined** **(** **)** Emitted in the client when it has been verified .. rst-class:: classref-item-separator ---- .. _class_JamConnect_signal_local_player_left: .. rst-class:: classref-signal **local_player_left** **(** **)** Emitted in the client when it has been disconnected or fails to connect .. rst-class:: classref-item-separator ---- .. _class_JamConnect_signal_player_joined: .. rst-class:: classref-signal **player_joined** **(** :ref:`int` pid, :ref:`String` username **)** Emitted in clients when a player joins .. rst-class:: classref-item-separator ---- .. _class_JamConnect_signal_player_left: .. rst-class:: classref-signal **player_left** **(** :ref:`int` pid, :ref:`String` username **)** Emitted in clients when a player leaves .. rst-class:: classref-item-separator ---- .. _class_JamConnect_signal_game_init_finalized: .. rst-class:: classref-signal **game_init_finalized** **(** **)** Emitted in clients and server when the game has finished a standard initialization step. By default, this implies that all pending players have connected as peers of the host/server .. rst-class:: classref-item-separator ---- .. _class_JamConnect_signal_gjwt_acquired: .. rst-class:: classref-signal **gjwt_acquired** **(** **)** Emitted in clients when they have acquired their Jam Launch API credentials (e.g. via embedded file, test client API, or user entry) .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_JamConnect_property_client: .. rst-class:: classref-property :ref:`JamClient` **client** A reference to the child :ref:`JamClient` node that will be instantiated when running as a client .. rst-class:: classref-item-separator ---- .. _class_JamConnect_property_server: .. rst-class:: classref-property :ref:`JamServer` **server** A reference to the child :ref:`JamServer` node that will be instantiated when running as a server .. rst-class:: classref-item-separator ---- .. _class_JamConnect_property_game_id: .. rst-class:: classref-property :ref:`String` **game_id** The Jam Launch Game ID of this game (a hyphen-separated concatenation of the project ID and release ID, e.g. "projectId-releaseId"). Usually derived from the ``deployment.cfg`` file located a directory above this file which is generated by the Jam Launch editor plugin when a deployment is pushed or loaded. If it is not present in your copy of a deployed game, you may need to navigate to the project page in the editor plugin to sync it (the sync happens automatically when the project page is loaded) .. rst-class:: classref-item-separator ---- .. _class_JamConnect_property_allow_guests: .. rst-class:: classref-property :ref:`bool` **allow_guests** = ``false`` Whether or not guests are allowed to play this release. This does not need to be enforced by the game in any way - it is mostly provided for UI awareness. .. rst-class:: classref-item-separator ---- .. _class_JamConnect_property_network_mode: .. rst-class:: classref-property :ref:`String` **network_mode** = ``"enet"`` The network mode for the client/server interaction as determined by the ``deployment.cfg`` file. \ ``"enet"`` - uses the :ref:`ENetMultiplayerPeer` for connections. This provides low-overhead UDP communication, but is not supported by web clients. \ ``"websocket"`` - uses the :ref:`WebSocketMultiplayerPeer` for connections. This enables web browser-based clients. \ ``"webrtc"`` - uses the :ref:`WebRTCMultiplayerPeer` for connections. This allows games to be run in a peer-to-peer configuration without a dedicated server. The hosting player acts as the game authority/server. .. rst-class:: classref-item-separator ---- .. _class_JamConnect_property_has_deployment: .. rst-class:: classref-property :ref:`bool` **has_deployment** = ``false`` True if a Jam Launch cloud deployment for this project is known to exist via the presence of a ``deployment.cfg`` file. When this value is false, only local testing functionality can be provided. .. rst-class:: classref-item-separator ---- .. _class_JamConnect_property_thread_helper: .. rst-class:: classref-property :ref:`JamThreadHelper` **thread_helper** A :ref:`JamThreadHelper` instance for assisting with threading .. rst-class:: classref-item-separator ---- .. _class_JamConnect_property_client_ui_scene: .. rst-class:: classref-property :ref:`PackedScene` **client_ui_scene** .. container:: contribute There is currently no description for this property. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_JamConnect_property_m: .. rst-class:: classref-property :ref:`SceneMultiplayer` **m** Convenience reference to the MultiplayerAPI for full SceneMultiplayer API auto-completion .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_JamConnect_private_method__init: .. rst-class:: classref-method void **_init** **(** **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_JamConnect_private_method__notification: .. rst-class:: classref-method void **_notification** **(** :ref:`Variant` what **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_JamConnect_private_method__ready: .. rst-class:: classref-method void **_ready** **(** **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_JamConnect_method_start_up: .. rst-class:: classref-method void **start_up** **(** **)** Start the JamConnect functionality including client/server determination and multiplayer peer creation and configuration. .. rst-class:: classref-item-separator ---- .. _class_JamConnect_method_start_as_dev_server: .. rst-class:: classref-method void **start_as_dev_server** **(** **)** Converts this JamConnect node from being configured as a client to being being configured as a server in "dev" mode. Used for simplified local hosting in debug instances launched from the Godot editor. .. rst-class:: classref-item-separator ---- .. _class_JamConnect_method_get_project_id: .. rst-class:: classref-method :ref:`String` **get_project_id** **(** **)** Gets the project ID (the game ID without the release string) .. rst-class:: classref-item-separator ---- .. _class_JamConnect_method_get_game_id: .. rst-class:: classref-method :ref:`String` **get_game_id** **(** **)** Gets the game ID (a.k.a. release ID - the project ID concatenated with the release string .. rst-class:: classref-item-separator ---- .. _class_JamConnect_method_get_session_id: .. rst-class:: classref-method :ref:`String` **get_session_id** **(** **)** Gets the session ID .. rst-class:: classref-item-separator ---- .. _class_JamConnect_method_is_webrtc_mode: .. rst-class:: classref-method :ref:`bool` **is_webrtc_mode** **(** **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_JamConnect_method_is_websocket_mode: .. rst-class:: classref-method :ref:`Variant` **is_websocket_mode** **(** **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_JamConnect_method_is_dedicated_server: .. rst-class:: classref-method :ref:`bool` **is_dedicated_server** **(** **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_JamConnect_method_is_player_server: .. rst-class:: classref-method :ref:`bool` **is_player_server** **(** **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_JamConnect_method_is_player: .. rst-class:: classref-method :ref:`bool` **is_player** **(** **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_JamConnect_private_method__send_player_joined: .. rst-class:: classref-method void **_send_player_joined** **(** :ref:`int` pid, :ref:`String` username **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_JamConnect_private_method__send_player_left: .. rst-class:: classref-method void **_send_player_left** **(** :ref:`int` pid, :ref:`String` username **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_JamConnect_private_method__send_game_init_finalized: .. rst-class:: classref-method void **_send_game_init_finalized** **(** **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_JamConnect_method_notify_players: .. rst-class:: classref-method void **notify_players** **(** :ref:`String` msg **)** A server-callable RPC method for broadcasting informational server messages to clients .. rst-class:: classref-item-separator ---- .. _class_JamConnect_method_fetch_dev_localhost_key: .. rst-class:: classref-method :ref:`Variant` **fetch_dev_localhost_key** **(** **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_JamConnect_method_fetch_dev_localhost_cert: .. rst-class:: classref-method :ref:`Variant` **fetch_dev_localhost_cert** **(** **)** .. container:: contribute There is currently no description for this method. Please help us by :ref:`contributing one `! .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |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.)`