JamConnect
A Node that simplifies integration with the Jam Launch API.
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 player_connected and 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 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 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.
Properties
|
||
|
||
|
||
Methods
void |
_init ( ) |
void |
_notification ( Variant what ) |
void |
_ready ( ) |
void |
start_up ( ) |
void |
|
get_project_id ( ) |
|
get_game_id ( ) |
|
get_session_id ( ) |
|
is_webrtc_mode ( ) |
|
is_player_server ( ) |
|
is_player ( ) |
|
void |
_send_player_joined ( int pid, String username ) |
void |
_send_player_left ( int pid, String username ) |
void |
|
void |
notify_players ( String msg ) |
Signals
log_event ( String msg )
Emitted in clients whenever the server sends a notification message
player_connected ( int pid, String username )
Emitted in the server whenever a player connects and authenticates with the server
player_disconnected ( int pid, String username )
Emitted in the server whenever a player disconnects from the server
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.
server_post_ready ( )
Emitted in the server immediately after a “READY” notification is provided to Jam Launch
server_shutting_down ( )
Emitted in the server before shutting down - this can be used for last minute logging or Data API interactions.
local_player_joining ( )
Emitted in the client when it starts trying to connect to the server
local_player_joined ( )
Emitted in the client when it has been verified
local_player_left ( )
Emitted in the client when it has been disconnected or fails to connect
player_joined ( int pid, String username )
Emitted in clients when a player joins
player_left ( int pid, String username )
Emitted in clients when a player leaves
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
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)
Property Descriptions
JamClient client
A reference to the child JamClient node that will be instantiated when running as a client
JamServer server
A reference to the child JamServer node that will be instantiated when running as a server
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)
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.
String network_mode = "enet"
The network mode for the client/server interaction as determined by the deployment.cfg
file.
"enet"
- uses the ENetMultiplayerPeer for connections. This provides low-overhead UDP communication, but is not supported by web clients.
"websocket"
- uses the WebSocketMultiplayerPeer for connections. This enables web browser-based clients.
"webrtc"
- uses the 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.
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.
JamThreadHelper thread_helper
A JamThreadHelper instance for assisting with threading
PackedScene client_ui_scene
There is currently no description for this property. Please help us by contributing one!
Convenience reference to the MultiplayerAPI for full SceneMultiplayer API auto-completion
Method Descriptions
void _init ( )
There is currently no description for this method. Please help us by contributing one!
void _notification ( Variant what )
There is currently no description for this method. Please help us by contributing one!
void _ready ( )
There is currently no description for this method. Please help us by contributing one!
void start_up ( )
Start the JamConnect functionality including client/server determination and multiplayer peer creation and configuration.
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.
String get_project_id ( )
Gets the project ID (the game ID without the release string)
String get_game_id ( )
Gets the game ID (a.k.a. release ID - the project ID concatenated with the release string
String get_session_id ( )
Gets the session ID
bool is_webrtc_mode ( )
There is currently no description for this method. Please help us by contributing one!
Variant is_websocket_mode ( )
There is currently no description for this method. Please help us by contributing one!
bool is_dedicated_server ( )
There is currently no description for this method. Please help us by contributing one!
bool is_player_server ( )
There is currently no description for this method. Please help us by contributing one!
bool is_player ( )
There is currently no description for this method. Please help us by contributing one!
void _send_player_joined ( int pid, String username )
There is currently no description for this method. Please help us by contributing one!
void _send_player_left ( int pid, String username )
There is currently no description for this method. Please help us by contributing one!
void _send_game_init_finalized ( )
There is currently no description for this method. Please help us by contributing one!
void notify_players ( String msg )
A server-callable RPC method for broadcasting informational server messages to clients
Variant fetch_dev_localhost_key ( )
There is currently no description for this method. Please help us by contributing one!
Variant fetch_dev_localhost_cert ( )
There is currently no description for this method. Please help us by contributing one!