What does the input arguments for @rpc() mean?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By GrandNecro

I can’t seem to find any documentation on the new rpc annotation in gd4.

Like what does the keywords “authority”, “any_peer”, “call_remote”, “call_local” actually mean?

From my understanding, “authority” means only the server can call the function and “any_peer” means any client can call the function?
And “call_remote” doesn’t execute the function on the current client, while “call_local” does?

This is my first time doling multiplayer so my background on networking is very limited.

:bust_in_silhouette: Reply From: Vespiria

So I’m just learning this stuff myself, but from what I understand:

“call_local” means it will only run locally on the machine the script itself is on.
“call_remote” is to only run it remotely on other machines.
“any_peer” allows any connected peer to call.
“authority” only allows the authoritative peer aka the one in control of the game state to call it.

So I think you’re right.