diff options
author | Max Hilbrunner <mhilbrunner@users.noreply.github.com> | 2019-05-08 23:07:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-08 23:07:15 +0200 |
commit | 84058ab8ac9b7543da3971162c3a1b1d2fe05b89 (patch) | |
tree | d11b2f0343a9785566ec261da8fa3746a3730609 /core | |
parent | 2cf34534a14c9bbebad96a138af95dd2f21d5b0e (diff) | |
parent | bba77fe3879a6233c24289f0201be830edfc8c73 (diff) |
Merge pull request #28773 from Faless/mp/err_explain_fix2
Avoid _can_call_mode resetting error message in MultiplayerAPI
Diffstat (limited to 'core')
-rw-r--r-- | core/io/multiplayer_api.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/io/multiplayer_api.cpp b/core/io/multiplayer_api.cpp index 2e76ce68ed..f6a1cd7616 100644 --- a/core/io/multiplayer_api.cpp +++ b/core/io/multiplayer_api.cpp @@ -283,8 +283,9 @@ void MultiplayerAPI::_process_rpc(Node *p_node, const StringName &p_name, int p_ rpc_mode = p_node->get_script_instance()->get_rpc_mode(p_name); } - ERR_EXPLAIN("RPC '" + String(p_name) + "' is not allowed from: " + itos(p_from) + ". Mode is " + itos((int)rpc_mode) + ", master is " + itos(p_node->get_network_master()) + "."); - ERR_FAIL_COND(!_can_call_mode(p_node, rpc_mode, p_from)); + bool can_call = _can_call_mode(p_node, rpc_mode, p_from); + ERR_EXPLAIN("RPC '" + String(p_name) + "' is not allowed on node " + p_node->get_path() + " from: " + itos(p_from) + ". Mode is " + itos((int)rpc_mode) + ", master is " + itos(p_node->get_network_master()) + "."); + ERR_FAIL_COND(!can_call); int argc = p_packet[p_offset]; Vector<Variant> args; @@ -332,8 +333,9 @@ void MultiplayerAPI::_process_rset(Node *p_node, const StringName &p_name, int p rset_mode = p_node->get_script_instance()->get_rset_mode(p_name); } - ERR_EXPLAIN("RSET '" + String(p_name) + "' is not allowed from: " + itos(p_from) + ". Mode is " + itos((int)rset_mode) + ", master is " + itos(p_node->get_network_master()) + "."); - ERR_FAIL_COND(!_can_call_mode(p_node, rset_mode, p_from)); + bool can_call = _can_call_mode(p_node, rset_mode, p_from); + ERR_EXPLAIN("RSET '" + String(p_name) + "' is not allowed on node " + p_node->get_path() + " from: " + itos(p_from) + ". Mode is " + itos((int)rset_mode) + ", master is " + itos(p_node->get_network_master()) + "."); + ERR_FAIL_COND(!can_call); Variant value; Error err = decode_variant(value, &p_packet[p_offset], p_packet_len - p_offset, NULL, allow_object_decoding || network_peer->is_object_decoding_allowed()); |