Update C# RPC attributes to share new Any/Auth naming convention

Update attribute class references in mono cache
This commit is contained in:
Edward Auttonberry 2021-09-26 18:49:00 -04:00
parent 8138280d20
commit c86ab40389
4 changed files with 10 additions and 10 deletions

View File

@ -3511,10 +3511,10 @@ int CSharpScript::get_member_line(const StringName &p_member) const {
} }
Multiplayer::RPCMode CSharpScript::_member_get_rpc_mode(IMonoClassMember *p_member) const { Multiplayer::RPCMode CSharpScript::_member_get_rpc_mode(IMonoClassMember *p_member) const {
if (p_member->has_attribute(CACHED_CLASS(RemoteAttribute))) { if (p_member->has_attribute(CACHED_CLASS(AnyAttribute))) {
return Multiplayer::RPC_MODE_ANY; return Multiplayer::RPC_MODE_ANY;
} }
if (p_member->has_attribute(CACHED_CLASS(PuppetAttribute))) { if (p_member->has_attribute(CACHED_CLASS(AuthorityAttribute))) {
return Multiplayer::RPC_MODE_AUTHORITY; return Multiplayer::RPC_MODE_AUTHORITY;
} }

View File

@ -3,8 +3,8 @@ using System;
namespace Godot namespace Godot
{ {
[AttributeUsage(AttributeTargets.Method)] [AttributeUsage(AttributeTargets.Method)]
public class RemoteAttribute : Attribute { } public class AnyAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Method)] [AttributeUsage(AttributeTargets.Method)]
public class PuppetAttribute : Attribute { } public class AuthorityAttribute : Attribute { }
} }

View File

@ -140,8 +140,8 @@ void CachedData::clear_godot_api_cache() {
field_ExportAttribute_hintString = nullptr; field_ExportAttribute_hintString = nullptr;
class_SignalAttribute = nullptr; class_SignalAttribute = nullptr;
class_ToolAttribute = nullptr; class_ToolAttribute = nullptr;
class_RemoteAttribute = nullptr; class_AnyAttribute = nullptr;
class_PuppetAttribute = nullptr; class_AuthorityAttribute = nullptr;
class_GodotMethodAttribute = nullptr; class_GodotMethodAttribute = nullptr;
field_GodotMethodAttribute_methodName = nullptr; field_GodotMethodAttribute_methodName = nullptr;
class_ScriptPathAttribute = nullptr; class_ScriptPathAttribute = nullptr;
@ -265,8 +265,8 @@ void update_godot_api_cache() {
CACHE_FIELD_AND_CHECK(ExportAttribute, hintString, CACHED_CLASS(ExportAttribute)->get_field("hintString")); 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(SignalAttribute, GODOT_API_CLASS(SignalAttribute));
CACHE_CLASS_AND_CHECK(ToolAttribute, GODOT_API_CLASS(ToolAttribute)); CACHE_CLASS_AND_CHECK(ToolAttribute, GODOT_API_CLASS(ToolAttribute));
CACHE_CLASS_AND_CHECK(RemoteAttribute, GODOT_API_CLASS(RemoteAttribute)); CACHE_CLASS_AND_CHECK(AnyAttribute, GODOT_API_CLASS(AnyAttribute));
CACHE_CLASS_AND_CHECK(PuppetAttribute, GODOT_API_CLASS(PuppetAttribute)); CACHE_CLASS_AND_CHECK(AuthorityAttribute, GODOT_API_CLASS(AuthorityAttribute));
CACHE_CLASS_AND_CHECK(GodotMethodAttribute, GODOT_API_CLASS(GodotMethodAttribute)); CACHE_CLASS_AND_CHECK(GodotMethodAttribute, GODOT_API_CLASS(GodotMethodAttribute));
CACHE_FIELD_AND_CHECK(GodotMethodAttribute, methodName, CACHED_CLASS(GodotMethodAttribute)->get_field("methodName")); CACHE_FIELD_AND_CHECK(GodotMethodAttribute, methodName, CACHED_CLASS(GodotMethodAttribute)->get_field("methodName"));
CACHE_CLASS_AND_CHECK(ScriptPathAttribute, GODOT_API_CLASS(ScriptPathAttribute)); CACHE_CLASS_AND_CHECK(ScriptPathAttribute, GODOT_API_CLASS(ScriptPathAttribute));

View File

@ -111,8 +111,8 @@ struct CachedData {
GDMonoField *field_ExportAttribute_hintString; GDMonoField *field_ExportAttribute_hintString;
GDMonoClass *class_SignalAttribute; GDMonoClass *class_SignalAttribute;
GDMonoClass *class_ToolAttribute; GDMonoClass *class_ToolAttribute;
GDMonoClass *class_RemoteAttribute; GDMonoClass *class_AnyAttribute;
GDMonoClass *class_PuppetAttribute; GDMonoClass *class_AuthorityAttribute;
GDMonoClass *class_GodotMethodAttribute; GDMonoClass *class_GodotMethodAttribute;
GDMonoField *field_GodotMethodAttribute_methodName; GDMonoField *field_GodotMethodAttribute_methodName;
GDMonoClass *class_ScriptPathAttribute; GDMonoClass *class_ScriptPathAttribute;