MultiplayerAPIExtension

Inherits: MultiplayerAPI < RefCounted < Object

Base class used for extending the MultiplayerAPI.

Description

This class can be used to extend or replace the default MultiplayerAPI implementation via script or extensions.

The following example extend the default implementation (SceneMultiplayer) by logging every RPC being made, and every object being configured for replication.

Then in your main scene or in an autoload call SceneTree.set_multiplayer() to start using your custom MultiplayerAPI:

Native extensions can alternatively use the MultiplayerAPI.set_default_interface() method during initialization to configure themselves as the default implementation.

Methods

MultiplayerPeer

_get_multiplayer_peer() virtual

PackedInt32Array

_get_peer_ids() virtual const

int

_get_remote_sender_id() virtual const

int

_get_unique_id() virtual const

Error

_object_configuration_add(object: Object, configuration: Variant) virtual

Error

_object_configuration_remove(object: Object, configuration: Variant) virtual

Error

_poll() virtual

Error

_rpc(peer: int, object: Object, method: StringName, args: Array) virtual

void

_set_multiplayer_peer(multiplayer_peer: MultiplayerPeer) virtual


Method Descriptions

MultiplayerPeer _get_multiplayer_peer() virtual 🔗

Called when the MultiplayerAPI.multiplayer_peer is retrieved.


PackedInt32Array _get_peer_ids() virtual const 🔗

Callback for MultiplayerAPI.get_peers().


int _get_remote_sender_id() virtual const 🔗

Callback for MultiplayerAPI.get_remote_sender_id().


int _get_unique_id() virtual const 🔗

Callback for MultiplayerAPI.get_unique_id().


Error _object_configuration_add(object: Object, configuration: Variant) virtual 🔗

Callback for MultiplayerAPI.object_configuration_add().


Error _object_configuration_remove(object: Object, configuration: Variant) virtual 🔗

Callback for MultiplayerAPI.object_configuration_remove().


Error _poll() virtual 🔗

Callback for MultiplayerAPI.poll().


Error _rpc(peer: int, object: Object, method: StringName, args: Array) virtual 🔗

Callback for MultiplayerAPI.rpc().


void _set_multiplayer_peer(multiplayer_peer: MultiplayerPeer) virtual 🔗

Called when the MultiplayerAPI.multiplayer_peer is set.