summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorMax Hilbrunner <mhilbrunner@users.noreply.github.com>2021-09-07 18:44:39 +0200
committerGitHub <noreply@github.com>2021-09-07 18:44:39 +0200
commitacc776f7b6ca43a6dde59f7355f52a11b9ac72f5 (patch)
tree140eef1d91760a0348d430f94b6bd21c7c1fc40d /doc/classes
parentb284cb908ab5ca51099cc1e1b75689cacccfa229 (diff)
parentbf9aae09ba5eccde7ec355dac96b6a2088fb1a3f (diff)
Merge pull request #52442 from Faless/mp/4.x_rpc_manager
[Net] Move multiplayer classes to own subfolder. Split RPC from MultiplayerAPI.
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/@GlobalScope.xml18
-rw-r--r--doc/classes/MultiplayerAPI.xml13
-rw-r--r--doc/classes/MultiplayerPeer.xml13
-rw-r--r--doc/classes/MultiplayerReplicator.xml2
-rw-r--r--doc/classes/Node.xml6
5 files changed, 26 insertions, 26 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index a18da1cf16..0300511eb1 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -2465,6 +2465,24 @@
<constant name="METHOD_FLAGS_DEFAULT" value="1" enum="MethodFlags">
Default method flags.
</constant>
+ <constant name="RPC_MODE_DISABLED" value="0" enum="RPCMode">
+ Used with [method Node.rpc_config] to disable a method or property for all RPC calls, making it unavailable. Default for all methods.
+ </constant>
+ <constant name="RPC_MODE_ANY" value="1" enum="RPCMode">
+ Used with [method Node.rpc_config] to set a method to be callable remotely by any peer. Analogous to the [code]@rpc(any)[/code] annotation. Calls are accepted from all remote peers, no matter if they are node's authority or not.
+ </constant>
+ <constant name="RPC_MODE_AUTH" value="2" enum="RPCMode">
+ Used with [method Node.rpc_config] to set a method to be callable remotely only by the current network authority (which is the server by default). Analogous to the [code]@rpc(auth)[/code] annotation. See [method Node.set_network_authority].
+ </constant>
+ <constant name="TRANSFER_MODE_UNRELIABLE" value="0" enum="TransferMode">
+ Packets are not acknowledged, no resend attempts are made for lost packets. Packets may arrive in any order. Potentially faster than [constant TRANSFER_MODE_ORDERED]. Use for non-critical data, and always consider whether the order matters.
+ </constant>
+ <constant name="TRANSFER_MODE_ORDERED" value="1" enum="TransferMode">
+ Packets are not acknowledged, no resend attempts are made for lost packets. Packets are received in the order they were sent in. Potentially faster than [constant TRANSFER_MODE_RELIABLE]. Use for non-critical data or data that would be outdated if received late due to resend attempt(s) anyway, for example movement and positional data.
+ </constant>
+ <constant name="TRANSFER_MODE_RELIABLE" value="2" enum="TransferMode">
+ Packets must be received and resend attempts should be made until the packets are acknowledged. Packets must be received in the order they were sent in. Most reliable transfer mode, but potentially the slowest due to the overhead. Use for critical data that must be transmitted and arrive in order, for example an ability being triggered or a chat message. Consider carefully if the information really is critical, and use sparingly.
+ </constant>
<constant name="TYPE_NIL" value="0" enum="Variant.Type">
Variable is [code]null[/code].
</constant>
diff --git a/doc/classes/MultiplayerAPI.xml b/doc/classes/MultiplayerAPI.xml
index 70046fc3e9..9c688f7b8b 100644
--- a/doc/classes/MultiplayerAPI.xml
+++ b/doc/classes/MultiplayerAPI.xml
@@ -30,7 +30,7 @@
Returns the unique peer ID of this MultiplayerAPI's [member network_peer].
</description>
</method>
- <method name="get_rpc_sender_id" qualifiers="const">
+ <method name="get_remote_sender_id" qualifiers="const">
<return type="int" />
<description>
Returns the sender's peer ID for the RPC currently being executed.
@@ -60,7 +60,7 @@
<return type="int" enum="Error" />
<argument index="0" name="bytes" type="PackedByteArray" />
<argument index="1" name="id" type="int" default="0" />
- <argument index="2" name="mode" type="int" enum="MultiplayerPeer.TransferMode" default="2" />
+ <argument index="2" name="mode" type="int" enum="TransferMode" default="2" />
<argument index="3" name="channel" type="int" default="0" />
<description>
Sends the given raw [code]bytes[/code] to a specific peer identified by [code]id[/code] (see [method MultiplayerPeer.set_target_peer]). Default ID is [code]0[/code], i.e. broadcast to all peers.
@@ -122,14 +122,5 @@
</signal>
</signals>
<constants>
- <constant name="RPC_MODE_DISABLED" value="0" enum="RPCMode">
- Used with [method Node.rpc_config] to disable a method or property for all RPC calls, making it unavailable. Default for all methods.
- </constant>
- <constant name="RPC_MODE_ANY" value="1" enum="RPCMode">
- Used with [method Node.rpc_config] to set a method to be callable remotely by any peer. Analogous to the [code]@rpc(any)[/code] annotation. Calls are accepted from all remote peers, no matter if they are node's authority or not.
- </constant>
- <constant name="RPC_MODE_AUTHORITY" value="2" enum="RPCMode">
- Used with [method Node.rpc_config] to set a method to be callable remotely only by the current network authority (which is the server by default). Analogous to the [code]@rpc(auth)[/code] annotation. See [method Node.set_network_authority].
- </constant>
</constants>
</class>
diff --git a/doc/classes/MultiplayerPeer.xml b/doc/classes/MultiplayerPeer.xml
index adaa359168..6ee6fce49f 100644
--- a/doc/classes/MultiplayerPeer.xml
+++ b/doc/classes/MultiplayerPeer.xml
@@ -57,9 +57,9 @@
</member>
<member name="transfer_channel" type="int" setter="set_transfer_channel" getter="get_transfer_channel" default="0">
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 [b]different and independent[/b] state updates is a common way to optimize network usage and decrease latency in fast-paced games.
- [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.
+ [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_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="0">
+ <member name="transfer_mode" type="int" setter="set_transfer_mode" getter="get_transfer_mode" enum="TransferMode" default="0">
The manner in which to send packets to the [code]target_peer[/code]. See [enum TransferMode].
</member>
</members>
@@ -93,15 +93,6 @@
</signal>
</signals>
<constants>
- <constant name="TRANSFER_MODE_UNRELIABLE" value="0" enum="TransferMode">
- Packets are not acknowledged, no resend attempts are made for lost packets. Packets may arrive in any order. Potentially faster than [constant TRANSFER_MODE_UNRELIABLE_ORDERED]. Use for non-critical data, and always consider whether the order matters.
- </constant>
- <constant name="TRANSFER_MODE_UNRELIABLE_ORDERED" value="1" enum="TransferMode">
- Packets are not acknowledged, no resend attempts are made for lost packets. Packets are received in the order they were sent in. Potentially faster than [constant TRANSFER_MODE_RELIABLE]. Use for non-critical data or data that would be outdated if received late due to resend attempt(s) anyway, for example movement and positional data.
- </constant>
- <constant name="TRANSFER_MODE_RELIABLE" value="2" enum="TransferMode">
- Packets must be received and resend attempts should be made until the packets are acknowledged. Packets must be received in the order they were sent in. Most reliable transfer mode, but potentially the slowest due to the overhead. Use for critical data that must be transmitted and arrive in order, for example an ability being triggered or a chat message. Consider carefully if the information really is critical, and use sparingly.
- </constant>
<constant name="CONNECTION_DISCONNECTED" value="0" enum="ConnectionStatus">
The ongoing connection disconnected.
</constant>
diff --git a/doc/classes/MultiplayerReplicator.xml b/doc/classes/MultiplayerReplicator.xml
index 0778a7335f..2657f835c4 100644
--- a/doc/classes/MultiplayerReplicator.xml
+++ b/doc/classes/MultiplayerReplicator.xml
@@ -62,7 +62,7 @@
<argument index="0" name="peer_id" type="int" />
<argument index="1" name="scene_id" type="int" />
<argument index="2" name="data" type="PackedByteArray" />
- <argument index="3" name="transfer_mode" type="int" enum="MultiplayerPeer.TransferMode" default="2" />
+ <argument index="3" name="transfer_mode" type="int" enum="TransferMode" default="2" />
<argument index="4" name="channel" type="int" default="0" />
<description>
Sends a sync request for the instances of the scene identified by [code]scene_id[/code] to the given [code]peer_id[/code] (see [method MultiplayerPeer.set_target_peer]). This function can only be called manually when overriding the send and receive sync functions (see [method sync_config]).
diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml
index 7d79c50466..1f5823c37c 100644
--- a/doc/classes/Node.xml
+++ b/doc/classes/Node.xml
@@ -584,11 +584,11 @@
<method name="rpc_config">
<return type="int" />
<argument index="0" name="method" type="StringName" />
- <argument index="1" name="rpc_mode" type="int" enum="MultiplayerAPI.RPCMode" />
- <argument index="2" name="transfer_mode" type="int" enum="MultiplayerPeer.TransferMode" default="2" />
+ <argument index="1" name="rpc_mode" type="int" enum="RPCMode" />
+ <argument index="2" name="transfer_mode" type="int" enum="TransferMode" default="2" />
<argument index="3" name="channel" type="int" default="0" />
<description>
- Changes the RPC mode for the given [code]method[/code] to the given [code]rpc_mode[/code], optionally specifying the [code]transfer_mode[/code] and [code]channel[/code] (on supported peers). See [enum MultiplayerAPI.RPCMode] and [enum MultiplayerPeer.TransferMode]. An alternative is annotating methods and properties with the corresponding annotation ([code]@rpc(any)[/code], [code]@rpc(auth)[/code]). By default, methods are not exposed to networking (and RPCs).
+ Changes the RPC mode for the given [code]method[/code] to the given [code]rpc_mode[/code], optionally specifying the [code]transfer_mode[/code] and [code]channel[/code] (on supported peers). See [enum RPCMode] and [enum TransferMode]. An alternative is annotating methods and properties with the corresponding annotation ([code]@rpc(any)[/code], [code]@rpc(auth)[/code]). By default, methods are not exposed to networking (and RPCs).
</description>
</method>
<method name="rpc_id" qualifiers="vararg">