summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-08-09 22:46:23 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-08-18 10:21:29 +0100
commitd4dd859991205e6cecfa9a0553b89db47c983d0b (patch)
treee69020f0586cfecda02934dc95017373fddb2616 /scene
parenta03157928622b8c4048ede29cd6f1a40df893d1b (diff)
[Net] MultiplayerReplicator with initial state.
Move the former "spawnables" functions to a dedicated MultiplayerReplicator class. Support custom overrides in replicator. Spawn/despawn messages can now contain a state. The state can be automatically encoded/decoded by passing the desired object properties to `spawnable_config`. You can use script properties to optimize the state representation. 2 Callables can be also specified to completely override the default implementation for sending and receiving the spawn/despawn event. (9 bytes overhead, and there's room for improvement here). When using a custom implementation `spawn` and `despawn` can be called with any Object, `send_spawn`/`send_despawn` can receive any Variant as a state, and the path is not required. Two new functions, `spawn` and `despawn`, convey the implementation independent method for requesting a spawn/despawn of an Object, while `send_spawn` and `send_despawn` represent the more low-level send event for a Variant to be used by the custom implementations.
Diffstat (limited to 'scene')
-rw-r--r--scene/main/node.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/main/node.h b/scene/main/node.h
index 9997f4e055..6616524866 100644
--- a/scene/main/node.h
+++ b/scene/main/node.h
@@ -202,7 +202,7 @@ protected:
static String _get_name_num_separator();
friend class SceneState;
- friend class MultiplayerAPI;
+ friend class MultiplayerReplicator;
void _add_child_nocheck(Node *p_child, const StringName &p_name);
void _set_owner_nocheck(Node *p_owner);