mirror of
https://github.com/godotengine/godot.git
synced 2024-12-15 10:12:40 +08:00
d219547c96
Initial implementation of the MultiplayerReplicationInterface and its default implementation (SceneReplicationInterface). New MultiplayerSpawner node helps dealing with instantiation of scenes on remote peers (e.g. clients). It supports both custom spawns via a `_spawn_custom` virtual function, and optional auto-spawn of known scenes via a TypedArray<PackedScenes> property. New MultiplayerSynchornizer helps synchronizing states between the local and remote peers, supports both sync and spawn properties and is configured via a `SceneReplicationConfig` resource. It can also sync via path (i.e. without being spawned by a MultiplayerSpawner if both peers has it in tree, but will not send the spawn state in that case, only the sync one.
48 lines
1.5 KiB
XML
48 lines
1.5 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<class name="MultiplayerSpawner" inherits="Node" version="4.0">
|
|
<brief_description>
|
|
</brief_description>
|
|
<description>
|
|
</description>
|
|
<tutorials>
|
|
</tutorials>
|
|
<methods>
|
|
<method name="_spawn_custom" qualifiers="virtual">
|
|
<return type="Object" />
|
|
<argument index="0" name="data" type="Variant" />
|
|
<description>
|
|
</description>
|
|
</method>
|
|
<method name="spawn">
|
|
<return type="Node" />
|
|
<argument index="0" name="data" type="Variant" default="null" />
|
|
<description>
|
|
</description>
|
|
</method>
|
|
</methods>
|
|
<members>
|
|
<member name="auto_spawn" type="bool" setter="set_auto_spawning" getter="is_auto_spawning" default="false">
|
|
</member>
|
|
<member name="replication" type="PackedScene[]" setter="set_spawnable_scenes" getter="get_spawnable_scenes" default="[]">
|
|
</member>
|
|
<member name="spawn_limit" type="int" setter="set_spawn_limit" getter="get_spawn_limit" default="0">
|
|
</member>
|
|
<member name="spawn_path" type="NodePath" setter="set_spawn_path" getter="get_spawn_path" default="NodePath("")">
|
|
</member>
|
|
</members>
|
|
<signals>
|
|
<signal name="despawned">
|
|
<argument index="0" name="scene_id" type="int" />
|
|
<argument index="1" name="node" type="Node" />
|
|
<description>
|
|
</description>
|
|
</signal>
|
|
<signal name="spawned">
|
|
<argument index="0" name="scene_id" type="int" />
|
|
<argument index="1" name="node" type="Node" />
|
|
<description>
|
|
</description>
|
|
</signal>
|
|
</signals>
|
|
</class>
|