Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

MultiplayerPeerExtension

Inherits: MultiplayerPeer < PacketPeer < RefCounted < Object

Class that can be inherited to implement custom multiplayer API networking layers via GDExtension.

Description

This class is designed to be inherited from a GDExtension plugin to implement custom networking layers for the multiplayer API (such as WebRTC). All the methods below must be implemented to have a working custom multiplayer implementation. See also MultiplayerAPI.

Methods

void

_close() virtual

void

_disconnect_peer(p_peer: int, p_force: bool) virtual

int

_get_available_packet_count() virtual const

ConnectionStatus

_get_connection_status() virtual const

int

_get_max_packet_size() virtual const

Error

_get_packet(r_buffer: const uint8_t **, r_buffer_size: int32_t*) virtual

int

_get_packet_channel() virtual const

TransferMode

_get_packet_mode() virtual const

int

_get_packet_peer() virtual const

PackedByteArray

_get_packet_script() virtual

int

_get_transfer_channel() virtual const

TransferMode

_get_transfer_mode() virtual const

int

_get_unique_id() virtual const

bool

_is_refusing_new_connections() virtual const

bool

_is_server() virtual const

bool

_is_server_relay_supported() virtual const

void

_poll() virtual

Error

_put_packet(p_buffer: const uint8_t*, p_buffer_size: int) virtual

Error

_put_packet_script(p_buffer: PackedByteArray) virtual

void

_set_refuse_new_connections(p_enable: bool) virtual

void

_set_target_peer(p_peer: int) virtual

void

_set_transfer_channel(p_channel: int) virtual

void

_set_transfer_mode(p_mode: TransferMode) virtual


Method Descriptions

void _close() virtual

Called when the multiplayer peer should be immediately closed (see MultiplayerPeer.close).


void _disconnect_peer(p_peer: int, p_force: bool) virtual

Called when the connected p_peer should be forcibly disconnected (see MultiplayerPeer.disconnect_peer).


int _get_available_packet_count() virtual const

Called when the available packet count is internally requested by the MultiplayerAPI.


ConnectionStatus _get_connection_status() virtual const

Called when the connection status is requested on the MultiplayerPeer (see