Is my understanding of RPCs correct?

Godot Version

4.3.stable

Question

Hello, I have made a simple debug RPC function that does the following:

@rpc
func print_to_console():
	print("---",\
		"\n rpc sender peer:        ", multiplayer.get_remote_sender_id(),\
		"\n rpc receiver peer:      ", multiplayer.get_unique_id(),\
		"\n node executing the rpc: ", name ,\
		"\n node's authority peer:  ", get_multiplayer_authority(),\
		"\n---")

If I understand correctly:

  • if the mode is authority, then if sender peer != node's authority, then the call will throw an error
  • if the mode is any_peer, then the call is allowed even if sender peer != node's authority
  • if the sync is call_local, the call will be executed locally and remotely (sender peer == receiver peer will appear)
  • if the sync is call_remote, the call will be executed to all remote peers but not on the local (sender peer == receiver peer cannot appear)

Is that correct?
Thank you for your help

That is all exactly correct.

That’s correct comrade. Great work!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.