Class reference

MultiplayerPeerExtension

Inherits MultiplayerPeer

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 required

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

int _get_available_packet_count() virtual required const

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

int _get_max_packet_size() virtual required const

Called when the maximum allowed packet size (in bytes) is requested by the MultiplayerAPI.

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

Called when a packet needs to be received by the MultiplayerAPI, with r_buffer_size being the size of the binary r_buffer in bytes.

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

Called when a packet needs to be sent by the MultiplayerAPI, with p_buffer_size being the size of the binary p_buffer in bytes.

Source revision 4f5b14abade2
Connection interrupted. Reload×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.