diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-06-24 10:28:15 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-07-20 11:17:59 +0200 |
commit | ddb68f76ffc9505a179ee52cc2f4ee99ac571b04 (patch) | |
tree | c62c113f8f18293fc5f30c5d26f6921c372eeea0 /core/io/multiplayer_api.h | |
parent | 8b1c60c1a324ed3ae2c2d26e58a3040f8542a416 (diff) | |
download | redot-engine-ddb68f76ffc9505a179ee52cc2f4ee99ac571b04.tar.gz |
[Net] Single `rpc` annotation. "sync" no longer part of mode.
- Move the "sync" property for RPCs to RPCConfig.
- Unify GDScript annotations into a single one:
- `@rpc(master)` # default
- `@rpc(puppet)`
- `@rpc(any)` # former `@remote`
- Implement three additional `@rpc` options:
- The second parameter is the "sync" option (which also calls the
function locally when RPCing). One of "sync", "nosync".
- The third parameter is the transfer mode (reliable, unreliable,
ordered).
- The third parameter is the channel (unused for now).
Diffstat (limited to 'core/io/multiplayer_api.h')
-rw-r--r-- | core/io/multiplayer_api.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/core/io/multiplayer_api.h b/core/io/multiplayer_api.h index e9f96383c9..cc994a9852 100644 --- a/core/io/multiplayer_api.h +++ b/core/io/multiplayer_api.h @@ -43,14 +43,12 @@ public: RPC_MODE_REMOTE, // Using rpc() on it will call method in all remote peers RPC_MODE_MASTER, // Using rpc() on it will call method on wherever the master is, be it local or remote RPC_MODE_PUPPET, // Using rpc() on it will call method for all puppets - RPC_MODE_REMOTESYNC, // Using rpc() on it will call method in all remote peers and locally - RPC_MODE_MASTERSYNC, // Using rpc() on it will call method in the master peer and locally - RPC_MODE_PUPPETSYNC, // Using rpc() on it will call method in all puppets peers and locally }; struct RPCConfig { StringName name; RPCMode rpc_mode = RPC_MODE_DISABLED; + bool sync = false; MultiplayerPeer::TransferMode transfer_mode = MultiplayerPeer::TRANSFER_MODE_RELIABLE; int channel = 0; |