diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-11-01 20:35:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-01 20:35:04 +0100 |
commit | 0a0e99cadc6e250ff2ee27ef31760eb9c2e21040 (patch) | |
tree | f790d365bebbfad3c39b96c7b879c9cd6f6506f2 /doc | |
parent | e6751549cf7247965d1744b8c464f5e901006f21 (diff) | |
parent | 39f3d9d59e80d5a9f62925abca596d87ce1e4d0f (diff) |
Merge pull request #67982 from Faless/mp/4.x_disconnect_close
[MP] Add MultiplayerPeer disconnect_peer, close.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/classes/MultiplayerPeer.xml | 16 | ||||
-rw-r--r-- | doc/classes/MultiplayerPeerExtension.xml | 14 |
2 files changed, 29 insertions, 1 deletions
diff --git a/doc/classes/MultiplayerPeer.xml b/doc/classes/MultiplayerPeer.xml index ba6c60a088..6661fbfe0b 100644 --- a/doc/classes/MultiplayerPeer.xml +++ b/doc/classes/MultiplayerPeer.xml @@ -13,6 +13,20 @@ <link title="WebRTC Signaling Demo">https://godotengine.org/asset-library/asset/537</link> </tutorials> <methods> + <method name="close"> + <return type="void" /> + <description> + Immediately close the multiplayer peer returning to the state [constant CONNECTION_DISCONNECTED]. Connected peers will be dropped without emitting [signal peer_disconnected]. + </description> + </method> + <method name="disconnect_peer"> + <return type="void" /> + <param index="0" name="peer" type="int" /> + <param index="1" name="force" type="bool" default="false" /> + <description> + Disconnects the given [param peer] from this host. If [param force] is [code]true[/code] the [signal peer_disconnected] signal will not be emitted for this peer. + </description> + </method> <method name="generate_unique_id" qualifiers="const"> <return type="int" /> <description> @@ -79,7 +93,7 @@ [b]Note:[/b] The default channel ([code]0[/code]) actually works as 3 separate channels (one for each [enum TransferMode]) so that [constant TRANSFER_MODE_RELIABLE] and [constant TRANSFER_MODE_UNRELIABLE_ORDERED] does not interact with each other by default. Refer to the specific network API documentation (e.g. ENet or WebRTC) to learn how to set up channels correctly. </member> <member name="transfer_mode" type="int" setter="set_transfer_mode" getter="get_transfer_mode" enum="MultiplayerPeer.TransferMode" default="2"> - The manner in which to send packets to the [code]target_peer[/code]. See [enum TransferMode]. + The manner in which to send packets to the target peer. See [enum TransferMode], and the [method set_target_peer] method. </member> </members> <signals> diff --git a/doc/classes/MultiplayerPeerExtension.xml b/doc/classes/MultiplayerPeerExtension.xml index 18bc18e6e7..5717135b80 100644 --- a/doc/classes/MultiplayerPeerExtension.xml +++ b/doc/classes/MultiplayerPeerExtension.xml @@ -9,6 +9,20 @@ <tutorials> </tutorials> <methods> + <method name="_close" qualifiers="virtual"> + <return type="void" /> + <description> + Called when the multiplayer peer should be immediately closed (see [method MultiplayerPeer.close]). + </description> + </method> + <method name="_disconnect_peer" qualifiers="virtual"> + <return type="void" /> + <param index="0" name="p_peer" type="int" /> + <param index="1" name="p_force" type="bool" /> + <description> + Called when the connected [param p_peer] should be forcibly disconnected (see [method MultiplayerPeer.disconnect_peer]). + </description> + </method> <method name="_get_available_packet_count" qualifiers="virtual const"> <return type="int" /> <description> |