diff options
| author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-07-20 13:55:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-20 13:55:54 +0200 |
| commit | de4ad63e6fa4c9f5d740d54b025fa15487915b50 (patch) | |
| tree | d1cea50b67243c8cd5b090a7bf6b9fbdff6adc2a /modules/gdscript/gdscript.cpp | |
| parent | 1117c2c9f2e5782d6fc09cadaa5754caaacf9d27 (diff) | |
| parent | ddb68f76ffc9505a179ee52cc2f4ee99ac571b04 (diff) | |
| download | redot-engine-de4ad63e6fa4c9f5d740d54b025fa15487915b50.tar.gz | |
Merge pull request #49882 from Faless/mp/4.x_rpc_gd
[Net] New `@rpc` annotation, "sync" is no longer part of mode.
Diffstat (limited to 'modules/gdscript/gdscript.cpp')
| -rw-r--r-- | modules/gdscript/gdscript.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 8b12b1eae4..d0b7722847 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -1165,15 +1165,11 @@ void GDScript::_init_rpc_methods_properties() { while (cscript) { // RPC Methods for (Map<StringName, GDScriptFunction *>::Element *E = cscript->member_functions.front(); E; E = E->next()) { - if (E->get()->get_rpc_mode() != MultiplayerAPI::RPC_MODE_DISABLED) { - MultiplayerAPI::RPCConfig nd; - nd.name = E->key(); - nd.rpc_mode = E->get()->get_rpc_mode(); - // TODO - nd.transfer_mode = MultiplayerPeer::TRANSFER_MODE_RELIABLE; - nd.channel = 0; - if (-1 == rpc_functions.find(nd)) { - rpc_functions.push_back(nd); + MultiplayerAPI::RPCConfig config = E->get()->get_rpc_config(); + if (config.rpc_mode != MultiplayerAPI::RPC_MODE_DISABLED) { + config.name = E->get()->get_name(); + if (rpc_functions.find(config) == -1) { + rpc_functions.push_back(config); } } } |
