:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.6/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml. .. _class_WebSocketMultiplayerPeer: WebSocketMultiplayerPeer ======================== **Inherits:** :ref:`NetworkedMultiplayerPeer` **<** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`Object` **Inherited By:** :ref:`WebSocketClient`, :ref:`WebSocketServer` Base class for WebSocket server and client. .. rst-class:: classref-introduction-group Description ----------- Base class for WebSocket server and client, allowing them to be used as network peer for the :ref:`MultiplayerAPI`. .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`WebSocketPeer` | :ref:`get_peer` **(** :ref:`int` peer_id **)** |const| | +-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Error` | :ref:`set_buffers` **(** :ref:`int` input_buffer_size_kb, :ref:`int` input_max_packets, :ref:`int` output_buffer_size_kb, :ref:`int` output_max_packets **)** | +-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Signals ------- .. _class_WebSocketMultiplayerPeer_signal_peer_packet: .. rst-class:: classref-signal **peer_packet** **(** :ref:`int` peer_source **)** Emitted when a packet is received from a peer. \ **Note:** This signal is only emitted when the client or server is configured to use Godot multiplayer API. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_WebSocketMultiplayerPeer_method_get_peer: .. rst-class:: classref-method :ref:`WebSocketPeer` **get_peer** **(** :ref:`int` peer_id **)** |const| Returns the :ref:`WebSocketPeer` associated to the given ``peer_id``. .. rst-class:: classref-item-separator ---- .. _class_WebSocketMultiplayerPeer_method_set_buffers: .. rst-class:: classref-method :ref:`Error` **set_buffers** **(** :ref:`int` input_buffer_size_kb, :ref:`int` input_max_packets, :ref:`int` output_buffer_size_kb, :ref:`int` output_max_packets **)** Configures the buffer sizes for this WebSocket peer. Default values can be specified in the Project Settings under ``network/limits``. For server, values are meant per connected peer. The first two parameters define the size and queued packets limits of the input buffer, the last two of the output buffer. Buffer sizes are expressed in KiB, so ``4 = 2^12 = 4096 bytes``. All parameters will be rounded up to the nearest power of two. \ **Note:** HTML5 exports only use the input buffer since the output one is managed by browsers. .. |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.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`