:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/NetworkedMultiplayerCustom.xml. .. _class_NetworkedMultiplayerCustom: NetworkedMultiplayerCustom ========================== **Inherits:** :ref:`NetworkedMultiplayerPeer` **<** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`Object` A :ref:`NetworkedMultiplayerPeer` implementation that can be controlled from a script. Description ----------- A :ref:`NetworkedMultiplayerPeer` implementation that can be used as a :ref:`MultiplayerAPI.network_peer` and controlled from a script. Its purpose is to allow adding a new backend for the high-Level multiplayer API without needing to use GDNative. Methods ------- +------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`deliver_packet` **(** :ref:`PoolByteArray` buffer, :ref:`int` from_peer_id **)** | +------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`initialize` **(** :ref:`int` self_peer_id **)** | +------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_connection_status` **(** :ref:`ConnectionStatus` connection_status **)** | +------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_max_packet_size` **(** :ref:`int` max_packet_size **)** | +------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Signals ------- .. _class_NetworkedMultiplayerCustom_signal_packet_generated: - **packet_generated** **(** :ref:`int` peer_id, :ref:`PoolByteArray` buffer, :ref:`int` transfer_mode **)** Emitted when the local :ref:`MultiplayerAPI` generates a packet. Your script should take this packet and send it to the requested peer over the network (which should call :ref:`deliver_packet` with the data when it's received). Method Descriptions ------------------- .. _class_NetworkedMultiplayerCustom_method_deliver_packet: - void **deliver_packet** **(** :ref:`PoolByteArray` buffer, :ref:`int` from_peer_id **)** Deliver a packet to the local :ref:`MultiplayerAPI`. When your script receives a packet from other peers over the network (originating from the :ref:`packet_generated` signal on the sending peer), passing it to this method will deliver it locally. ---- .. _class_NetworkedMultiplayerCustom_method_initialize: - void **initialize** **(** :ref:`int` self_peer_id **)** Initialize the peer with the given ``peer_id`` (must be between 1 and 2147483647). Can only be called if the connection status is :ref:`NetworkedMultiplayerPeer.CONNECTION_CONNECTING`. See :ref:`set_connection_status`. ---- .. _class_NetworkedMultiplayerCustom_method_set_connection_status: - void **set_connection_status** **(** :ref:`ConnectionStatus` connection_status **)** Set the state of the connection. See :ref:`ConnectionStatus`. This will emit the :ref:`NetworkedMultiplayerPeer.connection_succeeded`, :ref:`NetworkedMultiplayerPeer.connection_failed` or :ref:`NetworkedMultiplayerPeer.server_disconnected` signals depending on the status and if the peer has the unique network id of ``1``. You can only change to :ref:`NetworkedMultiplayerPeer.CONNECTION_CONNECTING` from :ref:`NetworkedMultiplayerPeer.CONNECTION_DISCONNECTED` and to :ref:`NetworkedMultiplayerPeer.CONNECTION_CONNECTED` from :ref:`NetworkedMultiplayerPeer.CONNECTION_CONNECTING`. ---- .. _class_NetworkedMultiplayerCustom_method_set_max_packet_size: - void **set_max_packet_size** **(** :ref:`int` max_packet_size **)** Set the max packet size that this peer can handle. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`