Index · Object → RefCounted → PacketPeer → MultiplayerPeer → MultiplayerPeerExtension

MultiplayerPeerExtension

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

Class 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.

Properties

Inherited from MultiplayerPeer (3)
Inherited from PacketPeer (1)

Methods

func _close() -> void

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

func _disconnect_peer(peer: int, force: bool) -> void

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

func _get_available_packet_count() -> int

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

func _get_connection_status() -> MultiplayerPeer.ConnectionStatus

Called when the connection status is requested on the MultiplayerPeer (see MultiplayerPeer.get_connection_status()).

func _get_max_packet_size() -> int

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

func _get_packet(r_buffer: const uint8_t **, r_buffer_size: int32_t*) -> Error

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.

func _get_packet_channel() -> int

Called to get the channel over which the next available packet was received. See MultiplayerPeer.get_packet_channel().

func _get_packet_mode() -> MultiplayerPeer.TransferMode

Called to get the transfer mode the remote peer used to send the next available packet. See MultiplayerPeer.get_packet_mode().

func _get_packet_peer() -> int

Called when the ID of the MultiplayerPeer who sent the most recent packet is requested (see MultiplayerPeer.get_packet_peer()).

func _get_packet_script() -> PackedByteArray

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.

func _get_transfer_channel() -> int

Called when the transfer channel to use is read on this MultiplayerPeer (see MultiplayerPeer.transfer_channel).

func _get_transfer_mode() -> MultiplayerPeer.TransferMode

Called when the transfer mode to use is read on this MultiplayerPeer (see MultiplayerPeer.transfer_mode).

func _get_unique_id() -> int

Called when the unique ID of this MultiplayerPeer is requested (see MultiplayerPeer.get_unique_id()). The value must be between 1 and 2147483647.

func _is_refusing_new_connections() -> bool

Called when the "refuse new connections" status is requested on this MultiplayerPeer (see MultiplayerPeer.refuse_new_connections).

func _is_server() -> bool

Called when the "is server" status is requested on the MultiplayerAPI. See MultiplayerAPI.is_server().

func _is_server_relay_supported() -> bool

Called to check if the server can act as a relay in the current configuration. See MultiplayerPeer.is_server_relay_supported().

func _poll() -> void

Called when the MultiplayerAPI is polled. See MultiplayerAPI.poll().

func _put_packet(buffer: const uint8_t*, buffer_size: int) -> Error

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

func _put_packet_script(buffer: PackedByteArray) -> Error

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.

func _set_refuse_new_connections(enable: bool) -> void

Called when the "refuse new connections" status is set on this MultiplayerPeer (see MultiplayerPeer.refuse_new_connections).

func _set_target_peer(peer: int) -> void

Called when the target peer to use is set for this MultiplayerPeer (see MultiplayerPeer.set_target_peer()).

func _set_transfer_channel(channel: int) -> void

Called when the channel to use is set for this MultiplayerPeer (see MultiplayerPeer.transfer_channel).

func _set_transfer_mode(mode: MultiplayerPeer.TransferMode) -> void

Called when the transfer mode is set on this MultiplayerPeer (see MultiplayerPeer.transfer_mode).

Inherited from MultiplayerPeer (11)
func close() -> void
func disconnect_peer(peer: int, force: bool = false) -> void
func get_unique_id() -> int
func poll() -> void
func set_target_peer(id: int) -> void
Inherited from PacketPeer (6)
func get_packet_error() -> Error
func get_var(allow_objects: bool = false) -> Variant
func put_packet(buffer: PackedByteArray) -> Error
func put_var(var: Variant, full_objects: bool = false) -> Error
Inherited from RefCounted (4)
func init_ref() -> bool
func reference() -> bool
func unreference() -> bool
Inherited from Object (62)
func _get(property: StringName) -> Variant
func _get_property_list() -> Dictionary[]
func _init() -> void
func _iter_get(iter: Variant) -> Variant
func _iter_init(iter: Array) -> bool
func _iter_next(iter: Array) -> bool
func _notification(what: int) -> void
func _set(property: StringName, value: Variant) -> bool
func _to_string() -> String
func _validate_property(property: Dictionary) -> void
func add_user_signal(signal: String, arguments: Array = []) -> void
func call(method: StringName) -> Variant
func callv(method: StringName, arg_array: Array) -> Variant
func cancel_free() -> void
func connect(signal: StringName, callable: Callable, flags: int = 0) -> Error
func disconnect(signal: StringName, callable: Callable) -> void
func emit_signal(signal: StringName) -> Error
func free() -> void
func get(property: StringName) -> Variant
func get_class() -> String
func get_incoming_connections() -> Dictionary[]
func get_indexed(property_path: NodePath) -> Variant
func get_meta(name: StringName, default: Variant = null) -> Variant
func get_meta_list() -> StringName[]
func get_method_list() -> Dictionary[]
func get_property_list() -> Dictionary[]
func get_signal_connection_list(signal: StringName) -> Dictionary[]
func get_signal_list() -> Dictionary[]
func has_meta(name: StringName) -> bool
func has_method(method: StringName) -> bool
func has_signal(signal: StringName) -> bool
func is_class(class: StringName) -> bool
func is_connected(signal: StringName, callable: Callable) -> bool
func notification(what: int, reversed: bool = false) -> void
func remove_meta(name: StringName) -> void
func remove_user_signal(signal: StringName) -> void
func set(property: StringName, value: Variant) -> void
func set_block_signals(enable: bool) -> void
func set_deferred(property: StringName, value: Variant) -> void
func set_indexed(property_path: NodePath, value: Variant) -> void
func set_message_translation(enable: bool) -> void
func set_meta(name: StringName, value: Variant) -> void
func set_script(script: Variant) -> void
func set_translation_domain(domain: StringName) -> void
func to_string() -> String
func tr(message: StringName, context: StringName = &"") -> String
func tr_n(message: StringName, plural_message: StringName, n: int, context: StringName = &"") -> String

Signals

Inherited from MultiplayerPeer (2)
signal peer_connected(id: int)
Inherited from Object (2)