Fix Node::rpc_config
return error
Fix StringName type checks in other `_rpc*_bind` methods.
This commit is contained in:
parent
94cba993bf
commit
4c528e76e7
@ -462,7 +462,7 @@ uint16_t Node::rpc_config(const StringName &p_method, MultiplayerAPI::RPCMode p_
|
||||
nd.name = p_method;
|
||||
nd.mode = p_mode;
|
||||
data.rpc_methods.push_back(nd);
|
||||
return ((uint16_t)data.rpc_properties.size() - 1) | (1 << 15);
|
||||
return ((uint16_t)data.rpc_methods.size() - 1) | (1 << 15);
|
||||
} else {
|
||||
int c_mid = (~(1 << 15)) & mid;
|
||||
data.rpc_methods.write[c_mid].mode = p_mode;
|
||||
@ -551,7 +551,7 @@ Variant Node::_rpc_bind(const Variant **p_args, int p_argcount, Callable::CallEr
|
||||
return Variant();
|
||||
}
|
||||
|
||||
if (p_args[0]->get_type() != Variant::STRING) {
|
||||
if (p_args[0]->get_type() != Variant::STRING_NAME) {
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
|
||||
r_error.argument = 0;
|
||||
r_error.expected = Variant::STRING;
|
||||
@ -580,7 +580,7 @@ Variant Node::_rpc_id_bind(const Variant **p_args, int p_argcount, Callable::Cal
|
||||
return Variant();
|
||||
}
|
||||
|
||||
if (p_args[1]->get_type() != Variant::STRING) {
|
||||
if (p_args[1]->get_type() != Variant::STRING_NAME) {
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
|
||||
r_error.argument = 1;
|
||||
r_error.expected = Variant::STRING;
|
||||
@ -603,7 +603,7 @@ Variant Node::_rpc_unreliable_bind(const Variant **p_args, int p_argcount, Calla
|
||||
return Variant();
|
||||
}
|
||||
|
||||
if (p_args[0]->get_type() != Variant::STRING) {
|
||||
if (p_args[0]->get_type() != Variant::STRING_NAME) {
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
|
||||
r_error.argument = 0;
|
||||
r_error.expected = Variant::STRING;
|
||||
@ -632,7 +632,7 @@ Variant Node::_rpc_unreliable_id_bind(const Variant **p_args, int p_argcount, Ca
|
||||
return Variant();
|
||||
}
|
||||
|
||||
if (p_args[1]->get_type() != Variant::STRING) {
|
||||
if (p_args[1]->get_type() != Variant::STRING_NAME) {
|
||||
r_error.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
|
||||
r_error.argument = 1;
|
||||
r_error.expected = Variant::STRING;
|
||||
|
Loading…
Reference in New Issue
Block a user