You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Expose get_rpc_config and get_node_rpc_config
This commit is contained in:
@@ -172,6 +172,8 @@ void Script::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("is_tool"), &Script::is_tool);
|
ClassDB::bind_method(D_METHOD("is_tool"), &Script::is_tool);
|
||||||
ClassDB::bind_method(D_METHOD("is_abstract"), &Script::is_abstract);
|
ClassDB::bind_method(D_METHOD("is_abstract"), &Script::is_abstract);
|
||||||
|
|
||||||
|
ClassDB::bind_method(D_METHOD("get_rpc_config"), &Script::_get_rpc_config_bind);
|
||||||
|
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::STRING, "source_code", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_source_code", "get_source_code");
|
ADD_PROPERTY(PropertyInfo(Variant::STRING, "source_code", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NONE), "set_source_code", "get_source_code");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -135,6 +135,10 @@ protected:
|
|||||||
|
|
||||||
void _set_debugger_break_language();
|
void _set_debugger_break_language();
|
||||||
|
|
||||||
|
Variant _get_rpc_config_bind() const {
|
||||||
|
return get_rpc_config().duplicate(true);
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void reload_from_file() override;
|
virtual void reload_from_file() override;
|
||||||
|
|
||||||
|
|||||||
@@ -495,6 +495,13 @@
|
|||||||
Fetches a node by [NodePath]. Similar to [method get_node], but does not generate an error if [param path] does not point to a valid node.
|
Fetches a node by [NodePath]. Similar to [method get_node], but does not generate an error if [param path] does not point to a valid node.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="get_node_rpc_config" qualifiers="const">
|
||||||
|
<return type="Variant" />
|
||||||
|
<description>
|
||||||
|
Returns a [Dictionary] mapping method names to their RPC configuration defined for this node using [method rpc_config].
|
||||||
|
[b]Note:[/b] This method only returns the RPC configuration assigned via [method rpc_config]. See [method Script.get_rpc_config] to retrieve the RPCs defined by the [Script].
|
||||||
|
</description>
|
||||||
|
</method>
|
||||||
<method name="get_orphan_node_ids" qualifiers="static">
|
<method name="get_orphan_node_ids" qualifiers="static">
|
||||||
<return type="int[]" />
|
<return type="int[]" />
|
||||||
<description>
|
<description>
|
||||||
|
|||||||
@@ -58,6 +58,12 @@
|
|||||||
Returns the default value of the specified property.
|
Returns the default value of the specified property.
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
|
<method name="get_rpc_config" qualifiers="const">
|
||||||
|
<return type="Variant" />
|
||||||
|
<description>
|
||||||
|
Returns a [Dictionary] mapping method names to their RPC configuration defined by this script.
|
||||||
|
</description>
|
||||||
|
</method>
|
||||||
<method name="get_script_constant_map">
|
<method name="get_script_constant_map">
|
||||||
<return type="Dictionary" />
|
<return type="Dictionary" />
|
||||||
<description>
|
<description>
|
||||||
|
|||||||
@@ -251,3 +251,10 @@ Validate extension JSON: Error: Field 'classes/InputMap/methods/add_action/argum
|
|||||||
Validate extension JSON: Error: Field 'global_enums/KeyModifierMask/values/KEY_MODIFIER_MASK': value changed value in new API, from 532676600.0 to 2130706432.
|
Validate extension JSON: Error: Field 'global_enums/KeyModifierMask/values/KEY_MODIFIER_MASK': value changed value in new API, from 532676600.0 to 2130706432.
|
||||||
|
|
||||||
Precision of string-serialized Variant constants increased.
|
Precision of string-serialized Variant constants increased.
|
||||||
|
|
||||||
|
|
||||||
|
GH-106848
|
||||||
|
---------
|
||||||
|
Validate extension JSON: API was removed: classes/Node/methods/get_rpc_config
|
||||||
|
|
||||||
|
Change Node `get_rpc_config` to `get_node_rpc_config`. Compatibility method registered.
|
||||||
|
|||||||
@@ -34,8 +34,13 @@ void Node::_set_name_bind_compat_76560(const String &p_name) {
|
|||||||
set_name(p_name);
|
set_name(p_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Variant Node::_get_rpc_config_bind_compat_106848() const {
|
||||||
|
return _get_node_rpc_config_bind();
|
||||||
|
}
|
||||||
|
|
||||||
void Node::_bind_compatibility_methods() {
|
void Node::_bind_compatibility_methods() {
|
||||||
ClassDB::bind_compatibility_method(D_METHOD("set_name", "name"), &Node::_set_name_bind_compat_76560);
|
ClassDB::bind_compatibility_method(D_METHOD("set_name", "name"), &Node::_set_name_bind_compat_76560);
|
||||||
|
ClassDB::bind_compatibility_method(D_METHOD("get_rpc_config"), &Node::_get_rpc_config_bind_compat_106848);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -3980,6 +3980,7 @@ void Node::_bind_methods() {
|
|||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("get_multiplayer"), &Node::get_multiplayer);
|
ClassDB::bind_method(D_METHOD("get_multiplayer"), &Node::get_multiplayer);
|
||||||
ClassDB::bind_method(D_METHOD("rpc_config", "method", "config"), &Node::rpc_config);
|
ClassDB::bind_method(D_METHOD("rpc_config", "method", "config"), &Node::rpc_config);
|
||||||
|
ClassDB::bind_method(D_METHOD("get_node_rpc_config"), &Node::_get_node_rpc_config_bind);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("set_editor_description", "editor_description"), &Node::set_editor_description);
|
ClassDB::bind_method(D_METHOD("set_editor_description", "editor_description"), &Node::set_editor_description);
|
||||||
ClassDB::bind_method(D_METHOD("get_editor_description"), &Node::get_editor_description);
|
ClassDB::bind_method(D_METHOD("get_editor_description"), &Node::get_editor_description);
|
||||||
|
|||||||
@@ -388,6 +388,10 @@ protected:
|
|||||||
|
|
||||||
void _validate_property(PropertyInfo &p_property) const;
|
void _validate_property(PropertyInfo &p_property) const;
|
||||||
|
|
||||||
|
Variant _get_node_rpc_config_bind() const {
|
||||||
|
return get_node_rpc_config().duplicate(true);
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool _uses_signal_mutex() const override { return false; } // Node uses thread guards instead.
|
virtual bool _uses_signal_mutex() const override { return false; } // Node uses thread guards instead.
|
||||||
|
|
||||||
@@ -414,6 +418,7 @@ protected:
|
|||||||
|
|
||||||
#ifndef DISABLE_DEPRECATED
|
#ifndef DISABLE_DEPRECATED
|
||||||
void _set_name_bind_compat_76560(const String &p_name);
|
void _set_name_bind_compat_76560(const String &p_name);
|
||||||
|
Variant _get_rpc_config_bind_compat_106848() const;
|
||||||
static void _bind_compatibility_methods();
|
static void _bind_compatibility_methods();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user