diff options
Diffstat (limited to 'modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml')
-rw-r--r-- | modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml | 68 |
1 files changed, 50 insertions, 18 deletions
diff --git a/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml b/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml index 4cc4d515e7..7e896a0ca3 100644 --- a/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml +++ b/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml @@ -10,6 +10,26 @@ <tutorials> </tutorials> <methods> + <method name="create_client"> + <return type="int" enum="Error" /> + <param index="0" name="url" type="String" /> + <param index="1" name="verify_tls" type="bool" default="true" /> + <param index="2" name="tls_certificate" type="X509Certificate" default="null" /> + <description> + Starts a new multiplayer client connecting to the given [param url]. If [param verify_tls] is [code]false[/code] certificate validation will be disabled. If specified, the [param tls_certificate] will be used to verify the TLS host. + [b]Note[/b]: It is recommended to specify the scheme part of the URL, i.e. the [param url] should start with either [code]ws://[/code] or [code]wss://[/code]. + </description> + </method> + <method name="create_server"> + <return type="int" enum="Error" /> + <param index="0" name="port" type="int" /> + <param index="1" name="bind_address" type="String" default=""*"" /> + <param index="2" name="tls_key" type="CryptoKey" default="null" /> + <param index="3" name="tls_certificate" type="X509Certificate" default="null" /> + <description> + Starts a new multiplayer server listening on the given [param port]. You can optionally specify a [param bind_address], and provide a [param tls_key] and [param tls_certificate] to use TLS. + </description> + </method> <method name="get_peer" qualifiers="const"> <return type="WebSocketPeer" /> <param index="0" name="peer_id" type="int" /> @@ -17,27 +37,39 @@ Returns the [WebSocketPeer] associated to the given [code]peer_id[/code]. </description> </method> - <method name="set_buffers"> - <return type="int" enum="Error" /> - <param index="0" name="input_buffer_size_kb" type="int" /> - <param index="1" name="input_max_packets" type="int" /> - <param index="2" name="output_buffer_size_kb" type="int" /> - <param index="3" name="output_max_packets" type="int" /> + <method name="get_peer_address" qualifiers="const"> + <return type="String" /> + <param index="0" name="id" type="int" /> <description> - Configures the buffer sizes for this WebSocket peer. Default values can be specified in the Project Settings under [code]network/limits[/code]. 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 [code]4 = 2^12 = 4096 bytes[/code]. All parameters will be rounded up to the nearest power of two. - [b]Note:[/b] Web exports only use the input buffer since the output one is managed by browsers. + Returns the IP address of the given peer. </description> </method> - </methods> - <signals> - <signal name="peer_packet"> - <param index="0" name="peer_source" type="int" /> + <method name="get_peer_port" qualifiers="const"> + <return type="int" /> + <param index="0" name="id" type="int" /> <description> - Emitted when a packet is received from a peer. - [b]Note:[/b] This signal is only emitted when the client or server is configured to use Godot multiplayer API. + Returns the remote port of the given peer. </description> - </signal> - </signals> + </method> + </methods> + <members> + <member name="handshake_headers" type="PackedStringArray" setter="set_handshake_headers" getter="get_handshake_headers" default="PackedStringArray()"> + The extra headers to use during handshake. See [member WebSocketPeer.handshake_headers] for more details. + </member> + <member name="handshake_timeout" type="float" setter="set_handshake_timeout" getter="get_handshake_timeout" default="3.0"> + The maximum time each peer can stay in a connecting state before being dropped. + </member> + <member name="inbound_buffer_size" type="int" setter="set_inbound_buffer_size" getter="get_inbound_buffer_size" default="65535"> + The inbound buffer size for connected peers. See [member WebSocketPeer.inbound_buffer_size] for more details. + </member> + <member name="max_queued_packets" type="int" setter="set_max_queued_packets" getter="get_max_queued_packets" default="2048"> + The maximum number of queued packets for connected peers. See [member WebSocketPeer.max_queued_packets] for more details. + </member> + <member name="outbound_buffer_size" type="int" setter="set_outbound_buffer_size" getter="get_outbound_buffer_size" default="65535"> + The outbound buffer size for connected peers. See [member WebSocketPeer.outbound_buffer_size] for more details. + </member> + <member name="supported_protocols" type="PackedStringArray" setter="set_supported_protocols" getter="get_supported_protocols" default="PackedStringArray()"> + The supported WebSocket sub-protocols. See [member WebSocketPeer.supported_protocols] for more details. + </member> + </members> </class> |