diff options
author | Yuri Sizov <11782833+YuriSizov@users.noreply.github.com> | 2023-02-04 18:43:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-04 18:43:15 +0300 |
commit | 8753b07b0561cfc8debce8d84421d19120ea9b0b (patch) | |
tree | 58e7d0fb34e4fd6cb3cd40592eaecda288f687c1 /doc/classes | |
parent | 0b1d516f67a3b2b7dd158b923559f192ec103a85 (diff) | |
parent | 54f2226ce5db04877d072e7c44add6c6a7e141d2 (diff) |
Merge pull request #71860 from GeroVeni/master
Improve docs for rpc annotations
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/Callable.xml | 4 | ||||
-rw-r--r-- | doc/classes/Node.xml | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/doc/classes/Callable.xml b/doc/classes/Callable.xml index 8fc44d7536..50be9b86bf 100644 --- a/doc/classes/Callable.xml +++ b/doc/classes/Callable.xml @@ -173,14 +173,14 @@ <method name="rpc" qualifiers="vararg const"> <return type="void" /> <description> - Perform an RPC (Remote Procedure Call). This is used for multiplayer and is normally not available, unless the function being called has been marked as [i]RPC[/i]. Calling this method on unsupported functions will result in an error. + Perform an RPC (Remote Procedure Call). This is used for multiplayer and is normally not available, unless the function being called has been marked as [i]RPC[/i]. Calling this method on unsupported functions will result in an error. See [method Node.rpc]. </description> </method> <method name="rpc_id" qualifiers="vararg const"> <return type="void" /> <param index="0" name="peer_id" type="int" /> <description> - Perform an RPC (Remote Procedure Call) on a specific peer ID (see multiplayer documentation for reference). This is used for multiplayer and is normally not available unless the function being called has been marked as [i]RPC[/i]. Calling this method on unsupported functions will result in an error. + Perform an RPC (Remote Procedure Call) on a specific peer ID (see multiplayer documentation for reference). This is used for multiplayer and is normally not available unless the function being called has been marked as [i]RPC[/i]. Calling this method on unsupported functions will result in an error. See [method Node.rpc_id]. </description> </method> <method name="unbind" qualifiers="const"> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 7c40c189c0..22665c8ffb 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -648,7 +648,7 @@ <return type="int" enum="Error" /> <param index="0" name="method" type="StringName" /> <description> - Sends a remote procedure call request for the given [param method] to peers on the network (and locally), optionally sending all additional arguments as arguments to the method called by the RPC. The call request will only be received by nodes with the same [NodePath], including the exact same node name. Behavior depends on the RPC configuration for the given method, see [method rpc_config]. Methods are not exposed to RPCs by default. Returns [code]null[/code]. + Sends a remote procedure call request for the given [param method] to peers on the network (and locally), optionally sending all additional arguments as arguments to the method called by the RPC. The call request will only be received by nodes with the same [NodePath], including the exact same node name. Behavior depends on the RPC configuration for the given method, see [method rpc_config] and [annotation @GDScript.@rpc]. Methods are not exposed to RPCs by default. Returns [code]null[/code]. [b]Note:[/b] You can only safely use RPCs on clients after you received the [code]connected_to_server[/code] signal from the [MultiplayerAPI]. You also need to keep track of the connection state, either by the [MultiplayerAPI] signals like [code]server_disconnected[/code] or by checking [code]get_multiplayer().peer.get_connection_status() == CONNECTION_CONNECTED[/code]. </description> </method> @@ -666,7 +666,7 @@ channel = 0, } [/codeblock] - 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("authority")[/code]). By default, methods are not exposed to networking (and RPCs). + See [enum MultiplayerAPI.RPCMode] and [enum MultiplayerPeer.TransferMode]. An alternative is annotating methods and properties with the corresponding [annotation @GDScript.@rpc] annotation ([code]@rpc(any_peer)[/code], [code]@rpc(authority)[/code]). By default, methods are not exposed to networking (and RPCs). </description> </method> <method name="rpc_id" qualifiers="vararg"> |