### Method: start_online_join Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Starts the online game mode, configuring the current instance as a client to join an existing host. ```APIDOC start_online_join(url: String, handshake_data: Dictionary, credentials_data: Dictionary) Description: Start online mode as client ``` -------------------------------- ### Using 'details' Shortcode in Go Template Source: https://github.com/maji-git/mpc-docs/blob/master/templates/shortcodes/details.md Demonstrates various syntaxes for using the `details` shortcode to create expandable HTML content. Examples include positional arguments, named arguments, and the `open` attribute for initial visibility. ```tpl {{}} ## Markdown content Lorem markdownum insigne... {{}} ``` ```tpl {{}} ## Markdown content Lorem markdownum insigne... {{}} ``` ```tpl {{< details "Title" open >}} ## Markdown content Lorem markdownum insigne... {{< /details >}} ``` -------------------------------- ### Method: start_online_host Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Starts the online game mode, configuring the current instance as the host. It can optionally act as a client simultaneously. ```APIDOC start_online_host(act_client: bool, act_client_handshake_data: Dictionary, act_client_credentials_data: Dictionary) Description: Start online mode as host ``` -------------------------------- ### MultiPlayCore Method: start_online_host Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Starts the online multiplayer session as a host. It includes options for acting as a client, providing handshake data, and credentials for authentication. ```APIDOC start_online_host( act_client: bool, act_client_handshake_data: Dictionary, act_client_credentials_data: Dictionary ) ``` -------------------------------- ### Start Online Host (GDScript) Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/start/mode-system/online/_index.md Initiates the online mode, allowing the instance to act as a server. It can be configured to be a server-only instance or a server that also acts as a client. ```gd mpc.start_online_host(false, handshake_data) ``` ```gd mpc.start_online_host(true, handshake_data) ``` -------------------------------- ### Starting Solo Mode in GDScript Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/start/mode-system/solo/_index.md This function initiates the solo game mode, allowing a single player node to participate. ```GDScript mpc.start_solo() ``` -------------------------------- ### Property: started Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md A boolean flag indicating whether the MultiPlay system has been initialized and started. This can be used to check the operational status. ```APIDOC started: Type: bool Default: false Description: Determines if MultiPlay has started ``` -------------------------------- ### MultiPlayCore Method: start_solo Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Starts the game in solo player mode, where only one player is active. ```APIDOC start_solo() ``` -------------------------------- ### API Method: host Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/ENetProtocol.md Initializes and starts the ENet host, binding to a specified port and IP, and setting a maximum player limit. ```APIDOC Method: host Return Type: MultiplayerPeer Parameters: port: Variant bind_ip: Variant max_players: Variant Description: Host function ``` -------------------------------- ### Starting One-Screen Local Multiplayer (GodotScript) Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/start/mode-system/one-screen/_index.md This function initiates the one-screen local multiplayer mode. It is crucial to set the `mpc.max_players` variable beforehand, as this determines the number of players that will be created upon starting the mode. ```gd mpc.start_one_screen() ``` -------------------------------- ### Starting Solo Swap Mode Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/start/mode-system/swap/_index.md Initiates the Solo Swap Mode. The number of players created upon starting this mode is determined by the `mpc.max_players` variable. It is important to set `mpc.max_players` to your desired player count before calling this function. ```GDScript mpc.start_swap() ``` -------------------------------- ### Dynamic Hugo Front Matter Configuration Source: https://github.com/maji-git/mpc-docs/blob/master/archetypes/default.md This snippet defines the front matter for a Hugo content page. It uses the `replace` and `title` Go template functions to format the file's base name into a human-readable title. The `date` field is automatically populated with the current date, and `draft` is set to `true`. ```Hugo Template +++ title = '{{ replace .File.ContentBaseName "-" " " | title }}' date = {{ .Date }} draft = true +++ ``` -------------------------------- ### Embed LaTeX Math in Markdown using KaTeX Shortcode Source: https://github.com/maji-git/mpc-docs/blob/master/templates/shortcodes/katex.md Illustrates the use of the KaTeX shortcode within a Markdown document to render a mathematical equation in display mode. The example shows an integral expression, utilizing `display=true` for block-level rendering and `class="optional"` for additional styling. ```latex {{}}\nf(x) = \int_{-\infty}^\infty\hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi\n{{< /katex */>}} ``` -------------------------------- ### Host MultiPlay Core Server via CLI Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/manual/cli/_index.md Demonstrates how to launch a MultiPlay Core server using command-line arguments, specifying the server flag and a custom port for hosting. ```sh mpc_build.exe --server --port=6942 ``` -------------------------------- ### Accessing MultiPlay Core with MPIO (GDScript) Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/manual/mpio/_index.md Demonstrates how to access the main MultiPlay Core instance using the global MPIO singleton. ```GDScript MPIO.mpc ``` -------------------------------- ### Method: start_solo Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Initiates the solo player mode, where the game runs for a single player without multiplayer functionalities. ```APIDOC start_solo() Description: Start solo mode ``` -------------------------------- ### MultiPlayCore Method: start_swap Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Initiates the swap mode, allowing a single player to switch control between different peers. ```APIDOC start_swap() ``` -------------------------------- ### MultiPlayCore Method: start_online_join Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Connects to an existing online multiplayer session as a client. It requires the server URL, handshake data, and credentials for joining. ```APIDOC start_online_join( url: String, handshake_data: Dictionary, credentials_data: Dictionary ) ``` -------------------------------- ### WebSocketNetProtocol API Reference Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/WebSocketNetProtocol.md Detailed API documentation for the `WebSocketNetProtocol` class, including its inheritance, properties for secure communication, and methods for hosting and joining multiplayer sessions. ```APIDOC WebSocketNetProtocol Inherits: MPNetProtocolBase Description: Websocket Network Protocol Properties: secure: bool Default: none Description: Specify if you needs encryption in your web socket server_private_key: CryptoKey Default: none Description: Secure Private key for server ssl_certificate: X509Certificate Default: none Description: Trusted SSL certificate for server & client Methods: host(port: Variant, bind_ip: Variant, max_players: Variant) -> MultiplayerPeer join(address: Variant, port: Variant) -> MultiplayerPeer ``` -------------------------------- ### MultiPlay Core CLI Arguments Reference Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/manual/cli/_index.md Reference for all available command-line arguments in MultiPlay Core, including their purpose and usage for server hosting and client connections. ```APIDOC CLI Arguments: --server: Host a server --port=: Port to host server on --act-client: Should server also act as a client? --client: Connect as client --url=: Specify client connect URL ``` -------------------------------- ### Method: start_one_screen Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Initiates the one-screen multiplayer mode, where all players share a single display. ```APIDOC start_one_screen() Description: Start one screen mode ``` -------------------------------- ### API Method: join Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/ENetProtocol.md Connects to an existing ENet host at the specified address and port. ```APIDOC Method: join Return Type: MultiplayerPeer Parameters: address: Variant port: Variant Description: There's currently no description for this method. ``` -------------------------------- ### API Reference for MPSyncBase Class Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPSyncBase.md Detailed API documentation for the MPSyncBase class, outlining its inheritance from MPBase, its properties, and its methods for checking local status, receive/send permissions, and synchronization behavior. ```APIDOC Class: MPSyncBase Inherits: MPBase Description: Base class of Network Synchronizers Properties: (None) Methods: check_is_local(): Returns: Variant Description: If this node is local to current multiplayer peer check_recv_permission(): Returns: Variant Description: Check receive permission check_send_permission(): Returns: Variant Description: Check network send permission should_sync(): Returns: Variant Description: There's currently no description for this method. ``` -------------------------------- ### MultiPlayCore Method: start_one_screen Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Initiates the one-screen multiplayer mode, allowing multiple players to play on a single device. ```APIDOC start_one_screen() ``` -------------------------------- ### API Documentation for MPNetProtocolBase Class Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPNetProtocolBase.md Detailed API reference for the MPNetProtocolBase class, including its inheritance from MPExtension, its properties like 'net_protocols', and its core methods 'host' and 'join' for network operations. ```APIDOC Class: MPNetProtocolBase Inherits: MPExtension Description: Base Class for all network protocols Properties: net_protocols: Type: Variant Default: Description: There's currently no description for this property. Methods: host: Returns Type: MultiplayerPeer Syntax: host ( Variant port, Variant bind_ip, Variant max_players ) Description: Host function join: Returns Type: MultiplayerPeer Syntax: join ( Variant address, Variant port ) Description: There's currently no description for this method. ``` -------------------------------- ### Basic Usage of Hint Shortcode in Templating Language Source: https://github.com/maji-git/mpc-docs/blob/master/templates/shortcodes/hints.md This snippet illustrates the fundamental syntax for embedding a 'hint' shortcode within a templating language. It shows how to specify the hint type (info, warning, or danger) and include rich Markdown content inside the block. ```tpl {{}} **Markdown content** Lorem markdownum insigne. Olympo signis Delphis! Retexi Nereius nova develat stringit, frustra Saturnius uteroque inter! Oculis non ritibus Telethusa {{}} ``` -------------------------------- ### MPStartTransform2D Class API Reference Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPStartTransform2D.md Detailed API documentation for the MPStartTransform2D class, including its inheritance from Node2D, properties, and methods. ```APIDOC Class: MPStartTransform2D Inherits: Node2D Description: Start Transform of 2D. NOT READY TO BE USED. Properties: (No properties listed) Methods: (No methods listed) ``` -------------------------------- ### Join an Online Server (GDScript) Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/start/mode-system/online/_index.md Connects the current instance as a client to an existing online server. Requires the server's address and can include optional handshake and credentials data for authentication. ```gd mpc.start_online_join(join_address, handshake_data, credentials_data) ``` -------------------------------- ### Method: start_swap Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Activates the swap mode, allowing control to be transferred between different player entities or characters. ```APIDOC start_swap() Description: Start swap mode ``` -------------------------------- ### Basic Columns Shortcode Usage Source: https://github.com/maji-git/mpc-docs/blob/master/templates/shortcodes/columns.md Demonstrates the basic syntax for using the `columns` shortcode in HTML to create multiple content columns. Content for each column is placed between the `{{}}` and `{{}}` tags, with `<--->` serving as a magic separator between columns. ```html {{}} # Left Content Lorem markdownum insigne... <---> # Mid Content Lorem markdownum insigne... <---> # Right Content Lorem markdownum insigne... {{}} ``` -------------------------------- ### Online Mode Connection URL Syntax Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/start/mode-system/online/_index.md Defines the required syntax for connecting to an online mode server, specifying hostname, optional port, and optional path. The protocol is automatically assigned. ```TEXT :/ ``` -------------------------------- ### API Documentation for MPAnimationSync Class Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPAnimationSync.md Comprehensive API reference for the MPAnimationSync class, detailing its inheritance from MPSyncBase and listing its properties and methods. ```APIDOC MPAnimationSync Inherits: MPSyncBase Description: Network Animation Synchronizer Properties: (No properties listed) Methods: (No methods listed) ``` -------------------------------- ### MultiPlayCore Method: create_player Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Creates a new player instance within the MultiPlayCore system. It requires a unique player identifier and handshake data for initialization. ```APIDOC create_player( player_id: Variant, handshake_data: Variant ) ``` -------------------------------- ### MultiPlayCore Method: swap_input_action Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Describes an input action related to swapping. Further details on its parameters and return type are not explicitly provided in this snippet. ```APIDOC swap_input_action ``` -------------------------------- ### MultiplayerPeer join Method Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/WebSocketNetProtocol.md There's currently no description for this method. ```APIDOC MultiplayerPeer join(address: Variant, port: Variant) address: Variant port: Variant ``` -------------------------------- ### MultiPlay System Properties Reference Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Detailed API documentation for configuration and state properties within the MultiPlay system, including network settings, scene management, debug options, and player-related information. Each property lists its type, default value, and a brief explanation of its purpose. ```APIDOC assign_client_authority: bool Default: true Description: Should Client authority be assigned automatically? bind_address: String Default: "*" Description: Which ip to bind on in online game host. connect_timeout_ms: int Default: 50000 Description: Time in milliseconds before timing out the user. current_scene: Node Default: null Description: Current scene node current_swap_index: int Default: 0 Description: Current swap index, Swap mode only. debug_gui_enabled: bool Default: true Description: Enable Debug UI debug_status_txt: Variant Default: "" Description: Debug Status first_scene: PackedScene Default: none Description: The first scene to load is_server: bool Default: false Description: Determines if MultiPlay is running as server local_player: MPPlayer Default: null Description: The local player node max_players: int Default: 2 Description: Max players for the game. mode: int Default: 0 Description: Current playmode online_connected: bool Default: false Description: If connected in online mode online_peer: MultiplayerPeer Default: null Description: MultiplayerPeer for the game player_count: int ``` -------------------------------- ### API Documentation for MPBase Class Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPBase.md Detailed API reference for the `MPBase` class, outlining its inheritance from `Node`, and sections for properties and methods. This class serves as the base for all MultiPlay Nodes. ```APIDOC Class: MPBase Inherits: Node Description: Base for MultiPlay Nodes Properties: (No properties defined) Methods: (No methods defined) ``` -------------------------------- ### MultiPlayIO Class API Reference Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayIO.md Detailed API documentation for the MultiPlayIO class, an Input/Output Singleton that inherits from MPBase. It provides access to the MultiPlay Core and player ID, along with methods for logging various types of messages. ```APIDOC MultiPlayIO Class Inherits: MPBase Description: Input/Output Singleton for MultiPlay Properties: mpc: Type: MultiPlayCore Default: null Description: Main MultiPlay Core plr_id: Type: int Default: 0 Description: There's currently no description for this property. Methods: logdata(): Returns: None Description: Log data to the output console logerr(): Returns: None Description: Log errpr to the output console logwarn(): Returns: None Description: Log warning to the output console ``` -------------------------------- ### MultiPlayCore Class API Reference Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/manual/basics/_index.md Comprehensive API documentation for the MultiPlayCore class, providing core functionalities for managing players, scenes, and game states in MultiPlay Core. This class is commonly aliased as `mpc`. ```APIDOC MultiPlayCore (mpc): Class for everything MultiPlay Core, comes with handy API to use! Properties: local_player: Get the local player. player_count: Get current player count. Functions: load_scene(scene_path, respawn_players): This function will load the scene for all players. Parameters: scene_path: Path to the scene. respawn_players: boolean. Set to false if you want to handle despawn/spawning the players yourself. swap_increment(): Swap player node incrementally. (Swap mode only) swap_to(index): Specify swap index. (Swap mode only) Parameters: index: The swap index to change to. Signals: player_connected(player: MPPlayer): On player connected to the server. Emits to everyone. player_disconnected(player: MPPlayer): On player disconnected from the server. Emits to everyone. connected_to_server(localplayer: MPPlayer): On player connected to the server. Only emit locally. disconnected_from_server(reason: String): On player disconnected from the server. Only emit locally. connection_error(reason: ConnectionError): Emit when the client faced connection error. swap_changed(to_index: int, old_index: int): Emit when swap index has changed. Only emit in Swap Play mode. ``` -------------------------------- ### MultiplayerPeer host Method Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/WebSocketNetProtocol.md Host function ```APIDOC MultiplayerPeer host(port: Variant, bind_ip: Variant, max_players: Variant) port: Variant bind_ip: Variant max_players: Variant ``` -------------------------------- ### MPAuth Class API Reference Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPAuth.md Comprehensive API documentation for the `MPAuth` class, detailing its inheritance from `MPExtension`, its `authenticate_function` property, and the `authenticate` method used for player credential verification. ```APIDOC MPAuth: Inherits: MPExtension Description: Middleware to check player's credentials before connecting. Properties: authenticate_function: Type: Callable Default: none Description: Authenticate function, this must be set. Callable will be called will the following args: Methods: authenticate(plr_id: Variant, credentials_data: Variant, handshake_data: Variant): Returns: Variant Description: There's currently no description for this method. ``` -------------------------------- ### Property: player_node_ready Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Indicates whether the player node is ready for use. This boolean flag can be used to check the state of player initialization. ```APIDOC player_node_ready: Type: bool Default: false Description: If player node is ready ``` -------------------------------- ### MultiPlayCore Method: swap_to Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Switches control to a specific peer or state in swap mode. Further details on parameters are not provided. ```APIDOC swap_to() ``` -------------------------------- ### MPPlayer Class API Reference Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/manual/basics/_index.md Detailed API documentation for the MPPlayer class, responsible for managing individual player nodes and their inputs. This class is commonly aliased as `mpp`. ```APIDOC MPPlayer (mpp): The MultiPlay player class. Manages input for your player node. Properties: mpc: Get the player's main MultiPlayCore Node. Functions: ma(action_name): Use the input system. For more information, see Input System. Parameters: action_name: The name of the input action. disconnect_player(): Disconnect the player from the server. Local Only. kick(reason): Kick the player from the server. Server Only. Parameters: reason: Optional. The reason for kicking the player. respawn_node(): Respawn your player node using this function. Server Only. Note: There's also spawn_node and despawn_node to use! These are self-explanatory. Signals: player_ready: On player ready. Only emit locally. handshake_ready: On handshake & authentication data is ready. Emit to all players. swap_focused: On swap focused. Swap mode only. swap_unfocused: On swap unfocused. Swap mode only. ``` ```GDScript @onready var mpp: MPPlayer = get_parent() ``` -------------------------------- ### MultiPlayCore Method: load_scene Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Loads a specified game scene. It takes the scene's file path and an option to respawn players upon loading. ```APIDOC load_scene( scene_path: String, respawn_players: Variant ) ``` -------------------------------- ### Define Content Tabs for Multiple Platforms Source: https://github.com/maji-git/mpc-docs/blob/master/templates/shortcodes/tabs.md This template code demonstrates how to define a set of tabs using the `tabs` shortcode, with each `tab` shortcode representing a different platform (MacOS, Linux, Windows) to organize platform-specific content. The `uniqueid` ensures proper tab functionality. ```Hugo Template {{}} {{}} # MacOS Content {{}} {{}} # Linux Content {{}} {{}} # Windows Content {{}} {{}} ``` -------------------------------- ### API Property: is_ready Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPPlayer.md A boolean flag that signifies if the player's network state is ready for interaction. This property helps in synchronizing game states and actions. ```APIDOC Property: is_ready Type: bool Default: false Description: Determines if this player network is ready ``` -------------------------------- ### Implement Custom Network Protocol Template in GDScript Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/manual/net-protocols/custom/_index.md This GDScript template demonstrates how to implement a custom network protocol for MultiPlay Core. It extends `MPNetProtocolBase` and includes placeholder functions for `host` and `join` operations, both of which are expected to return a `MultiplayerPeer` instance. ```GDScript @tool extends MPNetProtocolBase ## Host function func host(port, bind_ip, max_players) -> MultiplayerPeer: # your logic pass func join(address, port) -> MultiplayerPeer: # your logic pass ``` -------------------------------- ### Method: swap_to Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Transfers control to a specific player identified by an index, exclusively for use within swap mode. ```APIDOC swap_to() Description: Specifically Swap to index. Swap mode only ``` -------------------------------- ### Core Layout Styling for MultiPlay Documentation Source: https://github.com/maji-git/mpc-docs/blob/master/layouts/index.html This CSS snippet defines the foundational visual layout for the MultiPlay Core documentation pages. It centers content, manages spacing for buttons, removes default heading margins, and adds subtle bullet separators between navigation links. ```CSS .main { display: flex; justify-content: center; align-items: center; flex-direction: column; height: 100vh; } .book-btn { margin-bottom: 1rem; } h1 { margin: 0; } .more-links { opacity: 0.7; } .more-links a::before { content: "•"; opacity: 0.5; margin-left: 6px; margin-right: 6px; } .more-links a:nth-child(1)::before { content: ""; } ``` -------------------------------- ### MPAnimTreeSync API Reference Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPAnimTreeSync.md Detailed API documentation for the `MPAnimTreeSync` class, including its inheritance, properties, and methods. This class is designed for synchronizing animation trees over a network. ```APIDOC Class: MPAnimTreeSync Inherits: MPSyncBase Description: Network Animation Tree Synchronizer Properties: property_list: Type: Variant Default: Description: No description provided. Methods: (No methods listed) ``` -------------------------------- ### Create Buttons in Hugo Template Language Source: https://github.com/maji-git/mpc-docs/blob/master/templates/shortcodes/buttons.md Demonstrates how to create styled buttons using Hugo's `button` shortcode. Buttons can link to internal pages using `relref` for local paths or `href` for external URLs. An optional `class` attribute allows for custom styling. ```tpl {{}}Get Home{{}} {{}}Contribute{{}} ``` -------------------------------- ### Method: load_scene Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Loads a specified scene for all connected players, facilitating synchronized scene transitions in multiplayer games. ```APIDOC load_scene(scene_path: String, respawn_players: Variant) Description: Load scene for all players ``` -------------------------------- ### Template Shortcode for Section Rendering with Optional Summary Source: https://github.com/maji-git/mpc-docs/blob/master/templates/shortcodes/section/_index.md This template snippet demonstrates the basic syntax for using the `section` shortcode. The `[summary]` parameter is optional and controls whether the page summary is displayed when rendering sections. ```tpl {{}} ``` -------------------------------- ### ENetProtocol Class API Reference Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/ENetProtocol.md This section provides a comprehensive API reference for the ENetProtocol class, a Websocket Network Protocol. It outlines the class's inheritance from MPNetProtocolBase, its configurable properties, and its methods for managing network connections. ```APIDOC ENetProtocol: Inherits: MPNetProtocolBase Description: Websocket Network Protocol Properties: bandwidth_in_limit: int = 0 bandwidth_out_limit: int = 0 compression_mode: int = 3 role: Variant = "" secure: bool server_private_key: CryptoKey ssl_certificate: X509Certificate Methods: host(port: Variant, bind_ip: Variant, max_players: Variant): Returns: MultiplayerPeer join(address: Variant, port: Variant): Returns: MultiplayerPeer ``` -------------------------------- ### MPPlayersCollection Class API Reference Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/manual/basics/_index.md API documentation for the MPPlayersCollection class, which provides methods to access and manage all connected MPPlayer nodes. This collection is accessible via `mpc.players`. ```APIDOC MPPlayersCollection: Collection of all MPPlayer nodes. Getting the collection: Property: mpc.players Description: You can get the MPPlayersCollection player collection from ``` -------------------------------- ### API Property: role Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/ENetProtocol.md This property's description is currently unavailable. ```APIDOC Property: role Type: Variant Default: "" Description: There's currently no description for this property. ``` -------------------------------- ### MPPlayer Class API Reference Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPPlayer.md Detailed API reference for the MPPlayer class, outlining its inheritance from MPBase, its various properties for managing player state and data, and its methods for player lifecycle management within a MultiPlay environment. ```APIDOC MPPlayer Class Inherits: MPBase Description: MultiPlay Player Node Properties: auth_data: Variant (Default: ) handshake_data: Variant (Default: ) is_local: bool (Default: false) is_ready: bool (Default: false) is_swap_focused: bool (Default: false) mpc: MultiPlayCore ping_ms: int player_id: int (Default: 0) player_index: int (Default: 0) player_node: Node player_node_resource_path: String (Default: "") Methods: despawn_node() disconnect_player() kick() ma(): Variant respawn_node() spawn_node() translate_action(): StringName ``` -------------------------------- ### MPExtension Class API Reference Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPExtension.md Comprehensive API documentation for the MPExtension class. This class serves as a base for MultiPlay Extensions and inherits functionality from MPBase. It details the available properties and methods for interacting with MPExtension instances. ```APIDOC MPExtension: Inherits: MPBase Description: Base for MultiPlay Extensions Properties: mpc: Type: MultiPlayCore Default: none Description: Main MultiPlayCore node Methods: No methods defined. ``` -------------------------------- ### MPAnimationSync Component API Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/manual/synchronizers/anim-sync/_index.md Provides an API-like description for the MPAnimationSync component, detailing its purpose and how to integrate it within a Godot project to synchronize animation states from an AnimationPlayer across a network. ```APIDOC Component: MPAnimationSync Purpose: Syncs animation from Godot's `AnimationPlayer` class. Usage: Parent to an `AnimationPlayer` node. Behavior: Automatically syncs animation state across the network. ``` -------------------------------- ### Property: swap_input_action Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Specifies the input action key used to trigger the swap mode functionality. This allows players to switch control between entities. ```APIDOC swap_input_action: Type: String Default: none Description: Which action key to use for swap mode. ``` -------------------------------- ### Method: create_player Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Creates a new player node within the game, typically used to instantiate player characters or entities. ```APIDOC create_player(player_id: Variant, handshake_data: Variant) Description: Create player node ``` -------------------------------- ### Godot Synchronization Methods Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPTransformSync.md Provides methods for setting the position, rotation, and scale of 2D and 3D nodes. These methods are designed for server-side use to directly manipulate node transformations. ```APIDOC Method: set_position_2d() Description: Set position of the 2D node, Server only. ``` ```APIDOC Method: set_position_3d() Description: Set position of the 3D node, Server only. ``` ```APIDOC Method: set_rotation_2d() Description: Set rotation of the 2D node, Server only. ``` ```APIDOC Method: set_rotation_3d() Description: Set rotation of the 3D node, Server only. ``` ```APIDOC Method: set_scale_2d() Description: Set scale of the 2D node, Server only. ``` ```APIDOC Method: set_scale_3d() Description: Set scale of the 3D node, Server only. ``` -------------------------------- ### API Property: bandwidth_in_limit Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/ENetProtocol.md Defines the incoming bandwidth limit for the ENet host. ```APIDOC Property: bandwidth_in_limit Type: int Default: 0 Description: Bandwidth In Limit ``` -------------------------------- ### Godot Synchronization Properties Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPTransformSync.md Defines various properties used for configuring synchronization behavior, including lerp settings and sensitivity for position, rotation, and scale. These properties determine how objects are synchronized across the network. ```APIDOC Property: lerp_enabled Type: bool Default: true Description: Enable lerp for sync? ``` ```APIDOC Property: lerp_speed Type: int Default: 20 Description: Determines lerp speed ``` ```APIDOC Property: position_sensitivity Type: float Default: 0.01 Description: Determines the sync sensitivity of position ``` ```APIDOC Property: rotation_sensitivity Type: float Default: 0.01 Description: Determines the sync sensitivity of rotation ``` ```APIDOC Property: scale_sensitivity Type: float Default: 0.01 Description: Determines the sync sensitivity of scale ``` ```APIDOC Property: sync_position Type: bool Default: true Description: Determines if position will be sync ``` ```APIDOC Property: sync_rotation Type: bool Default: true Description: Determines if rotation will be sync ``` ```APIDOC Property: sync_scale Type: bool Default: false Description: Determines if scale will be sync ``` -------------------------------- ### MPTransformSync Class API Reference Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPTransformSync.md Detailed API documentation for the MPTransformSync class, which functions as a network transform synchronizer. It inherits from MPSyncBase and provides properties to control interpolation, sensitivity, and which transform components (position, rotation, scale) are synchronized. It also lists methods for setting 2D and 3D transform components. ```APIDOC MPTransformSync Inherits: MPSyncBase Description: Network Transform Synchronizer Properties: lerp_enabled: Type: bool Default: true Description: Enables or disables linear interpolation for smooth transform synchronization. lerp_speed: Type: int Default: 20 Description: The speed at which interpolation occurs. position_sensitivity: Type: float Default: 0.01 Description: The minimum change in position required to trigger a synchronization update. rotation_sensitivity: Type: float Default: 0.01 Description: The minimum change in rotation required to trigger a synchronization update. scale_sensitivity: Type: float Default: 0.01 Description: The minimum change in scale required to trigger a synchronization update. sync_position: Type: bool Default: true Description: Determines if the position should be synchronized across the network. sync_rotation: Type: bool Default: true Description: Determines if the rotation should be synchronized across the network. sync_scale: Type: bool Default: false Description: Determines if the scale should be synchronized across the network. Methods: set_position_2d() Description: Sets the 2D position of the synchronized object. set_position_3d() Description: Sets the 3D position of the synchronized object. set_rotation_2d() Description: Sets the 2D rotation of the synchronized object. set_rotation_3d() Description: Sets the 3D rotation of the synchronized object. set_scale_2d() Description: Sets the 2D scale of the synchronized object. set_scale_3d() Description: Sets the 3D scale of the synchronized object. ``` -------------------------------- ### MPAnimTreeSync Component API Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/manual/synchronizers/anim-sync/_index.md Provides an API-like description for the MPAnimTreeSync component, outlining its function and integration method for synchronizing the state of a Godot AnimationTree across a multiplayer network. ```APIDOC Component: MPAnimTreeSync Purpose: Syncs the state of Godot's `AnimationTree`. Usage: Parent to an `AnimationTree` node. Behavior: Automatically syncs animation tree state across the network. ``` -------------------------------- ### MultiPlayCore Class Properties Reference Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Defines the configurable properties of the MultiPlayCore class, which are essential for setting up and controlling multiplayer game sessions. Properties cover aspects like client authority assignment, network binding, connection timeouts, scene management, player tracking, and debugging options. ```APIDOC MultiPlayCore: Properties: assign_client_authority: bool = true bind_address: String = "*" connect_timeout_ms: int = 50000 current_scene: Node = null current_swap_index: int = 0 debug_gui_enabled: bool = true debug_status_txt: Variant = "" first_scene: PackedScene is_server: bool = false local_player: MPPlayer = null max_players: int = 2 mode: int = 0 online_connected: bool = false online_peer: MultiplayerPeer = null player_count: int = 0 player_node_ready: bool = false player_scene: PackedScene players: MPPlayersCollection port: int = 4200 started: bool = false ``` -------------------------------- ### API Property: mpc Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPPlayer.md Provides access to the MultiPlayCore instance. This property is the primary entry point for interacting with the core multiplayer functionalities. ```APIDOC Property: mpc Type: MultiPlayCore Default: none Description: Get MultiPlayCore ``` -------------------------------- ### API Reference: MPPlayersCollection Class Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPPlayersCollection.md Detailed API documentation for the `MPPlayersCollection` class, inheriting from `MPBase`. This class manages a collection of player objects, providing methods to access, spawn, and despawn player nodes. ```APIDOC MPPlayersCollection Class Inherits: MPBase Description: Collection of players Properties: players: Dictionary Description: Dictionary containing [MPPlayer] Default: Methods: despawn_node_all(): void Description: Despawn all player's node get_player_by_id(): MPPlayer Description: Get player by ID get_player_by_index(): MPPlayer Description: Get player by index get_players(): Dictionary Description: Get all players respawn_node_all(): void Description: Respawn all player's node spawn_node_all(): void Description: Spawn all player's node ``` -------------------------------- ### API Property: ssl_certificate Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/ENetProtocol.md Provides the trusted SSL certificate for both server and client connections. ```APIDOC Property: ssl_certificate Type: X509Certificate Default: none Description: Trusted SSL certificate for server & client ``` -------------------------------- ### Player Ready Signal Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPPlayer.md This signal is emitted locally when a player is ready. ```APIDOC player_ready ( ) On player ready. Only emit locally ``` -------------------------------- ### Method: swap_increment Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Swaps control to the next player in sequence, specifically for use within swap mode. ```APIDOC swap_increment() Description: Swap control to player according to index. Swap mode only ``` -------------------------------- ### Implement MultiPlay Authenticator Logic in GDScript Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/manual/components/auth/_index.md This GDScript snippet demonstrates how to set up the `_auth_check` function within a MultiPlay Authenticator script. It shows how to assign the custom authentication function to the `auth.authenticate_function` property and how to process player ID, credentials, and handshake data. The function should return a dictionary upon successful authentication or `false` if authentication fails. ```gd extends Node @export var auth: MPAuth func _ready(): auth.authenticate_function = _auth_check func _auth_check(plr_id: int, credentials_data: Dictionary, handshake_data: Dictionary): # Return authentication data, otherwise if failed, return false. return {} ``` -------------------------------- ### API Property: server_private_key Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/ENetProtocol.md Provides the secure private key used by the server for encrypted communications. ```APIDOC Property: server_private_key Type: CryptoKey Default: none Description: Secure Private key for server ``` -------------------------------- ### API Signal: scene_loaded Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Emitted when a network scene has finished loading. This signal can be used to synchronize game state or perform actions that depend on the scene being fully ready across the network. ```APIDOC scene_loaded() ``` -------------------------------- ### MultiPlayCore API Definition Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Defines the core MultiPlayCore API, outlining its inheritance and primary function within the MultiPlay system. ```APIDOC MultiPlayCore: Inherits: MPBase Description: Core of everything MultiPlay ``` -------------------------------- ### Embed Mermaid State Diagram using Go Template Shortcode Source: https://github.com/maji-git/mpc-docs/blob/master/templates/shortcodes/mermaid.md This snippet demonstrates how to embed a Mermaid state diagram using a Go Template shortcode. It includes the Mermaid syntax for a state diagram with notes and shows the shortcode usage. ```Go Template {{}}\nstateDiagram-v2\n State1: The state with a note\n note right of State1\n Important information! You can write\n notes.\n end note\n State1 --> State2\n note left of State2 : This is the note to the left.\n{{< /mermaid */>}} ``` ```Mermaid stateDiagram-v2\n State1: The state with a note\n note right of State1\n Important information! You can write\n notes.\n end note\n State1 --> State2\n note left of State2 : This is the note to the left. ``` -------------------------------- ### MultiPlayCore Enumeration: PlayMode Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Defines the different modes of play supported by MultiPlayCore, including online, one-screen, swap, and solo modes. ```APIDOC enum PlayMode: Online = 0 # Network enabled multiplayer OneScreen = 1 # Single screen multiplayer. User can play with multiple controllers/devices. Swap = 2 # Swap mode. Intended to be played with one player, user can switch to the peer they wanted to control. Solo = 3 # Solo, self explanatory ``` -------------------------------- ### Spawn Player Node Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPPlayer.md This method is used to spawn a player node. It is exclusively available on the server. ```APIDOC spawn_node ( ) Spawn player node, Server only. ``` -------------------------------- ### API Property: bandwidth_out_limit Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/ENetProtocol.md Defines the outgoing bandwidth limit for the ENet host. ```APIDOC Property: bandwidth_out_limit Type: int Default: 0 Description: Bandwidth Out Limit ``` -------------------------------- ### Property: port Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Defines the network port to be used when hosting an online game. This is crucial for establishing network connections. ```APIDOC port: Type: int Default: 4200 Description: Which port to use in online game host. ``` -------------------------------- ### API Property: compression_mode Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/ENetProtocol.md Sets the compression mode for the ENet host, affecting how network data is compressed. ```APIDOC Property: compression_mode Type: int Default: 3 Description: Set ENet host compression mode ``` -------------------------------- ### API Signal: player_connected Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Emitted to all players on the server when a new player successfully connects. This signal can be used to update player lists or trigger welcome messages for all participants. ```APIDOC player_connected() ``` -------------------------------- ### Translate Input Action using MPPlayer in GDScript Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/start/input-system/_index.md Demonstrates how to use MultiPlay's input system by calling `MPPlayer`'s `translate_action` or its alias `ma` function. This function takes the original Input Action name as input and returns the translated action, which can then be used with standard input checks like `Input.is_action_just_pressed`. ```GDScript Input.is_action_just_pressed(mpp.ma("jump")) ``` -------------------------------- ### Property: player_scene Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Specifies the PackedScene resource to be used as a template for creating player nodes. This allows developers to define their custom player entities. ```APIDOC player_scene: Type: PackedScene Default: none Description: Your own template player scene. ``` -------------------------------- ### Logging Data with MPIO.logdata (GDScript) Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/manual/mpio/_index.md Illustrates how to use the `MPIO.logdata` function to output messages. This function is particularly useful for debugging in online mode as it automatically includes the player ID in the log output, unlike the standard `print` function. ```GDScript MPIO.logdata("Hello World!") ``` -------------------------------- ### API Signal: connected_to_server Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Emitted locally when the client successfully establishes a connection to the server. This signal is useful for updating UI or game state specific to the local client's connection status. ```APIDOC connected_to_server() ``` -------------------------------- ### API Signal: swap_changed Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Emitted specifically in 'Swap Play' mode when the swap index changes. This signal provides the new and old indices, allowing for game logic to react to the swap state transition. ```APIDOC swap_changed(int to_index, int old_index) ``` -------------------------------- ### Short-form Action Translation (ma) Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPPlayer.md This method provides a shorter alternative to `translate_action` for input action translation, returning a `Variant` type. ```APIDOC ma ( ) -> Variant Just like translate_action, but in shorter format ``` -------------------------------- ### API Property: secure Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/ENetProtocol.md Specifies whether encryption is required for the ENet connection. ```APIDOC Property: secure Type: bool Default: none Description: Specify if you needs encryption in your ENet ``` -------------------------------- ### MultiPlayCore Method: swap_increment Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Increments the swap state, typically used to cycle through available peers in swap mode. ```APIDOC swap_increment() ``` -------------------------------- ### API Property: player_node_resource_path Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPPlayer.md The resource path to the template used for creating the player node. This path specifies where the player's scene or resource is located. ```APIDOC Property: player_node_resource_path Type: String Default: "" Description: The resource path of the template player. ``` -------------------------------- ### MultiPlayCore Enumeration: ConnectionError Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Defines various error codes that can occur during a network connection attempt in MultiPlayCore, such as server full, authentication failure, or timeout. ```APIDOC enum ConnectionError: UNKNOWN = 0 # Unknown reason SERVER_FULL = 1 # The server's full AUTH_FAILED = 2 # Authentication Failure TIMEOUT = 3 # Connection timed out CONNECTION_FAILURE = 4 # Failure during connection INVALID_HANDSHAKE = 5 # Internal handshake data cannot be readed by the server VERSION_MISMATCH = 6 # Client's Multiplay version is not compatible with the server ``` -------------------------------- ### Kick Player Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPPlayer.md This method is used to kick a player. It is exclusively available on the server. ```APIDOC kick ( ) Kick the player, Server only. ``` -------------------------------- ### API Property: player_node Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPPlayer.md Refers to the game node created for the player from a specified template. This node represents the player's in-game entity. ```APIDOC Property: player_node Type: Node Default: none Description: The player node created from the template, see [member MultiPlayCore.player_scene] ``` -------------------------------- ### Animation Synchronizer Limitation: Godot Built-in Functions Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/manual/synchronizers/anim-sync/_index.md Highlights a critical limitation for both MPAnimationSync and MPAnimTreeSync: Godot's built-in functions used within expressions may not synchronize correctly. It suggests a workaround to ensure proper synchronization. ```APIDOC Limitation: Godot Built-in Functions in Expressions Issue: Built-in functions used within expressions in Godot may not synchronize correctly via Animation Synchronizers. Resolution: Create a dedicated parameter and check its value instead of relying on built-in function results directly for synchronization. ``` -------------------------------- ### API Property: auth_data Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPPlayer.md Describes the authentication data associated with a player or connection. This property holds information necessary for verifying identity. ```APIDOC Property: auth_data Type: Variant Default: Description: Authentication Data ``` -------------------------------- ### Handshake Ready Signal Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPPlayer.md This signal is emitted to all players when handshake data is ready. ```APIDOC handshake_ready ( ) On handshake data is ready. Emit to all players ``` -------------------------------- ### MPTransformSync API Methods for Server-Side Transform Control Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/manual/synchronizers/transform-sync/_index.md Details the methods available on the `MPTransformSync` component for server-side manipulation of a node's 2D and 3D transform properties (position, rotation, scale). These functions allow direct modification of the node's transform even without direct authority. ```APIDOC MPTransformSync: set_position_2d(to: Vector2) set_rotation_2d(to: float) set_scale_2d(to: Vector2) set_position_3d(to: Vector3) set_rotation_3d(to: Vector3) set_scale_3d(to: Vector3) ``` -------------------------------- ### Property: player_count Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Represents the current number of players connected or active in the game. ```APIDOC player_count: Type: int Default: 0 Description: Current player count ``` -------------------------------- ### Property: players Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md A collection object that manages all active players. This property provides access to player-related data and functionalities. ```APIDOC players: Type: MPPlayersCollection Default: none Description: Players Collection ``` -------------------------------- ### Respawn Player Node Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPPlayer.md This method is used to respawn a player node. It is exclusively available on the server. ```APIDOC respawn_node ( ) Respawn player node, Server only. ``` -------------------------------- ### Translate Input Action Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPPlayer.md This method translates an input action to its intended form, returning a `StringName`. In Online/Solo modes, it returns the original input action name. ```APIDOC translate_action ( ) -> StringName Translate input action to the intended ones. In Online/Solo, it'll return the same input action name ``` -------------------------------- ### API Property: is_swap_focused Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPPlayer.md Indicates if the swap mode is currently focusing on this specific player. This property is relevant only when the system is operating in swap mode. ```APIDOC Property: is_swap_focused Type: bool Default: false Description: Determines if swap is focusing this player, Swap mode only. ``` -------------------------------- ### Despawn Player Node Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPPlayer.md This method is used to despawn a player node. It is exclusively available on the server. ```APIDOC despawn_node ( ) Despawn player node, Server only. ``` -------------------------------- ### API Signal: disconnected_from_server Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Emitted locally when the client disconnects from the server. This signal is useful for cleaning up resources or reverting UI elements related to the server connection. ```APIDOC disconnected_from_server() ``` -------------------------------- ### API Signal: connection_error Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Emitted when the client encounters an error during the connection process to the server. This signal can be used to inform the user of connection issues or attempt reconnection. ```APIDOC connection_error() ``` -------------------------------- ### API Signal: player_disconnected Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MultiPlayCore.md Emitted to all players on the server when an existing player disconnects. This signal is useful for removing players from active lists or handling game state changes due to a player's departure. ```APIDOC player_disconnected() ``` -------------------------------- ### API Property: ping_ms Source: https://github.com/maji-git/mpc-docs/blob/master/content/docs/api/MPPlayer.md Represents the current network latency (ping) to the player in milliseconds. This value can be used for network performance monitoring. ```APIDOC Property: ping_ms Type: int Default: none Description: Ping in ms ```