why server can call local master func by rpc

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By cn_sky
master func send_message_to_server(meaasge):
	var id = str(get_tree().get_rpc_sender_id())
	printf('message_on_server   '+id+":"+meaasge)
func _on_MessageLineEdit_text_entered(new_text):

why the master func can be called when a server call _on_MessageLineEdit_text_entered,
and if i have a puppet func,it can be called locally by client,what is the difference between this and mastersync or puppetsync?

:bust_in_silhouette: Reply From: GeorgeLovesJesus

Hey cn_sky,
Take a look at the following:

Scroll down and you will find this:
"This keyword is one of many that allow a function to be called by a remote procedure call (RPC). There are six of them total:


Each of them designate who can call the rpc, and optionally sync if the RPC can be called locally."

It explains why the master func is called on a similar occasion. If you scroll more down or up you will find more about the other types of rpc.

master func means the func can only be called by puppet,but why the server can call master func? shouldn’t the server be the master? master can call master func?

cn_sky | 2023-01-31 04:17