MPPlayer

API: MPPlayer #

Inherits: MPBase

MultiPlay Player Node

Properties #

Type Name Default
Variant auth_data
Variant handshake_data
bool is_local false
bool is_ready false
bool is_swap_focused false
MultiPlayCore mpc
int ping_ms
int player_id 0
int player_index 0
Node player_node
String player_node_resource_path ""

Methods #

Returns Type Syntax
despawn_node ( )
disconnect_player ( )
kick ( )
Variant ma ( )
respawn_node ( )
spawn_node ( )
StringName translate_action ( )

Property Descriptions #

Variant auth_data

  • Default: <unknown>

Authentication Data


Variant handshake_data

  • Default: <unknown>

Handshake data


bool is_local

  • Default: false

Determines if this player is local


bool is_ready

  • Default: false

Determines if this player network is ready


bool is_swap_focused

  • Default: false

Determines if swap is focusing this player, Swap mode only.


MultiPlayCore mpc

  • Default: none

Get MultiPlayCore


int ping_ms

  • Default: none

Ping in ms


int player_id

  • Default: 0

ID of the player


int player_index

  • Default: 0

Determines the player index, not to be confused with player_id.


Node player_node

  • Default: none

The player node created from the template, see [member MultiPlayCore.player_scene]


String player_node_resource_path

  • Default: ""

The resource path of the template player.


Method Descriptions #

despawn_node ( )

Despawn player node, Server only.


disconnect_player ( )

Disconnect the player, this is intended for local use.


kick ( )

Kick the player, Server only.


Variant ma ( )

Just like translate_action, but in shorter format


respawn_node ( )

Respawn player node, Server only.


spawn_node ( )

Spawn player node, Server only.


StringName translate_action ( )

Translate input action to the intended ones. In Online/Solo, it’ll return the same input action name


Signals #

handshake_ready ( )

On handshake data is ready. Emit to all players


player_ready ( )

On player ready. Only emit locally


swap_focused ( )

On swap focused, Swap mode only


swap_unfocused ( )

On swap unfocused, Swap mode only