diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2023-09-27 01:47:23 +0200 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2023-10-10 14:42:54 +0200 |
commit | 311a27281f8f04335f079eef506798903296192f (patch) | |
tree | 4a9b1aaa3bb369f1f6e2b1dc8806e2ea1267986b /modules/multiplayer/scene_replication_interface.h | |
parent | 9ce423914ec4a392e42dbf894dc7929befcc7e1d (diff) | |
download | redot-engine-311a27281f8f04335f079eef506798903296192f.tar.gz |
[MP] Avoid unnecessary internal ref/unrefs
Access the various internal components (cache/replicator) via pointer,
to avoid unnecessary overhead.
Diffstat (limited to 'modules/multiplayer/scene_replication_interface.h')
-rw-r--r-- | modules/multiplayer/scene_replication_interface.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/multiplayer/scene_replication_interface.h b/modules/multiplayer/scene_replication_interface.h index 4cc2f20ffa..3b3ec6a9ef 100644 --- a/modules/multiplayer/scene_replication_interface.h +++ b/modules/multiplayer/scene_replication_interface.h @@ -37,6 +37,7 @@ #include "core/object/ref_counted.h" class SceneMultiplayer; +class SceneCacheInterface; class SceneReplicationInterface : public RefCounted { GDCLASS(SceneReplicationInterface, RefCounted); @@ -87,6 +88,7 @@ private: // Replicator config. SceneMultiplayer *multiplayer = nullptr; + SceneCacheInterface *multiplayer_cache = nullptr; PackedByteArray packet_cache; int sync_mtu = 1350; // Highly dependent on underlying protocol. int delta_mtu = 65535; @@ -144,8 +146,9 @@ public: void set_max_delta_packet_size(int p_size); int get_max_delta_packet_size() const; - SceneReplicationInterface(SceneMultiplayer *p_multiplayer) { + SceneReplicationInterface(SceneMultiplayer *p_multiplayer, SceneCacheInterface *p_cache) { multiplayer = p_multiplayer; + multiplayer_cache = p_cache; } }; |