Up to date
This page is up to date for Redot 4.3
.
If you still find outdated information, please create an issue.
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 |
_get_available_packet_count() virtual const |
|
_get_connection_status() virtual const |
|
_get_max_packet_size() virtual const |
|
_get_packet(r_buffer: |
|
_get_packet_channel() virtual const |
|
_get_packet_mode() virtual const |
|
_get_packet_peer() virtual const |
|
_get_packet_script() virtual |
|
_get_transfer_channel() virtual const |
|
_get_transfer_mode() virtual const |
|
_get_unique_id() virtual const |
|
_is_refusing_new_connections() virtual const |
|
_is_server() virtual const |
|
_is_server_relay_supported() virtual const |
|
void |
_poll() virtual |
_put_packet(p_buffer: |
|
_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 MultiplayerPeer.get_connection_status).
int _get_max_packet_size() virtual const π
Called when the maximum allowed packet size (in bytes) is requested by the MultiplayerAPI.
Error _get_packet(r_buffer: const uint8_t **
, r_buffer_size: int32_t*
) 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 _get_packet_channel() virtual const π
Called to get the channel over which the next available packet was received. See MultiplayerPeer.get_packet_channel.
TransferMode _get_packet_mode() virtual const π
Called to get the transfer mode the remote peer used to send the next available packet. See MultiplayerPeer.get_packet_mode.
int _get_packet_peer() virtual const π
Called when the ID of the MultiplayerPeer who sent the most recent packet is requested (see MultiplayerPeer.get_packet_peer).
PackedByteArray _get_packet_script() virtual π
Called when a packet needs to be received by the MultiplayerAPI, if _get_packet isn't implemented. Use this when extending this class via GDScript.
int _get_transfer_channel() virtual const π
Called when the transfer channel to use is read on this MultiplayerPeer (see MultiplayerPeer.transfer_channel).
TransferMode _get_transfer_mode() virtual const π
Called when the transfer mode to use is read on this MultiplayerPeer (see MultiplayerPeer.transfer_mode).
int _get_unique_id() virtual const π
Called when the unique ID of this MultiplayerPeer is requested (see MultiplayerPeer.get_unique_id). The value must be between 1
and 2147483647
.
bool _is_refusing_new_connections() virtual const π
Called when the "refuse new connections" status is requested on this MultiplayerPeer (see MultiplayerPeer.refuse_new_connections).
bool _is_server() virtual const π
Called when the "is server" status is requested on the MultiplayerAPI. See MultiplayerAPI.is_server.
bool _is_server_relay_supported() virtual const π
Called to check if the server can act as a relay in the current configuration. See MultiplayerPeer.is_server_relay_supported.
void _poll() virtual π
Called when the MultiplayerAPI is polled. See MultiplayerAPI.poll.
Error _put_packet(p_buffer: const uint8_t*
, p_buffer_size: int) 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.
Error _put_packet_script(p_buffer: PackedByteArray) virtual π
Called when a packet needs to be sent by the MultiplayerAPI, if _put_packet isn't implemented. Use this when extending this class via GDScript.
void _set_refuse_new_connections(p_enable: bool) virtual π
Called when the "refuse new connections" status is set on this MultiplayerPeer (see MultiplayerPeer.refuse_new_connections).
void _set_target_peer(p_peer: int) virtual π
Called when the target peer to use is set for this MultiplayerPeer (see MultiplayerPeer.set_target_peer).
void _set_transfer_channel(p_channel: int) virtual π
Called when the channel to use is set for this MultiplayerPeer (see MultiplayerPeer.transfer_channel).
void _set_transfer_mode(p_mode: TransferMode) virtual π
Called when the transfer mode is set on this MultiplayerPeer (see MultiplayerPeer.transfer_mode).