Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

MultiplayerAPI

Inherits: RefCounted < Object

Inherited By: MultiplayerAPIExtension, SceneMultiplayer

High-level multiplayer API interface.

Description

Base class for high-level multiplayer API implementations. See also MultiplayerPeer.

By default, SceneTree has a reference to an implementation of this class and uses it to provide multiplayer capabilities (i.e. RPCs) across the whole scene.

It is possible to override the MultiplayerAPI instance used by specific tree branches by calling the SceneTree.set_multiplayer method, effectively allowing to run both client and server in the same scene.

It is also possible to extend or replace the default implementation via scripting or native extensions. See MultiplayerAPIExtension for details about extensions, SceneMultiplayer for the details about the default implementation.

Properties

MultiplayerPeer

multiplayer_peer

Methods

MultiplayerAPI

create_default_interface ( ) static

StringName

get_default_interface ( ) static

PackedInt32Array

get_peers ( )

int

get_remote_sender_id ( )

int

get_unique_id ( )

bool

has_multiplayer_peer ( )

bool

is_server ( )

Error

object_configuration_add ( Object object, Variant configuration )

Error

object_configuration_remove ( Object object, Variant configuration )

Error

poll ( )

Error

rpc ( int peer, Object object, StringName method, Array arguments=[] )

void

set_default_interface ( StringName interface_name ) static


Signals