[Net] Rename RPC constants and annotation arguments.

any -> any_peer
sync -> call_local
ordered -> unreliable_ordered

Multiplayer.RPC_MODE_ANY -> RPC_MODE_ANY_PEER
Multiplayer.TRANSFER_MODE_ORDERED -> TRANSFER_MODE_UNRELIABLE_ORDERED
This commit is contained in:
Fabio Alessandrelli 2021-10-01 10:43:22 +02:00
parent 8be97e3b51
commit 24a949ea11
13 changed files with 27 additions and 27 deletions

View file

@ -3481,22 +3481,22 @@ bool GDScriptParser::network_annotations(const AnnotationNode *p_annotation, Nod
}
for (int i = last; i >= 0; i--) {
String mode = p_annotation->resolved_arguments[i].operator String();
if (mode == "any") {
rpc_config.rpc_mode = Multiplayer::RPC_MODE_ANY;
} else if (mode == "auth") {
if (mode == "any_peer") {
rpc_config.rpc_mode = Multiplayer::RPC_MODE_ANY_PEER;
} else if (mode == "authority") {
rpc_config.rpc_mode = Multiplayer::RPC_MODE_AUTHORITY;
} else if (mode == "sync") {
} else if (mode == "call_local") {
rpc_config.sync = true;
} else if (mode == "nosync") {
} else if (mode == "call_remote") {
rpc_config.sync = false;
} else if (mode == "reliable") {
rpc_config.transfer_mode = Multiplayer::TRANSFER_MODE_RELIABLE;
} else if (mode == "unreliable") {
rpc_config.transfer_mode = Multiplayer::TRANSFER_MODE_UNRELIABLE;
} else if (mode == "ordered") {
rpc_config.transfer_mode = Multiplayer::TRANSFER_MODE_ORDERED;
} else if (mode == "unreliable_ordered") {
rpc_config.transfer_mode = Multiplayer::TRANSFER_MODE_UNRELIABLE_ORDERED;
} else {
push_error(R"(Invalid RPC argument. Must be one of: 'sync'/'nosync' (local calls), 'any'/'auth' (permission), 'reliable'/'unreliable'/'ordered' (transfer mode).)", p_annotation);
push_error(R"(Invalid RPC argument. Must be one of: 'call_local'/'no_call_local' (local calls), 'any_peer'/'authority' (permission), 'reliable'/'unreliable'/'unreliable_ordered' (transfer mode).)", p_annotation);
}
}
}