[Net] Move multiplayer to core subdir, split RPCManager.

Move multiplayer classes to "core/multiplayer" subdir.

Move the RPCConfig and enums (TransferMode, RPCMode) to a separate
file (multiplayer.h), and bind them to the global namespace.

Move the RPC handling code to its own class (RPCManager).

Renames "get_rpc_sender_id" to "get_remote_sender_id".
This commit is contained in:
Fabio Alessandrelli 2021-09-03 19:40:47 +02:00
parent b0b30aaf41
commit bf9aae09ba
57 changed files with 976 additions and 767 deletions

View file

@ -334,9 +334,9 @@ Error PluginScript::reload(bool p_keep_state) {
// rpc_mode is passed as an optional field and is not part of MethodInfo
Variant var = v["rpc_mode"];
if (var != Variant()) {
MultiplayerAPI::RPCConfig nd;
Multiplayer::RPCConfig nd;
nd.name = mi.name;
nd.rpc_mode = MultiplayerAPI::RPCMode(int(var));
nd.rpc_mode = Multiplayer::RPCMode(int(var));
// TODO Transfer Channel
if (_rpc_methods.find(nd) == -1) {
_rpc_methods.push_back(nd);
@ -345,7 +345,7 @@ Error PluginScript::reload(bool p_keep_state) {
}
// Sort so we are 100% that they are always the same.
_rpc_methods.sort_custom<MultiplayerAPI::SortRPCConfig>();
_rpc_methods.sort_custom<Multiplayer::SortRPCConfig>();
Array *signals = (Array *)&manifest.signals;
for (int i = 0; i < signals->size(); ++i) {
@ -484,7 +484,7 @@ int PluginScript::get_member_line(const StringName &p_member) const {
return -1;
}
const Vector<MultiplayerAPI::RPCConfig> PluginScript::get_rpc_methods() const {
const Vector<Multiplayer::RPCConfig> PluginScript::get_rpc_methods() const {
return _rpc_methods;
}