[MP] RPC visibility.

Implemented using MultiplayerSynchronizers.

If you didn't use the synchronizer visibility features, nothing changes.

If you were using visibility, RPCs to broadcast should now behave as
expected in most configurations (i.e. by sending the RPC to _visible_
peers).

If you want to limit the visibility of RPCs for a node, add a
synchronizer for it, and configure the visibility via
"set_visibility_for" or by adding a visibility filter.
This commit is contained in:
Fabio Alessandrelli
2022-11-01 13:14:35 +01:00
parent 8aafcf9d2a
commit fdc4e73a2c
4 changed files with 79 additions and 21 deletions

View File

@ -125,6 +125,8 @@ public:
Error on_despawn_receive(int p_from, const uint8_t *p_buffer, int p_buffer_len);
Error on_sync_receive(int p_from, const uint8_t *p_buffer, int p_buffer_len);
bool is_rpc_visible(const ObjectID &p_oid, int p_peer) const;
SceneReplicationInterface(SceneMultiplayer *p_multiplayer) {
multiplayer = p_multiplayer;
}