From d4dd859991205e6cecfa9a0553b89db47c983d0b Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Mon, 9 Aug 2021 22:46:23 +0200 Subject: [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. --- scene/main/node.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scene/main') 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); -- cgit v1.2.3