summaryrefslogtreecommitdiff
path: root/modules/websocket/doc_classes
diff options
context:
space:
mode:
Diffstat (limited to 'modules/websocket/doc_classes')
-rw-r--r--modules/websocket/doc_classes/WebSocketClient.xml42
-rw-r--r--modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml24
-rw-r--r--modules/websocket/doc_classes/WebSocketPeer.xml42
-rw-r--r--modules/websocket/doc_classes/WebSocketServer.xml75
4 files changed, 65 insertions, 118 deletions
diff --git a/modules/websocket/doc_classes/WebSocketClient.xml b/modules/websocket/doc_classes/WebSocketClient.xml
index 40c0ad17ad..1549a907b4 100644
--- a/modules/websocket/doc_classes/WebSocketClient.xml
+++ b/modules/websocket/doc_classes/WebSocketClient.xml
@@ -13,16 +13,11 @@
</tutorials>
<methods>
<method name="connect_to_url">
- <return type="int" enum="Error">
- </return>
- <argument index="0" name="url" type="String">
- </argument>
- <argument index="1" name="protocols" type="PackedStringArray" default="PackedStringArray()">
- </argument>
- <argument index="2" name="gd_mp_api" type="bool" default="false">
- </argument>
- <argument index="3" name="custom_headers" type="PackedStringArray" default="PackedStringArray()">
- </argument>
+ <return type="int" enum="Error" />
+ <argument index="0" name="url" type="String" />
+ <argument index="1" name="protocols" type="PackedStringArray" default="PackedStringArray()" />
+ <argument index="2" name="gd_mp_api" type="bool" default="false" />
+ <argument index="3" name="custom_headers" type="PackedStringArray" default="PackedStringArray()" />
<description>
Connects to the given URL requesting one of the given [code]protocols[/code] as sub-protocol. If the list empty (default), no sub-protocol will be requested.
If [code]true[/code] is passed as [code]gd_mp_api[/code], the client will behave like a network peer for the [MultiplayerAPI], connections to non-Godot servers will not work, and [signal data_received] will not be emitted.
@@ -33,26 +28,21 @@
</description>
</method>
<method name="disconnect_from_host">
- <return type="void">
- </return>
- <argument index="0" name="code" type="int" default="1000">
- </argument>
- <argument index="1" name="reason" type="String" default="&quot;&quot;">
- </argument>
+ <return type="void" />
+ <argument index="0" name="code" type="int" default="1000" />
+ <argument index="1" name="reason" type="String" default="&quot;&quot;" />
<description>
Disconnects this client from the connected host. See [method WebSocketPeer.close] for more information.
</description>
</method>
<method name="get_connected_host" qualifiers="const">
- <return type="String">
- </return>
+ <return type="String" />
<description>
Return the IP address of the currently connected host.
</description>
</method>
<method name="get_connected_port" qualifiers="const">
- <return type="int">
- </return>
+ <return type="int" />
<description>
Return the IP port of the currently connected host.
</description>
@@ -70,8 +60,7 @@
</members>
<signals>
<signal name="connection_closed">
- <argument index="0" name="was_clean_close" type="bool">
- </argument>
+ <argument index="0" name="was_clean_close" type="bool" />
<description>
Emitted when the connection to the server is closed. [code]was_clean_close[/code] will be [code]true[/code] if the connection was shutdown cleanly.
</description>
@@ -82,8 +71,7 @@
</description>
</signal>
<signal name="connection_established">
- <argument index="0" name="protocol" type="String">
- </argument>
+ <argument index="0" name="protocol" type="String" />
<description>
Emitted when a connection with the server is established, [code]protocol[/code] will contain the sub-protocol agreed with the server.
</description>
@@ -95,10 +83,8 @@
</description>
</signal>
<signal name="server_close_request">
- <argument index="0" name="code" type="int">
- </argument>
- <argument index="1" name="reason" type="String">
- </argument>
+ <argument index="0" name="code" type="int" />
+ <argument index="1" name="reason" type="String" />
<description>
Emitted when the server requests a clean close. You should keep polling until you get a [signal connection_closed] signal to achieve the clean close. See [method WebSocketPeer.close] for more details.
</description>
diff --git a/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml b/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml
index ee1b60f739..cd41e9a1fb 100644
--- a/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml
+++ b/modules/websocket/doc_classes/WebSocketMultiplayerPeer.xml
@@ -10,25 +10,18 @@
</tutorials>
<methods>
<method name="get_peer" qualifiers="const">
- <return type="WebSocketPeer">
- </return>
- <argument index="0" name="peer_id" type="int">
- </argument>
+ <return type="WebSocketPeer" />
+ <argument index="0" name="peer_id" type="int" />
<description>
Returns the [WebSocketPeer] associated to the given [code]peer_id[/code].
</description>
</method>
<method name="set_buffers">
- <return type="int" enum="Error">
- </return>
- <argument index="0" name="input_buffer_size_kb" type="int">
- </argument>
- <argument index="1" name="input_max_packets" type="int">
- </argument>
- <argument index="2" name="output_buffer_size_kb" type="int">
- </argument>
- <argument index="3" name="output_max_packets" type="int">
- </argument>
+ <return type="int" enum="Error" />
+ <argument index="0" name="input_buffer_size_kb" type="int" />
+ <argument index="1" name="input_max_packets" type="int" />
+ <argument index="2" name="output_buffer_size_kb" type="int" />
+ <argument index="3" name="output_max_packets" 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.
@@ -43,8 +36,7 @@
</members>
<signals>
<signal name="peer_packet">
- <argument index="0" name="peer_source" type="int">
- </argument>
+ <argument index="0" name="peer_source" 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.
diff --git a/modules/websocket/doc_classes/WebSocketPeer.xml b/modules/websocket/doc_classes/WebSocketPeer.xml
index 5125956416..ab7ef6c4d0 100644
--- a/modules/websocket/doc_classes/WebSocketPeer.xml
+++ b/modules/websocket/doc_classes/WebSocketPeer.xml
@@ -11,12 +11,9 @@
</tutorials>
<methods>
<method name="close">
- <return type="void">
- </return>
- <argument index="0" name="code" type="int" default="1000">
- </argument>
- <argument index="1" name="reason" type="String" default="&quot;&quot;">
- </argument>
+ <return type="void" />
+ <argument index="0" name="code" type="int" default="1000" />
+ <argument index="1" name="reason" type="String" default="&quot;&quot;" />
<description>
Closes this WebSocket connection. [code]code[/code] is the status code for the closure (see RFC 6455 section 7.4 for a list of valid status codes). [code]reason[/code] is the human readable reason for closing the connection (can be any UTF-8 string that's smaller than 123 bytes).
[b]Note:[/b] To achieve a clean close, you will need to keep polling until either [signal WebSocketClient.connection_closed] or [signal WebSocketServer.client_disconnected] is received.
@@ -24,57 +21,54 @@
</description>
</method>
<method name="get_connected_host" qualifiers="const">
- <return type="String">
- </return>
+ <return type="String" />
<description>
Returns the IP address of the connected peer.
[b]Note:[/b] Not available in the HTML5 export.
</description>
</method>
<method name="get_connected_port" qualifiers="const">
- <return type="int">
- </return>
+ <return type="int" />
<description>
Returns the remote port of the connected peer.
[b]Note:[/b] Not available in the HTML5 export.
</description>
</method>
+ <method name="get_current_outbound_buffered_amount" qualifiers="const">
+ <return type="int" />
+ <description>
+ Returns the current amount of data in the outbound websocket buffer. [b]Note:[/b] HTML5 exports use WebSocket.bufferedAmount, while other platforms use an internal buffer.
+ </description>
+ </method>
<method name="get_write_mode" qualifiers="const">
- <return type="int" enum="WebSocketPeer.WriteMode">
- </return>
+ <return type="int" enum="WebSocketPeer.WriteMode" />
<description>
Gets the current selected write mode. See [enum WriteMode].
</description>
</method>
<method name="is_connected_to_host" qualifiers="const">
- <return type="bool">
- </return>
+ <return type="bool" />
<description>
Returns [code]true[/code] if this peer is currently connected.
</description>
</method>
<method name="set_no_delay">
- <return type="void">
- </return>
- <argument index="0" name="enabled" type="bool">
- </argument>
+ <return type="void" />
+ <argument index="0" name="enabled" type="bool" />
<description>
Disable Nagle's algorithm on the underling TCP socket (default). See [method StreamPeerTCP.set_no_delay] for more information.
[b]Note:[/b] Not available in the HTML5 export.
</description>
</method>
<method name="set_write_mode">
- <return type="void">
- </return>
- <argument index="0" name="mode" type="int" enum="WebSocketPeer.WriteMode">
- </argument>
+ <return type="void" />
+ <argument index="0" name="mode" type="int" enum="WebSocketPeer.WriteMode" />
<description>
Sets the socket to use the given [enum WriteMode].
</description>
</method>
<method name="was_string_packet" qualifiers="const">
- <return type="bool">
- </return>
+ <return type="bool" />
<description>
Returns [code]true[/code] if the last received packet was sent as a text payload. See [enum WriteMode].
</description>
diff --git a/modules/websocket/doc_classes/WebSocketServer.xml b/modules/websocket/doc_classes/WebSocketServer.xml
index 5491f7de15..90182de4c2 100644
--- a/modules/websocket/doc_classes/WebSocketServer.xml
+++ b/modules/websocket/doc_classes/WebSocketServer.xml
@@ -12,61 +12,46 @@
</tutorials>
<methods>
<method name="disconnect_peer">
- <return type="void">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="code" type="int" default="1000">
- </argument>
- <argument index="2" name="reason" type="String" default="&quot;&quot;">
- </argument>
+ <return type="void" />
+ <argument index="0" name="id" type="int" />
+ <argument index="1" name="code" type="int" default="1000" />
+ <argument index="2" name="reason" type="String" default="&quot;&quot;" />
<description>
Disconnects the peer identified by [code]id[/code] from the server. See [method WebSocketPeer.close] for more information.
</description>
</method>
<method name="get_peer_address" qualifiers="const">
- <return type="String">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
+ <return type="String" />
+ <argument index="0" name="id" type="int" />
<description>
Returns the IP address of the given peer.
</description>
</method>
<method name="get_peer_port" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
+ <return type="int" />
+ <argument index="0" name="id" type="int" />
<description>
Returns the remote port of the given peer.
</description>
</method>
<method name="has_peer" qualifiers="const">
- <return type="bool">
- </return>
- <argument index="0" name="id" type="int">
- </argument>
+ <return type="bool" />
+ <argument index="0" name="id" type="int" />
<description>
Returns [code]true[/code] if a peer with the given ID is connected.
</description>
</method>
<method name="is_listening" qualifiers="const">
- <return type="bool">
- </return>
+ <return type="bool" />
<description>
Returns [code]true[/code] if the server is actively listening on a port.
</description>
</method>
<method name="listen">
- <return type="int" enum="Error">
- </return>
- <argument index="0" name="port" type="int">
- </argument>
- <argument index="1" name="protocols" type="PackedStringArray" default="PackedStringArray()">
- </argument>
- <argument index="2" name="gd_mp_api" type="bool" default="false">
- </argument>
+ <return type="int" enum="Error" />
+ <argument index="0" name="port" type="int" />
+ <argument index="1" name="protocols" type="PackedStringArray" default="PackedStringArray()" />
+ <argument index="2" name="gd_mp_api" type="bool" default="false" />
<description>
Starts listening on the given port.
You can specify the desired subprotocols via the "protocols" array. If the list empty (default), no sub-protocol will be requested.
@@ -75,8 +60,7 @@
</description>
</method>
<method name="stop">
- <return type="void">
- </return>
+ <return type="void" />
<description>
Stops the server and clear its state.
</description>
@@ -101,40 +85,31 @@
</members>
<signals>
<signal name="client_close_request">
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="code" type="int">
- </argument>
- <argument index="2" name="reason" type="String">
- </argument>
+ <argument index="0" name="id" type="int" />
+ <argument index="1" name="code" type="int" />
+ <argument index="2" name="reason" type="String" />
<description>
Emitted when a client requests a clean close. You should keep polling until you get a [signal client_disconnected] signal with the same [code]id[/code] to achieve the clean close. See [method WebSocketPeer.close] for more details.
</description>
</signal>
<signal name="client_connected">
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="protocol" type="String">
- </argument>
- <argument index="2" name="resource_name" type="String">
- </argument>
+ <argument index="0" name="id" type="int" />
+ <argument index="1" name="protocol" type="String" />
+ <argument index="2" name="resource_name" type="String" />
<description>
Emitted when a new client connects. "protocol" will be the sub-protocol agreed with the client, and "resource_name" will be the resource name of the URI the peer used.
"resource_name" is a path (at the very least a single forward slash) and potentially a query string.
</description>
</signal>
<signal name="client_disconnected">
- <argument index="0" name="id" type="int">
- </argument>
- <argument index="1" name="was_clean_close" type="bool">
- </argument>
+ <argument index="0" name="id" type="int" />
+ <argument index="1" name="was_clean_close" type="bool" />
<description>
Emitted when a client disconnects. [code]was_clean_close[/code] will be [code]true[/code] if the connection was shutdown cleanly.
</description>
</signal>
<signal name="data_received">
- <argument index="0" name="id" type="int">
- </argument>
+ <argument index="0" name="id" type="int" />
<description>
Emitted when a new message is received.
[b]Note:[/b] This signal is [i]not[/i] emitted when used as high-level multiplayer peer.