From 9d7cbfd9a0f52a5e1fc6bedcd21427aa614ae956 Mon Sep 17 00:00:00 2001 From: scotmcp <79280460+scotmcp@users.noreply.github.com> Date: Sat, 13 Jan 2024 12:26:29 -0500 Subject: [PATCH] Update high_level_multiplayer.rst (#8697) * Update high_level_multiplayer.rst Clarifying RPC checksum, and how all RPCs on a script must have matching partners on the target peer's script as well. --------- Co-authored-by: Max Hilbrunner Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> --- .../networking/high_level_multiplayer.rst | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tutorials/networking/high_level_multiplayer.rst b/tutorials/networking/high_level_multiplayer.rst index 973a34165..9bac86d50 100644 --- a/tutorials/networking/high_level_multiplayer.rst +++ b/tutorials/networking/high_level_multiplayer.rst @@ -199,12 +199,22 @@ must have the same name. When using ``add_child()`` for nodes which are expected .. warning:: If a function is annotated with ``@rpc`` on the client script (resp. server script), - then this function must also be declared on the server script (resp. client script), - and both must have the same signature, **even if this function is not currently used**. + then this function must also be declared on the server script (resp. client script). + Both RPCs must have the same signature which is evaluated with a checksum of **all RPCs**. + All RPCs in a script are checked at once, and all RPCs must be declared on both the client + scripts and the server scripts, **even functions that are currently not in use**. - If these conditions are not fulfilled, the script may print an error or - cause unwanted behavior. See further explanation and troubleshooting on - `this post `__. + The signature of the RPC includes the ``@rpc()`` declaration, the function, return type, + AND the nodepath. If an RPC resides in a script attached to ``/root/Main/Node1``, then it + must reside in precisely the same path and node on both the client script and the server + script. Function arguments (example: ``func sendstuff():`` and ``func sendstuff(arg1, arg2):`` + **will pass** signature matching). + + If these conditions are not met (if all RPCs do not pass signature matching), the script may print an + error or cause unwanted behavior. The error message may be unrelated to the RPC function you are + currently building and testing. + + See further explanation and troubleshooting on `this post `__. The annotation can take a number of arguments, which have default values. ``@rpc`` is equivalent to: