classref: Sync with current master branch (2e7fc81)

This commit is contained in:
Godot Organization
2024-02-24 03:20:02 +00:00
parent 4f21f44632
commit 8978497bb6
938 changed files with 42729 additions and 36889 deletions
+46 -42
View File
@@ -1,5 +1,8 @@
:github_url: hide
.. meta::
:keywords: network
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
@@ -60,29 +63,29 @@ Methods
.. table::
:widths: auto
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`close<class_MultiplayerPeer_method_close>` **(** **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`disconnect_peer<class_MultiplayerPeer_method_disconnect_peer>` **(** :ref:`int<class_int>` peer, :ref:`bool<class_bool>` force=false **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`generate_unique_id<class_MultiplayerPeer_method_generate_unique_id>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ConnectionStatus<enum_MultiplayerPeer_ConnectionStatus>` | :ref:`get_connection_status<class_MultiplayerPeer_method_get_connection_status>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_packet_channel<class_MultiplayerPeer_method_get_packet_channel>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`TransferMode<enum_MultiplayerPeer_TransferMode>` | :ref:`get_packet_mode<class_MultiplayerPeer_method_get_packet_mode>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_packet_peer<class_MultiplayerPeer_method_get_packet_peer>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_unique_id<class_MultiplayerPeer_method_get_unique_id>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_server_relay_supported<class_MultiplayerPeer_method_is_server_relay_supported>` **(** **)** |const| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`poll<class_MultiplayerPeer_method_poll>` **(** **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref:`set_target_peer<class_MultiplayerPeer_method_set_target_peer>` **(** :ref:`int<class_int>` id **)** |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+
+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`close<class_MultiplayerPeer_method_close>`\ (\ ) |
+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`disconnect_peer<class_MultiplayerPeer_method_disconnect_peer>`\ (\ peer\: :ref:`int<class_int>`, force\: :ref:`bool<class_bool>` = false\ ) |
+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`generate_unique_id<class_MultiplayerPeer_method_generate_unique_id>`\ (\ ) |const| |
+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`ConnectionStatus<enum_MultiplayerPeer_ConnectionStatus>` | :ref:`get_connection_status<class_MultiplayerPeer_method_get_connection_status>`\ (\ ) |const| |
+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_packet_channel<class_MultiplayerPeer_method_get_packet_channel>`\ (\ ) |const| |
+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`TransferMode<enum_MultiplayerPeer_TransferMode>` | :ref:`get_packet_mode<class_MultiplayerPeer_method_get_packet_mode>`\ (\ ) |const| |
+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_packet_peer<class_MultiplayerPeer_method_get_packet_peer>`\ (\ ) |const| |
+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_unique_id<class_MultiplayerPeer_method_get_unique_id>`\ (\ ) |const| |
+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_server_relay_supported<class_MultiplayerPeer_method_is_server_relay_supported>`\ (\ ) |const| |
+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`poll<class_MultiplayerPeer_method_poll>`\ (\ ) |
+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
| |void| | :ref:`set_target_peer<class_MultiplayerPeer_method_set_target_peer>`\ (\ id\: :ref:`int<class_int>`\ ) |
+----------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+
.. rst-class:: classref-section-separator
@@ -97,7 +100,7 @@ Signals
.. rst-class:: classref-signal
**peer_connected** **(** :ref:`int<class_int>` id **)**
**peer_connected**\ (\ id\: :ref:`int<class_int>`\ )
Emitted when a remote peer connects.
@@ -109,7 +112,7 @@ Emitted when a remote peer connects.
.. rst-class:: classref-signal
**peer_disconnected** **(** :ref:`int<class_int>` id **)**
**peer_disconnected**\ (\ id\: :ref:`int<class_int>`\ )
Emitted when a remote peer has disconnected.
@@ -228,8 +231,8 @@ Property Descriptions
.. rst-class:: classref-property-setget
- void **set_refuse_new_connections** **(** :ref:`bool<class_bool>` value **)**
- :ref:`bool<class_bool>` **is_refusing_new_connections** **(** **)**
- |void| **set_refuse_new_connections**\ (\ value\: :ref:`bool<class_bool>`\ )
- :ref:`bool<class_bool>` **is_refusing_new_connections**\ (\ )
If ``true``, this **MultiplayerPeer** refuses new connections.
@@ -245,8 +248,8 @@ If ``true``, this **MultiplayerPeer** refuses new connections.
.. rst-class:: classref-property-setget
- void **set_transfer_channel** **(** :ref:`int<class_int>` value **)**
- :ref:`int<class_int>` **get_transfer_channel** **(** **)**
- |void| **set_transfer_channel**\ (\ value\: :ref:`int<class_int>`\ )
- :ref:`int<class_int>` **get_transfer_channel**\ (\ )
The channel to use to send packets. Many network APIs such as ENet and WebRTC allow the creation of multiple independent channels which behaves, in a way, like separate connections. This means that reliable data will only block delivery of other packets on that channel, and ordering will only be in respect to the channel the packet is being sent on. Using different channels to send **different and independent** state updates is a common way to optimize network usage and decrease latency in fast-paced games.
@@ -264,8 +267,8 @@ The channel to use to send packets. Many network APIs such as ENet and WebRTC al
.. rst-class:: classref-property-setget
- void **set_transfer_mode** **(** :ref:`TransferMode<enum_MultiplayerPeer_TransferMode>` value **)**
- :ref:`TransferMode<enum_MultiplayerPeer_TransferMode>` **get_transfer_mode** **(** **)**
- |void| **set_transfer_mode**\ (\ value\: :ref:`TransferMode<enum_MultiplayerPeer_TransferMode>`\ )
- :ref:`TransferMode<enum_MultiplayerPeer_TransferMode>` **get_transfer_mode**\ (\ )
The manner in which to send packets to the target peer. See :ref:`TransferMode<enum_MultiplayerPeer_TransferMode>`, and the :ref:`set_target_peer<class_MultiplayerPeer_method_set_target_peer>` method.
@@ -282,7 +285,7 @@ Method Descriptions
.. rst-class:: classref-method
void **close** **(** **)**
|void| **close**\ (\ )
Immediately close the multiplayer peer returning to the state :ref:`CONNECTION_DISCONNECTED<class_MultiplayerPeer_constant_CONNECTION_DISCONNECTED>`. Connected peers will be dropped without emitting :ref:`peer_disconnected<class_MultiplayerPeer_signal_peer_disconnected>`.
@@ -294,7 +297,7 @@ Immediately close the multiplayer peer returning to the state :ref:`CONNECTION_D
.. rst-class:: classref-method
void **disconnect_peer** **(** :ref:`int<class_int>` peer, :ref:`bool<class_bool>` force=false **)**
|void| **disconnect_peer**\ (\ peer\: :ref:`int<class_int>`, force\: :ref:`bool<class_bool>` = false\ )
Disconnects the given ``peer`` from this host. If ``force`` is ``true`` the :ref:`peer_disconnected<class_MultiplayerPeer_signal_peer_disconnected>` signal will not be emitted for this peer.
@@ -306,7 +309,7 @@ Disconnects the given ``peer`` from this host. If ``force`` is ``true`` the :ref
.. rst-class:: classref-method
:ref:`int<class_int>` **generate_unique_id** **(** **)** |const|
:ref:`int<class_int>` **generate_unique_id**\ (\ ) |const|
Returns a randomly generated integer that can be used as a network unique ID.
@@ -318,7 +321,7 @@ Returns a randomly generated integer that can be used as a network unique ID.
.. rst-class:: classref-method
:ref:`ConnectionStatus<enum_MultiplayerPeer_ConnectionStatus>` **get_connection_status** **(** **)** |const|
:ref:`ConnectionStatus<enum_MultiplayerPeer_ConnectionStatus>` **get_connection_status**\ (\ ) |const|
Returns the current state of the connection. See :ref:`ConnectionStatus<enum_MultiplayerPeer_ConnectionStatus>`.
@@ -330,7 +333,7 @@ Returns the current state of the connection. See :ref:`ConnectionStatus<enum_Mul
.. rst-class:: classref-method
:ref:`int<class_int>` **get_packet_channel** **(** **)** |const|
:ref:`int<class_int>` **get_packet_channel**\ (\ ) |const|
Returns the channel over which the next available packet was received. See :ref:`PacketPeer.get_available_packet_count<class_PacketPeer_method_get_available_packet_count>`.
@@ -342,7 +345,7 @@ Returns the channel over which the next available packet was received. See :ref:
.. rst-class:: classref-method
:ref:`TransferMode<enum_MultiplayerPeer_TransferMode>` **get_packet_mode** **(** **)** |const|
:ref:`TransferMode<enum_MultiplayerPeer_TransferMode>` **get_packet_mode**\ (\ ) |const|
Returns the transfer mode the remote peer used to send the next available packet. See :ref:`PacketPeer.get_available_packet_count<class_PacketPeer_method_get_available_packet_count>`.
@@ -354,7 +357,7 @@ Returns the transfer mode the remote peer used to send the next available packet
.. rst-class:: classref-method
:ref:`int<class_int>` **get_packet_peer** **(** **)** |const|
:ref:`int<class_int>` **get_packet_peer**\ (\ ) |const|
Returns the ID of the **MultiplayerPeer** who sent the next available packet. See :ref:`PacketPeer.get_available_packet_count<class_PacketPeer_method_get_available_packet_count>`.
@@ -366,7 +369,7 @@ Returns the ID of the **MultiplayerPeer** who sent the next available packet. Se
.. rst-class:: classref-method
:ref:`int<class_int>` **get_unique_id** **(** **)** |const|
:ref:`int<class_int>` **get_unique_id**\ (\ ) |const|
Returns the ID of this **MultiplayerPeer**.
@@ -378,7 +381,7 @@ Returns the ID of this **MultiplayerPeer**.
.. rst-class:: classref-method
:ref:`bool<class_bool>` **is_server_relay_supported** **(** **)** |const|
:ref:`bool<class_bool>` **is_server_relay_supported**\ (\ ) |const|
Returns true if the server can act as a relay in the current configuration (i.e. if the higher level :ref:`MultiplayerAPI<class_MultiplayerAPI>` should notify connected clients of other peers, and implement a relay protocol to allow communication between them).
@@ -390,7 +393,7 @@ Returns true if the server can act as a relay in the current configuration (i.e.
.. rst-class:: classref-method
void **poll** **(** **)**
|void| **poll**\ (\ )
Waits up to 1 second to receive a new network event.
@@ -402,7 +405,7 @@ Waits up to 1 second to receive a new network event.
.. rst-class:: classref-method
void **set_target_peer** **(** :ref:`int<class_int>` id **)**
|void| **set_target_peer**\ (\ id\: :ref:`int<class_int>`\ )
Sets the peer to which packets will be sent.
@@ -415,3 +418,4 @@ The ``id`` can be one of: :ref:`TARGET_PEER_BROADCAST<class_MultiplayerPeer_cons
.. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
.. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
.. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
.. |void| replace:: :abbr:`void (No return value.)`