diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-10-01 10:43:22 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-10-01 18:14:38 +0200 |
commit | 24a949ea1154a2298e6898c53fdb75178affe098 (patch) | |
tree | ba919baf260751a6aa47467d001fc389cf6e60f4 /modules | |
parent | 8be97e3b51f5adbee0f9f5d3193da53680a44695 (diff) |
[Net] Rename RPC constants and annotation arguments.
any -> any_peer
sync -> call_local
ordered -> unreliable_ordered
Multiplayer.RPC_MODE_ANY -> RPC_MODE_ANY_PEER
Multiplayer.TRANSFER_MODE_ORDERED -> TRANSFER_MODE_UNRELIABLE_ORDERED
Diffstat (limited to 'modules')
-rw-r--r-- | modules/enet/enet_multiplayer_peer.cpp | 2 | ||||
-rw-r--r-- | modules/gdnative/include/nativescript/godot_nativescript.h | 2 | ||||
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 16 | ||||
-rw-r--r-- | modules/mono/csharp_script.cpp | 4 | ||||
-rw-r--r-- | modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttributes.cs | 2 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono_cache.cpp | 4 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono_cache.h | 2 | ||||
-rw-r--r-- | modules/webrtc/webrtc_multiplayer_peer.cpp | 4 |
8 files changed, 18 insertions, 18 deletions
diff --git a/modules/enet/enet_multiplayer_peer.cpp b/modules/enet/enet_multiplayer_peer.cpp index 52eb46f070..2cfae60ad2 100644 --- a/modules/enet/enet_multiplayer_peer.cpp +++ b/modules/enet/enet_multiplayer_peer.cpp @@ -444,7 +444,7 @@ Error ENetMultiplayerPeer::put_packet(const uint8_t *p_buffer, int p_buffer_size packet_flags = ENET_PACKET_FLAG_UNSEQUENCED; channel = SYSCH_UNRELIABLE; } break; - case Multiplayer::TRANSFER_MODE_ORDERED: { + case Multiplayer::TRANSFER_MODE_UNRELIABLE_ORDERED: { packet_flags = 0; channel = SYSCH_UNRELIABLE; } break; diff --git a/modules/gdnative/include/nativescript/godot_nativescript.h b/modules/gdnative/include/nativescript/godot_nativescript.h index 09eac2492f..5390d30c9f 100644 --- a/modules/gdnative/include/nativescript/godot_nativescript.h +++ b/modules/gdnative/include/nativescript/godot_nativescript.h @@ -39,7 +39,7 @@ extern "C" { typedef enum { GODOT_METHOD_RPC_MODE_DISABLED, - GODOT_METHOD_RPC_MODE_ANY, + GODOT_METHOD_RPC_MODE_ANY_PEER, GODOT_METHOD_RPC_MODE_AUTHORITY, } godot_nativescript_method_rpc_mode; diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 4e71eb32e9..63817e970a 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -3481,22 +3481,22 @@ bool GDScriptParser::network_annotations(const AnnotationNode *p_annotation, Nod } for (int i = last; i >= 0; i--) { String mode = p_annotation->resolved_arguments[i].operator String(); - if (mode == "any") { - rpc_config.rpc_mode = Multiplayer::RPC_MODE_ANY; - } else if (mode == "auth") { + if (mode == "any_peer") { + rpc_config.rpc_mode = Multiplayer::RPC_MODE_ANY_PEER; + } else if (mode == "authority") { rpc_config.rpc_mode = Multiplayer::RPC_MODE_AUTHORITY; - } else if (mode == "sync") { + } else if (mode == "call_local") { rpc_config.sync = true; - } else if (mode == "nosync") { + } else if (mode == "call_remote") { rpc_config.sync = false; } else if (mode == "reliable") { rpc_config.transfer_mode = Multiplayer::TRANSFER_MODE_RELIABLE; } else if (mode == "unreliable") { rpc_config.transfer_mode = Multiplayer::TRANSFER_MODE_UNRELIABLE; - } else if (mode == "ordered") { - rpc_config.transfer_mode = Multiplayer::TRANSFER_MODE_ORDERED; + } else if (mode == "unreliable_ordered") { + rpc_config.transfer_mode = Multiplayer::TRANSFER_MODE_UNRELIABLE_ORDERED; } else { - push_error(R"(Invalid RPC argument. Must be one of: 'sync'/'nosync' (local calls), 'any'/'auth' (permission), 'reliable'/'unreliable'/'ordered' (transfer mode).)", p_annotation); + push_error(R"(Invalid RPC argument. Must be one of: 'call_local'/'no_call_local' (local calls), 'any_peer'/'authority' (permission), 'reliable'/'unreliable'/'unreliable_ordered' (transfer mode).)", p_annotation); } } } diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index af7c54dd5b..247eee4280 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -3511,8 +3511,8 @@ int CSharpScript::get_member_line(const StringName &p_member) const { } Multiplayer::RPCMode CSharpScript::_member_get_rpc_mode(IMonoClassMember *p_member) const { - if (p_member->has_attribute(CACHED_CLASS(AnyAttribute))) { - return Multiplayer::RPC_MODE_ANY; + if (p_member->has_attribute(CACHED_CLASS(AnyPeerAttribute))) { + return Multiplayer::RPC_MODE_ANY_PEER; } if (p_member->has_attribute(CACHED_CLASS(AuthorityAttribute))) { return Multiplayer::RPC_MODE_AUTHORITY; diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttributes.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttributes.cs index 1da91ea867..b8b9bc660c 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttributes.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttributes.cs @@ -3,7 +3,7 @@ using System; namespace Godot { [AttributeUsage(AttributeTargets.Method)] - public class AnyAttribute : Attribute { } + public class AnyPeerAttribute : Attribute { } [AttributeUsage(AttributeTargets.Method)] public class AuthorityAttribute : Attribute { } diff --git a/modules/mono/mono_gd/gd_mono_cache.cpp b/modules/mono/mono_gd/gd_mono_cache.cpp index 34e845a589..2bf55493e0 100644 --- a/modules/mono/mono_gd/gd_mono_cache.cpp +++ b/modules/mono/mono_gd/gd_mono_cache.cpp @@ -140,7 +140,7 @@ void CachedData::clear_godot_api_cache() { field_ExportAttribute_hintString = nullptr; class_SignalAttribute = nullptr; class_ToolAttribute = nullptr; - class_AnyAttribute = nullptr; + class_AnyPeerAttribute = nullptr; class_AuthorityAttribute = nullptr; class_GodotMethodAttribute = nullptr; field_GodotMethodAttribute_methodName = nullptr; @@ -265,7 +265,7 @@ void update_godot_api_cache() { CACHE_FIELD_AND_CHECK(ExportAttribute, hintString, CACHED_CLASS(ExportAttribute)->get_field("hintString")); CACHE_CLASS_AND_CHECK(SignalAttribute, GODOT_API_CLASS(SignalAttribute)); CACHE_CLASS_AND_CHECK(ToolAttribute, GODOT_API_CLASS(ToolAttribute)); - CACHE_CLASS_AND_CHECK(AnyAttribute, GODOT_API_CLASS(AnyAttribute)); + CACHE_CLASS_AND_CHECK(AnyPeerAttribute, GODOT_API_CLASS(AnyPeerAttribute)); CACHE_CLASS_AND_CHECK(AuthorityAttribute, GODOT_API_CLASS(AuthorityAttribute)); CACHE_CLASS_AND_CHECK(GodotMethodAttribute, GODOT_API_CLASS(GodotMethodAttribute)); CACHE_FIELD_AND_CHECK(GodotMethodAttribute, methodName, CACHED_CLASS(GodotMethodAttribute)->get_field("methodName")); diff --git a/modules/mono/mono_gd/gd_mono_cache.h b/modules/mono/mono_gd/gd_mono_cache.h index e60a4d5279..4b4688b4d9 100644 --- a/modules/mono/mono_gd/gd_mono_cache.h +++ b/modules/mono/mono_gd/gd_mono_cache.h @@ -111,7 +111,7 @@ struct CachedData { GDMonoField *field_ExportAttribute_hintString; GDMonoClass *class_SignalAttribute; GDMonoClass *class_ToolAttribute; - GDMonoClass *class_AnyAttribute; + GDMonoClass *class_AnyPeerAttribute; GDMonoClass *class_AuthorityAttribute; GDMonoClass *class_GodotMethodAttribute; GDMonoField *field_GodotMethodAttribute_methodName; diff --git a/modules/webrtc/webrtc_multiplayer_peer.cpp b/modules/webrtc/webrtc_multiplayer_peer.cpp index 4e5174fc33..133bd71ddb 100644 --- a/modules/webrtc/webrtc_multiplayer_peer.cpp +++ b/modules/webrtc/webrtc_multiplayer_peer.cpp @@ -189,7 +189,7 @@ Error WebRTCMultiplayerPeer::initialize(int p_self_id, bool p_server_compat, Arr cfg["ordered"] = true; switch (mode) { - case Multiplayer::TRANSFER_MODE_ORDERED: + case Multiplayer::TRANSFER_MODE_UNRELIABLE_ORDERED: cfg["maxPacketLifetime"] = 1; break; case Multiplayer::TRANSFER_MODE_UNRELIABLE: @@ -334,7 +334,7 @@ Error WebRTCMultiplayerPeer::put_packet(const uint8_t *p_buffer, int p_buffer_si case Multiplayer::TRANSFER_MODE_RELIABLE: ch = CH_RELIABLE; break; - case Multiplayer::TRANSFER_MODE_ORDERED: + case Multiplayer::TRANSFER_MODE_UNRELIABLE_ORDERED: ch = CH_ORDERED; break; case Multiplayer::TRANSFER_MODE_UNRELIABLE: |