Table of Contents

Class MultiplayerApiExtension

Namespace
Godot
Assembly
GodotSharp.dll

This class can be used to augment or replace the default MultiplayerApi implementation via script or extensions.

The following example augment 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 SetMultiplayer(MultiplayerApi, NodePath) to start using your custom MultiplayerApi:

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

[GodotClassName("MultiplayerAPIExtension")]
public class MultiplayerApiExtension : MultiplayerApi, IDisposable
Inheritance
MultiplayerApiExtension
Implements
Inherited Members

Constructors

MultiplayerApiExtension()

public MultiplayerApiExtension()

Methods

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool

_GetMultiplayerPeer()

Called when the MultiplayerPeer is retrieved.

public virtual MultiplayerPeer _GetMultiplayerPeer()

Returns

MultiplayerPeer

_GetPeerIds()

Callback for GetPeers().

public virtual int[] _GetPeerIds()

Returns

int[]

_GetRemoteSenderId()

Callback for GetRemoteSenderId().

public virtual int _GetRemoteSenderId()

Returns

int

_GetUniqueId()

Callback for GetUniqueId().

public virtual int _GetUniqueId()

Returns

int

_ObjectConfigurationAdd(GodotObject, Variant)

public virtual Error _ObjectConfigurationAdd(GodotObject @object, Variant configuration)

Parameters

object GodotObject
configuration Variant

Returns

Error

_ObjectConfigurationRemove(GodotObject, Variant)

public virtual Error _ObjectConfigurationRemove(GodotObject @object, Variant configuration)

Parameters

object GodotObject
configuration Variant

Returns

Error

_Poll()

Callback for Poll().

public virtual Error _Poll()

Returns

Error

_Rpc(int, GodotObject, StringName, Array)

public virtual Error _Rpc(int peer, GodotObject @object, StringName method, Array args)

Parameters

peer int
object GodotObject
method StringName
args Array

Returns

Error

_SetMultiplayerPeer(MultiplayerPeer)

Called when the MultiplayerPeer is set.

public virtual void _SetMultiplayerPeer(MultiplayerPeer multiplayerPeer)

Parameters

multiplayerPeer MultiplayerPeer