summaryrefslogtreecommitdiff
path: root/scene/multiplayer/scene_cache_interface.h
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-07-09 20:45:30 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-07-20 19:08:35 +0200
commitddee5f605018c77e92378b525bd23ba32fb1263a (patch)
tree36e79bf39b76fab6f7ecc6ac47d68a24825d3ce1 /scene/multiplayer/scene_cache_interface.h
parent351197bfe406a226ff304712b97847bf51ce0abc (diff)
Add peer visibility to MultiplayerSynchronizer.
MultiplayerSynchronizers can now be configured to limit their visibility to a subset of the connected peers, if the synchronized node was spawned by a MultiplayerSpawner (either automatically or via custom spawn) the given node will also be despawned remotely. The replication system doesn't have the logic to handle subspawn directly, but it is possible to handle them appropriately by manually updating the visibility of the parent before changing the one of the nested spawns via the "update_visibility" function. The visibility of each MultiplayerSynchronizer can be controlled by adding or remove filters via "[add|remove]_visibility_filter(callable)". To further optimize the network code, visibility filters can be configured to be automatically updated during idle or physics frame, or set to always require manual update (via the "update_visibility" function).
Diffstat (limited to 'scene/multiplayer/scene_cache_interface.h')
-rw-r--r--scene/multiplayer/scene_cache_interface.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/multiplayer/scene_cache_interface.h b/scene/multiplayer/scene_cache_interface.h
index 3116233b5b..6bfd683cf4 100644
--- a/scene/multiplayer/scene_cache_interface.h
+++ b/scene/multiplayer/scene_cache_interface.h
@@ -72,7 +72,8 @@ public:
virtual void process_confirm_path(int p_from, const uint8_t *p_packet, int p_packet_len) override;
// Returns true if all peers have cached path.
- virtual bool send_object_cache(Object *p_obj, NodePath p_path, int p_target, int &p_id) override;
+ virtual bool send_object_cache(Object *p_obj, int p_target, int &p_id) override;
+ virtual int make_object_cache(Object *p_obj) override;
virtual Object *get_cached_object(int p_from, uint32_t p_cache_id) override;
virtual bool is_cache_confirmed(NodePath p_path, int p_peer) override;