summaryrefslogtreecommitdiff
path: root/core/io/multiplayer_api.h
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-05-30 14:59:08 +0200
committerGitHub <noreply@github.com>2018-05-30 14:59:08 +0200
commitfc7f931d26900f70ec19f91837d1715e1a301834 (patch)
treec5bcc314b6d62437d9eae4f768d69491e91e1d54 /core/io/multiplayer_api.h
parent3d9dffdef7d436cda779ee4a659476fa94c62a35 (diff)
parent8e35d937a96399c7fc9dcc3b9cd7344a6a38cfd8 (diff)
Merge pull request #19255 from Faless/rpc_sync_mmore
RPCMode refactor, more sync modes (2)
Diffstat (limited to 'core/io/multiplayer_api.h')
-rw-r--r--core/io/multiplayer_api.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/io/multiplayer_api.h b/core/io/multiplayer_api.h
index 64f59d32d8..ef56c4c7f2 100644
--- a/core/io/multiplayer_api.h
+++ b/core/io/multiplayer_api.h
@@ -87,6 +87,18 @@ public:
NETWORK_COMMAND_RAW,
};
+ enum RPCMode {
+
+ RPC_MODE_DISABLED, // No rpc for this method, calls to this will be blocked (default)
+ RPC_MODE_REMOTE, // Using rpc() on it will call method / set property in all remote peers
+ RPC_MODE_SYNC, // Using rpc() on it will call method / set property in all remote peers and locally
+ RPC_MODE_MASTER, // Using rpc() on it will call method on wherever the master is, be it local or remote
+ RPC_MODE_SLAVE, // Using rpc() on it will call method for all slaves
+ RPC_MODE_REMOTESYNC, // Same as RPC_MODE_SYNC, compatibility
+ RPC_MODE_MASTERSYNC, // Using rpc() on it will call method / set property in the master peer and locally
+ RPC_MODE_SLAVESYNC, // Using rpc() on it will call method / set property in all slave peers and locally
+ };
+
void poll();
void clear();
void set_root_node(Node *p_node);
@@ -117,4 +129,6 @@ public:
~MultiplayerAPI();
};
+VARIANT_ENUM_CAST(MultiplayerAPI::RPCMode);
+
#endif // MULTIPLAYER_PROTOCOL_H