mirror of
https://github.com/godotengine/godot.git
synced 2025-10-23 01:43:36 +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
|
|
@ -737,20 +737,22 @@ public:
|
|||
}
|
||||
|
||||
int to_id = 0;
|
||||
bool reliable = true;
|
||||
//bool reliable = true;
|
||||
|
||||
if (rpc_mode >= VisualScriptFunctionCall::RPC_RELIABLE_TO_ID) {
|
||||
to_id = *p_args[0];
|
||||
p_args += 1;
|
||||
p_argcount -= 1;
|
||||
if (rpc_mode == VisualScriptFunctionCall::RPC_UNRELIABLE_TO_ID) {
|
||||
reliable = false;
|
||||
}
|
||||
} else if (rpc_mode == VisualScriptFunctionCall::RPC_UNRELIABLE) {
|
||||
reliable = false;
|
||||
//if (rpc_mode == VisualScriptFunctionCall::RPC_UNRELIABLE_TO_ID) {
|
||||
//reliable = false;
|
||||
//}
|
||||
}
|
||||
//else if (rpc_mode == VisualScriptFunctionCall::RPC_UNRELIABLE) {
|
||||
//reliable = false;
|
||||
//}
|
||||
|
||||
node->rpcp(to_id, !reliable, function, p_args, p_argcount);
|
||||
// TODO reliable?
|
||||
node->rpcp(to_id, function, p_args, p_argcount);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue