Browse Source

Clearly deprecate sync too in favor of remotesync.

NOTE: This changes the RPC_MODE_* enum values.
Games should be re-exported. GDNative rebuilt.
Fabio Alessandrelli 7 years ago
parent
commit
1e9b46d687

+ 3 - 7
core/io/multiplayer_api.cpp

@@ -45,8 +45,7 @@ _FORCE_INLINE_ bool _should_call_local(MultiplayerAPI::RPCMode mode, bool is_mas
 		} break;
 		} break;
 		case MultiplayerAPI::RPC_MODE_REMOTESYNC:
 		case MultiplayerAPI::RPC_MODE_REMOTESYNC:
 		case MultiplayerAPI::RPC_MODE_MASTERSYNC:
 		case MultiplayerAPI::RPC_MODE_MASTERSYNC:
-		case MultiplayerAPI::RPC_MODE_PUPPETSYNC:
-		case MultiplayerAPI::RPC_MODE_SYNC: {
+		case MultiplayerAPI::RPC_MODE_PUPPETSYNC: {
 			//call it, sync always results in call
 			//call it, sync always results in call
 			return true;
 			return true;
 		} break;
 		} break;
@@ -68,11 +67,8 @@ _FORCE_INLINE_ bool _can_call_mode(Node *p_node, MultiplayerAPI::RPCMode mode, i
 		case MultiplayerAPI::RPC_MODE_DISABLED: {
 		case MultiplayerAPI::RPC_MODE_DISABLED: {
 			return false;
 			return false;
 		} break;
 		} break;
-		case MultiplayerAPI::RPC_MODE_REMOTE: {
-			return true;
-		} break;
-		case MultiplayerAPI::RPC_MODE_REMOTESYNC:
-		case MultiplayerAPI::RPC_MODE_SYNC: {
+		case MultiplayerAPI::RPC_MODE_REMOTE:
+		case MultiplayerAPI::RPC_MODE_REMOTESYNC: {
 			return true;
 			return true;
 		} break;
 		} break;
 		case MultiplayerAPI::RPC_MODE_MASTERSYNC:
 		case MultiplayerAPI::RPC_MODE_MASTERSYNC:

+ 2 - 2
core/io/multiplayer_api.h

@@ -91,11 +91,11 @@ public:
 
 
 		RPC_MODE_DISABLED, // No rpc for this method, calls to this will be blocked (default)
 		RPC_MODE_DISABLED, // No rpc for this method, calls to this will be blocked (default)
 		RPC_MODE_REMOTE, // Using rpc() on it will call method / set property in all remote peers
 		RPC_MODE_REMOTE, // Using rpc() on it will call method / set property in all remote peers
-		RPC_MODE_SYNC, // Using rpc() on it will call method / set property in all remote peers and locally
 		RPC_MODE_MASTER, // Using rpc() on it will call method on wherever the master is, be it local or remote
 		RPC_MODE_MASTER, // Using rpc() on it will call method on wherever the master is, be it local or remote
 		RPC_MODE_PUPPET, // Using rpc() on it will call method for all puppets
 		RPC_MODE_PUPPET, // Using rpc() on it will call method for all puppets
 		RPC_MODE_SLAVE = RPC_MODE_PUPPET, // Deprecated, same as puppet
 		RPC_MODE_SLAVE = RPC_MODE_PUPPET, // Deprecated, same as puppet
-		RPC_MODE_REMOTESYNC, // Same as RPC_MODE_SYNC, compatibility
+		RPC_MODE_REMOTESYNC, // Using rpc() on it will call method / set property in all remote peers and locally
+		RPC_MODE_SYNC = RPC_MODE_REMOTESYNC, // Deprecated. Same as RPC_MODE_REMOTESYNC
 		RPC_MODE_MASTERSYNC, // Using rpc() on it will call method / set property in the master peer and locally
 		RPC_MODE_MASTERSYNC, // Using rpc() on it will call method / set property in the master peer and locally
 		RPC_MODE_PUPPETSYNC, // Using rpc() on it will call method / set property in all puppets peers and locally
 		RPC_MODE_PUPPETSYNC, // Using rpc() on it will call method / set property in all puppets peers and locally
 	};
 	};

+ 11 - 11
doc/classes/MultiplayerAPI.xml

@@ -143,25 +143,25 @@
 		<constant name="RPC_MODE_REMOTE" value="1" enum="RPCMode">
 		<constant name="RPC_MODE_REMOTE" value="1" enum="RPCMode">
 			Used with [method Node.rpc_config] or [method Node.rset_config] to set a method to be called or a property to be changed only on the remote end, not locally. Analogous to the [code]remote[/code] keyword. Calls and property changes are accepted from all remote peers, no matter if they are node's master or puppets.
 			Used with [method Node.rpc_config] or [method Node.rset_config] to set a method to be called or a property to be changed only on the remote end, not locally. Analogous to the [code]remote[/code] keyword. Calls and property changes are accepted from all remote peers, no matter if they are node's master or puppets.
 		</constant>
 		</constant>
-		<constant name="RPC_MODE_SYNC" value="2" enum="RPCMode">
-			Behave like [code]RPC_MODE_REMOTE[/code] but also make the call or property change locally. Analogous to the [code]sync[/code] keyword.
-		</constant>
-		<constant name="RPC_MODE_MASTER" value="3" enum="RPCMode">
+		<constant name="RPC_MODE_MASTER" value="2" enum="RPCMode">
 			Used with [method Node.rpc_config] or [method Node.rset_config] to set a method to be called or a property to be changed only on the network master for this node. Analogous to the [code]master[/code] keyword. Only accepts calls or property changes from the node's network puppets, see [method Node.set_network_master].
 			Used with [method Node.rpc_config] or [method Node.rset_config] to set a method to be called or a property to be changed only on the network master for this node. Analogous to the [code]master[/code] keyword. Only accepts calls or property changes from the node's network puppets, see [method Node.set_network_master].
 		</constant>
 		</constant>
-		<constant name="RPC_MODE_PUPPET" value="4" enum="RPCMode">
+		<constant name="RPC_MODE_PUPPET" value="3" enum="RPCMode">
 			Used with [method Node.rpc_config] or [method Node.rset_config] to set a method to be called or a property to be changed only on puppets for this node. Analogous to the [code]puppet[/code] keyword. Only accepts calls or property changes from the node's network master, see [method Node.set_network_master].
 			Used with [method Node.rpc_config] or [method Node.rset_config] to set a method to be called or a property to be changed only on puppets for this node. Analogous to the [code]puppet[/code] keyword. Only accepts calls or property changes from the node's network master, see [method Node.set_network_master].
 		</constant>
 		</constant>
-		<constant name="RPC_MODE_SLAVE" value="4" enum="RPCMode">
-			Deprecated. Use [code]RPC_MODE_PUPPET[/code] instead.
+		<constant name="RPC_MODE_SLAVE" value="3" enum="RPCMode">
+			Deprecated. Use [code]RPC_MODE_PUPPET[/code] instead. Analogous to the [code]slave[/code] keyword.
+		</constant>
+		<constant name="RPC_MODE_REMOTESYNC" value="4" enum="RPCMode">
+			Behave like [code]RPC_MODE_REMOTE[/code] but also make the call or property change locally. Analogous to the [code]remotesync[/code] keyword.
 		</constant>
 		</constant>
-		<constant name="RPC_MODE_REMOTESYNC" value="5" enum="RPCMode">
-			Behave like [code]RPC_MODE_REMOTE[/code] but also make the call or property change locally. Same as [code]RPC_MODE_SYNC[/code] which is only kept for compatibility. Analogous to the [code]remotesync[/code] keyword.
+		<constant name="RPC_MODE_SYNC" value="4" enum="RPCMode">
+			Deprecated. Use [code]RPC_MODE_REMOTESYNC[/code] instead. Analogous to the [code]sync[/code] keyword.
 		</constant>
 		</constant>
-		<constant name="RPC_MODE_MASTERSYNC" value="6" enum="RPCMode">
+		<constant name="RPC_MODE_MASTERSYNC" value="5" enum="RPCMode">
 			Behave like [code]RPC_MODE_MASTER[/code] but also make the call or property change locally. Analogous to the [code]mastersync[/code] keyword.
 			Behave like [code]RPC_MODE_MASTER[/code] but also make the call or property change locally. Analogous to the [code]mastersync[/code] keyword.
 		</constant>
 		</constant>
-		<constant name="RPC_MODE_PUPPETSYNC" value="7" enum="RPCMode">
+		<constant name="RPC_MODE_PUPPETSYNC" value="6" enum="RPCMode">
 			Behave like [code]RPC_MODE_PUPPET[/code] but also make the call or property change locally. Analogous to the [code]puppetsync[/code] keyword.
 			Behave like [code]RPC_MODE_PUPPET[/code] but also make the call or property change locally. Analogous to the [code]puppetsync[/code] keyword.
 		</constant>
 		</constant>
 	</constants>
 	</constants>

+ 2 - 2
doc/classes/Node.xml

@@ -582,7 +582,7 @@
 			<argument index="1" name="mode" type="int" enum="MultiplayerAPI.RPCMode">
 			<argument index="1" name="mode" type="int" enum="MultiplayerAPI.RPCMode">
 			</argument>
 			</argument>
 			<description>
 			<description>
-				Changes the RPC mode for the given [code]method[/code] to the given [code]mode[/code]. See [enum MultiplayerAPI.RPCMode]. An alternative is annotating methods and properties with the corresponding keywords ([code]remote[/code], [code]sync[/code], [code]master[/code], [code]puppet[/code]). By default, methods are not exposed to networking (and RPCs). Also see [method rset] and [method rset_config] for properties.
+				Changes the RPC mode for the given [code]method[/code] to the given [code]mode[/code]. See [enum MultiplayerAPI.RPCMode]. An alternative is annotating methods and properties with the corresponding keywords ([code]remote[/code], [code]master[/code], [code]puppet[/code], [code]remotesync[/code], [code]mastersync[/code], [code]puppetsync[/code]). By default, methods are not exposed to networking (and RPCs). Also see [method rset] and [method rset_config] for properties.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="rpc_id" qualifiers="vararg">
 		<method name="rpc_id" qualifiers="vararg">
@@ -635,7 +635,7 @@
 			<argument index="1" name="mode" type="int" enum="MultiplayerAPI.RPCMode">
 			<argument index="1" name="mode" type="int" enum="MultiplayerAPI.RPCMode">
 			</argument>
 			</argument>
 			<description>
 			<description>
-				Changes the RPC mode for the given [code]property[/code] to the given [code]mode[/code]. See [enum MultiplayerAPI.RPCMode]. An alternative is annotating methods and properties with the corresponding keywords ([code]remote[/code], [code]sync[/code], [code]master[/code], [code]puppet[/code]). By default, properties are not exposed to networking (and RPCs). Also see [method rpc] and [method rpc_config] for methods.
+				Changes the RPC mode for the given [code]property[/code] to the given [code]mode[/code]. See [enum MultiplayerAPI.RPCMode]. An alternative is annotating methods and properties with the corresponding keywords ([code]remote[/code], [code]master[/code], [code]puppet[/code], [code]remotesync[/code], [code]mastersync[/code], [code]puppetsync[/code]). By default, properties are not exposed to networking (and RPCs). Also see [method rpc] and [method rpc_config] for methods.
 			</description>
 			</description>
 		</method>
 		</method>
 		<method name="rset_id">
 		<method name="rset_id">

+ 1 - 1
modules/gdnative/include/nativescript/godot_nativescript.h

@@ -40,11 +40,11 @@ extern "C" {
 typedef enum {
 typedef enum {
 	GODOT_METHOD_RPC_MODE_DISABLED,
 	GODOT_METHOD_RPC_MODE_DISABLED,
 	GODOT_METHOD_RPC_MODE_REMOTE,
 	GODOT_METHOD_RPC_MODE_REMOTE,
-	GODOT_METHOD_RPC_MODE_SYNC,
 	GODOT_METHOD_RPC_MODE_MASTER,
 	GODOT_METHOD_RPC_MODE_MASTER,
 	GODOT_METHOD_RPC_MODE_PUPPET,
 	GODOT_METHOD_RPC_MODE_PUPPET,
 	GODOT_METHOD_RPC_MODE_SLAVE = GODOT_METHOD_RPC_MODE_PUPPET,
 	GODOT_METHOD_RPC_MODE_SLAVE = GODOT_METHOD_RPC_MODE_PUPPET,
 	GODOT_METHOD_RPC_MODE_REMOTESYNC,
 	GODOT_METHOD_RPC_MODE_REMOTESYNC,
+	GODOT_METHOD_RPC_MODE_SYNC = GODOT_METHOD_RPC_MODE_REMOTESYNC,
 	GODOT_METHOD_RPC_MODE_MASTERSYNC,
 	GODOT_METHOD_RPC_MODE_MASTERSYNC,
 	GODOT_METHOD_RPC_MODE_PUPPETSYNC,
 	GODOT_METHOD_RPC_MODE_PUPPETSYNC,
 } godot_method_rpc_mode;
 } godot_method_rpc_mode;

+ 6 - 4
modules/gdnative/nativescript/nativescript.cpp

@@ -810,8 +810,6 @@ MultiplayerAPI::RPCMode NativeScriptInstance::get_rpc_mode(const StringName &p_m
 					return MultiplayerAPI::RPC_MODE_DISABLED;
 					return MultiplayerAPI::RPC_MODE_DISABLED;
 				case GODOT_METHOD_RPC_MODE_REMOTE:
 				case GODOT_METHOD_RPC_MODE_REMOTE:
 					return MultiplayerAPI::RPC_MODE_REMOTE;
 					return MultiplayerAPI::RPC_MODE_REMOTE;
-				case GODOT_METHOD_RPC_MODE_SYNC:
-					return MultiplayerAPI::RPC_MODE_SYNC;
 				case GODOT_METHOD_RPC_MODE_MASTER:
 				case GODOT_METHOD_RPC_MODE_MASTER:
 					return MultiplayerAPI::RPC_MODE_MASTER;
 					return MultiplayerAPI::RPC_MODE_MASTER;
 				case GODOT_METHOD_RPC_MODE_PUPPET:
 				case GODOT_METHOD_RPC_MODE_PUPPET:
@@ -846,12 +844,16 @@ MultiplayerAPI::RPCMode NativeScriptInstance::get_rset_mode(const StringName &p_
 					return MultiplayerAPI::RPC_MODE_DISABLED;
 					return MultiplayerAPI::RPC_MODE_DISABLED;
 				case GODOT_METHOD_RPC_MODE_REMOTE:
 				case GODOT_METHOD_RPC_MODE_REMOTE:
 					return MultiplayerAPI::RPC_MODE_REMOTE;
 					return MultiplayerAPI::RPC_MODE_REMOTE;
-				case GODOT_METHOD_RPC_MODE_SYNC:
-					return MultiplayerAPI::RPC_MODE_SYNC;
 				case GODOT_METHOD_RPC_MODE_MASTER:
 				case GODOT_METHOD_RPC_MODE_MASTER:
 					return MultiplayerAPI::RPC_MODE_MASTER;
 					return MultiplayerAPI::RPC_MODE_MASTER;
 				case GODOT_METHOD_RPC_MODE_PUPPET:
 				case GODOT_METHOD_RPC_MODE_PUPPET:
 					return MultiplayerAPI::RPC_MODE_PUPPET;
 					return MultiplayerAPI::RPC_MODE_PUPPET;
+				case GODOT_METHOD_RPC_MODE_REMOTESYNC:
+					return MultiplayerAPI::RPC_MODE_REMOTESYNC;
+				case GODOT_METHOD_RPC_MODE_MASTERSYNC:
+					return MultiplayerAPI::RPC_MODE_MASTERSYNC;
+				case GODOT_METHOD_RPC_MODE_PUPPETSYNC:
+					return MultiplayerAPI::RPC_MODE_PUPPETSYNC;
 				default:
 				default:
 					return MultiplayerAPI::RPC_MODE_DISABLED;
 					return MultiplayerAPI::RPC_MODE_DISABLED;
 			}
 			}

+ 1 - 1
modules/gdscript/gdscript_parser.cpp

@@ -4476,7 +4476,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
 					return;
 					return;
 				}
 				}
 
 
-				rpc_mode = MultiplayerAPI::RPC_MODE_SYNC;
+				rpc_mode = MultiplayerAPI::RPC_MODE_REMOTESYNC;
 				continue;
 				continue;
 			} break;
 			} break;
 			case GDScriptTokenizer::TK_PR_MASTERSYNC: {
 			case GDScriptTokenizer::TK_PR_MASTERSYNC: {

+ 2 - 2
modules/mono/csharp_script.cpp

@@ -1541,8 +1541,6 @@ MultiplayerAPI::RPCMode CSharpInstance::_member_get_rpc_mode(GDMonoClassMember *
 
 
 	if (p_member->has_attribute(CACHED_CLASS(RemoteAttribute)))
 	if (p_member->has_attribute(CACHED_CLASS(RemoteAttribute)))
 		return MultiplayerAPI::RPC_MODE_REMOTE;
 		return MultiplayerAPI::RPC_MODE_REMOTE;
-	if (p_member->has_attribute(CACHED_CLASS(SyncAttribute)))
-		return MultiplayerAPI::RPC_MODE_SYNC;
 	if (p_member->has_attribute(CACHED_CLASS(MasterAttribute)))
 	if (p_member->has_attribute(CACHED_CLASS(MasterAttribute)))
 		return MultiplayerAPI::RPC_MODE_MASTER;
 		return MultiplayerAPI::RPC_MODE_MASTER;
 	if (p_member->has_attribute(CACHED_CLASS(PuppetAttribute)))
 	if (p_member->has_attribute(CACHED_CLASS(PuppetAttribute)))
@@ -1551,6 +1549,8 @@ MultiplayerAPI::RPCMode CSharpInstance::_member_get_rpc_mode(GDMonoClassMember *
 		return MultiplayerAPI::RPC_MODE_PUPPET;
 		return MultiplayerAPI::RPC_MODE_PUPPET;
 	if (p_member->has_attribute(CACHED_CLASS(RemoteSyncAttribute)))
 	if (p_member->has_attribute(CACHED_CLASS(RemoteSyncAttribute)))
 		return MultiplayerAPI::RPC_MODE_REMOTESYNC;
 		return MultiplayerAPI::RPC_MODE_REMOTESYNC;
+	if (p_member->has_attribute(CACHED_CLASS(SyncAttribute)))
+		return MultiplayerAPI::RPC_MODE_REMOTESYNC;
 	if (p_member->has_attribute(CACHED_CLASS(MasterSyncAttribute)))
 	if (p_member->has_attribute(CACHED_CLASS(MasterSyncAttribute)))
 		return MultiplayerAPI::RPC_MODE_MASTERSYNC;
 		return MultiplayerAPI::RPC_MODE_MASTERSYNC;
 	if (p_member->has_attribute(CACHED_CLASS(PuppetSyncAttribute)))
 	if (p_member->has_attribute(CACHED_CLASS(PuppetSyncAttribute)))

+ 0 - 1
modules/opensimplex/doc_classes/SimplexNoise.xml

@@ -22,7 +22,6 @@
 		print(noise.get_noise_3d(0.5,3.0,15.0))
 		print(noise.get_noise_3d(0.5,3.0,15.0))
 		print(noise.get_noise_3d(0.5,1.9,4.7,0.0))
 		print(noise.get_noise_3d(0.5,1.9,4.7,0.0))
 		[/codeblock]
 		[/codeblock]
-
 	</description>
 	</description>
 	<tutorials>
 	<tutorials>
 	</tutorials>
 	</tutorials>

+ 1 - 1
modules/visual_script/visual_script_nodes.cpp

@@ -167,7 +167,7 @@ void VisualScriptFunction::_get_property_list(List<PropertyInfo> *p_list) const
 		p_list->push_back(PropertyInfo(Variant::INT, "stack/size", PROPERTY_HINT_RANGE, "1,100000"));
 		p_list->push_back(PropertyInfo(Variant::INT, "stack/size", PROPERTY_HINT_RANGE, "1,100000"));
 	}
 	}
 	p_list->push_back(PropertyInfo(Variant::BOOL, "stack/stackless"));
 	p_list->push_back(PropertyInfo(Variant::BOOL, "stack/stackless"));
-	p_list->push_back(PropertyInfo(Variant::INT, "rpc/mode", PROPERTY_HINT_ENUM, "Disabled,Remote,Sync,Master,Puppet"));
+	p_list->push_back(PropertyInfo(Variant::INT, "rpc/mode", PROPERTY_HINT_ENUM, "Disabled,Remote,Master,Puppet,Remote Sync,Master Sync,Puppet Sync"));
 }
 }
 
 
 int VisualScriptFunction::get_output_sequence_port_count() const {
 int VisualScriptFunction::get_output_sequence_port_count() const {