diff options
author | Max Hilbrunner <mhilbrunner@users.noreply.github.com> | 2021-10-08 14:15:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-08 14:15:01 +0200 |
commit | 5733c13f530e1572bfdf1450630096e180041554 (patch) | |
tree | eabb56514477e907b5a7ac305503fe21dcdd4fbc /core/multiplayer | |
parent | b010f96c898ed1e9f9fa2e24035932efccaea1ac (diff) | |
parent | 7c939317510d4d9c79e3175dfd6a083cdaf680ee (diff) |
Merge pull request #53536 from Faless/mp/4.x_rpc_config
[Net] Add call_local argument to Node.rpc_config.
Diffstat (limited to 'core/multiplayer')
-rw-r--r-- | core/multiplayer/multiplayer.h | 2 | ||||
-rw-r--r-- | core/multiplayer/rpc_manager.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/multiplayer/multiplayer.h b/core/multiplayer/multiplayer.h index 31b7bf0043..be398f02c8 100644 --- a/core/multiplayer/multiplayer.h +++ b/core/multiplayer/multiplayer.h @@ -52,7 +52,7 @@ enum RPCMode { struct RPCConfig { StringName name; RPCMode rpc_mode = RPC_MODE_DISABLED; - bool sync = false; + bool call_local = false; TransferMode transfer_mode = TRANSFER_MODE_RELIABLE; int channel = 0; diff --git a/core/multiplayer/rpc_manager.cpp b/core/multiplayer/rpc_manager.cpp index 20ab7a25bb..d8e875c3e6 100644 --- a/core/multiplayer/rpc_manager.cpp +++ b/core/multiplayer/rpc_manager.cpp @@ -476,9 +476,9 @@ void RPCManager::rpcp(Node *p_node, int p_peer_id, const StringName &p_method, c vformat("Unable to get the RPC configuration for the function \"%s\" at path: \"%s\". This happens when the method is not marked for RPCs.", p_method, p_node->get_path())); if (p_peer_id == 0 || p_peer_id == node_id || (p_peer_id < 0 && p_peer_id != -node_id)) { if (rpc_id & (1 << 15)) { - call_local_native = config.sync; + call_local_native = config.call_local; } else { - call_local_script = config.sync; + call_local_script = config.call_local; } } @@ -521,5 +521,5 @@ void RPCManager::rpcp(Node *p_node, int p_peer_id, const StringName &p_method, c } } - ERR_FAIL_COND_MSG(p_peer_id == node_id && !config.sync, "RPC '" + p_method + "' on yourself is not allowed by selected mode."); + ERR_FAIL_COND_MSG(p_peer_id == node_id && !config.call_local, "RPC '" + p_method + "' on yourself is not allowed by selected mode."); } |