mirror of
https://github.com/godotengine/godot.git
synced 2025-10-30 05:01:10 +00:00
[Net] Refactor RPCs, remove RSETs
In this PR: - Removed rset - rpc_config can now optionally configure transfer mode (reliable/unreliable/ordered) and channel (channels are not actually implemented yet.) - Refactor how the RPC id is computed to minimize the logic in Node and scripts that now only needs a single `get_rpc_methods` function.
This commit is contained in:
parent
0aabfb341a
commit
d779b5aa3e
23 changed files with 251 additions and 1545 deletions
|
|
@ -100,46 +100,10 @@ String PluginScriptInstance::to_string(bool *r_valid) {
|
|||
return str_ret;
|
||||
}
|
||||
|
||||
Vector<ScriptNetData> PluginScriptInstance::get_rpc_methods() const {
|
||||
const Vector<MultiplayerAPI::RPCConfig> PluginScriptInstance::get_rpc_methods() const {
|
||||
return _script->get_rpc_methods();
|
||||
}
|
||||
|
||||
uint16_t PluginScriptInstance::get_rpc_method_id(const StringName &p_variable) const {
|
||||
return _script->get_rpc_method_id(p_variable);
|
||||
}
|
||||
|
||||
StringName PluginScriptInstance::get_rpc_method(uint16_t p_id) const {
|
||||
return _script->get_rpc_method(p_id);
|
||||
}
|
||||
|
||||
MultiplayerAPI::RPCMode PluginScriptInstance::get_rpc_mode_by_id(uint16_t p_id) const {
|
||||
return _script->get_rpc_mode_by_id(p_id);
|
||||
}
|
||||
|
||||
MultiplayerAPI::RPCMode PluginScriptInstance::get_rpc_mode(const StringName &p_method) const {
|
||||
return _script->get_rpc_mode(p_method);
|
||||
}
|
||||
|
||||
Vector<ScriptNetData> PluginScriptInstance::get_rset_properties() const {
|
||||
return _script->get_rset_properties();
|
||||
}
|
||||
|
||||
uint16_t PluginScriptInstance::get_rset_property_id(const StringName &p_variable) const {
|
||||
return _script->get_rset_property_id(p_variable);
|
||||
}
|
||||
|
||||
StringName PluginScriptInstance::get_rset_property(uint16_t p_id) const {
|
||||
return _script->get_rset_property(p_id);
|
||||
}
|
||||
|
||||
MultiplayerAPI::RPCMode PluginScriptInstance::get_rset_mode_by_id(uint16_t p_id) const {
|
||||
return _script->get_rset_mode_by_id(p_id);
|
||||
}
|
||||
|
||||
MultiplayerAPI::RPCMode PluginScriptInstance::get_rset_mode(const StringName &p_variable) const {
|
||||
return _script->get_rset_mode(p_variable);
|
||||
}
|
||||
|
||||
void PluginScriptInstance::refcount_incremented() {
|
||||
if (_desc->refcount_decremented) {
|
||||
_desc->refcount_incremented(_data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue