Browse Source

[Net] Rename RPCConfig.sync to call_local.

For consistency with the other user facing changes.
Fabio Alessandrelli 3 years ago
parent
commit
54ec66a700

+ 1 - 1
core/multiplayer/multiplayer.h

@@ -52,7 +52,7 @@ enum RPCMode {
 struct RPCConfig {
 struct RPCConfig {
 	StringName name;
 	StringName name;
 	RPCMode rpc_mode = RPC_MODE_DISABLED;
 	RPCMode rpc_mode = RPC_MODE_DISABLED;
-	bool sync = false;
+	bool call_local = false;
 	TransferMode transfer_mode = TRANSFER_MODE_RELIABLE;
 	TransferMode transfer_mode = TRANSFER_MODE_RELIABLE;
 	int channel = 0;
 	int channel = 0;
 
 

+ 3 - 3
core/multiplayer/rpc_manager.cpp

@@ -476,9 +476,9 @@ void RPCManager::rpcp(Node *p_node, int p_peer_id, const StringName &p_method, c
 			vformat("Unable to get the RPC configuration for the function \"%s\" at path: \"%s\". This happens when the method is not marked for RPCs.", p_method, p_node->get_path()));
 			vformat("Unable to get the RPC configuration for the function \"%s\" at path: \"%s\". This happens when the method is not marked for RPCs.", p_method, p_node->get_path()));
 	if (p_peer_id == 0 || p_peer_id == node_id || (p_peer_id < 0 && p_peer_id != -node_id)) {
 	if (p_peer_id == 0 || p_peer_id == node_id || (p_peer_id < 0 && p_peer_id != -node_id)) {
 		if (rpc_id & (1 << 15)) {
 		if (rpc_id & (1 << 15)) {
-			call_local_native = config.sync;
+			call_local_native = config.call_local;
 		} else {
 		} else {
-			call_local_script = config.sync;
+			call_local_script = config.call_local;
 		}
 		}
 	}
 	}
 
 
@@ -521,5 +521,5 @@ void RPCManager::rpcp(Node *p_node, int p_peer_id, const StringName &p_method, c
 		}
 		}
 	}
 	}
 
 
-	ERR_FAIL_COND_MSG(p_peer_id == node_id && !config.sync, "RPC '" + p_method + "' on yourself is not allowed by selected mode.");
+	ERR_FAIL_COND_MSG(p_peer_id == node_id && !config.call_local, "RPC '" + p_method + "' on yourself is not allowed by selected mode.");
 }
 }

+ 2 - 2
modules/gdscript/gdscript_parser.cpp

@@ -3490,9 +3490,9 @@ bool GDScriptParser::network_annotations(const AnnotationNode *p_annotation, Nod
 			} else if (mode == "authority") {
 			} else if (mode == "authority") {
 				rpc_config.rpc_mode = Multiplayer::RPC_MODE_AUTHORITY;
 				rpc_config.rpc_mode = Multiplayer::RPC_MODE_AUTHORITY;
 			} else if (mode == "call_local") {
 			} else if (mode == "call_local") {
-				rpc_config.sync = true;
+				rpc_config.call_local = true;
 			} else if (mode == "call_remote") {
 			} else if (mode == "call_remote") {
-				rpc_config.sync = false;
+				rpc_config.call_local = false;
 			} else if (mode == "reliable") {
 			} else if (mode == "reliable") {
 				rpc_config.transfer_mode = Multiplayer::TRANSFER_MODE_RELIABLE;
 				rpc_config.transfer_mode = Multiplayer::TRANSFER_MODE_RELIABLE;
 			} else if (mode == "unreliable") {
 			} else if (mode == "unreliable") {