mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
[MP] Avoid unnecessary internal ref/unrefs
Access the various internal components (cache/replicator) via pointer, to avoid unnecessary overhead.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user