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_nameName of the method to check for.
Returns
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_nameName of the signal to check for.
Returns
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_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
_GetMultiplayerPeer()
Called when the MultiplayerPeer is retrieved.
public virtual MultiplayerPeer _GetMultiplayerPeer()
Returns
_GetPeerIds()
Callback for GetPeers().
public virtual int[] _GetPeerIds()
Returns
- int[]
_GetRemoteSenderId()
Callback for GetRemoteSenderId().
public virtual int _GetRemoteSenderId()
Returns
_GetUniqueId()
Callback for GetUniqueId().
public virtual int _GetUniqueId()
Returns
_ObjectConfigurationAdd(GodotObject, Variant)
Callback for ObjectConfigurationAdd(GodotObject, Variant).
public virtual Error _ObjectConfigurationAdd(GodotObject @object, Variant configuration)
Parameters
object
GodotObjectconfiguration
Variant
Returns
_ObjectConfigurationRemove(GodotObject, Variant)
Callback for ObjectConfigurationRemove(GodotObject, Variant).
public virtual Error _ObjectConfigurationRemove(GodotObject @object, Variant configuration)
Parameters
object
GodotObjectconfiguration
Variant
Returns
_Poll()
Callback for Poll().
public virtual Error _Poll()
Returns
_Rpc(int, GodotObject, StringName, Array)
Callback for Rpc(int, GodotObject, StringName, Array).
public virtual Error _Rpc(int peer, GodotObject @object, StringName method, Array args)
Parameters
peer
intobject
GodotObjectmethod
StringNameargs
Array
Returns
_SetMultiplayerPeer(MultiplayerPeer)
Called when the MultiplayerPeer is set.
public virtual void _SetMultiplayerPeer(MultiplayerPeer multiplayerPeer)
Parameters
multiplayerPeer
MultiplayerPeer