-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrite multiplayer spawner and synchronizer, making it a module
- Loading branch information
Nathan Franke
committed
Jul 10, 2022
1 parent
d26442e
commit 5ebf7af
Showing
27 changed files
with
921 additions
and
1,528 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env python | ||
|
||
Import("env") | ||
Import("env_modules") | ||
|
||
env_replication = env_modules.Clone() | ||
|
||
env_replication.add_source_files(env.modules_sources, "editor/*.cpp") | ||
env_replication.add_source_files(env.modules_sources, "*.cpp") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
def can_build(env, platform): | ||
return True | ||
|
||
|
||
def configure(env): | ||
pass | ||
|
||
|
||
def get_doc_classes(): | ||
return [ | ||
"MultiplayerSpawner", | ||
"MultiplayerSynchronizer", | ||
"SceneReplicationConfig", | ||
] | ||
|
||
|
||
def get_doc_path(): | ||
return "doc_classes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<class name="MultiplayerSpawner" inherits="Node" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd"> | ||
<brief_description> | ||
</brief_description> | ||
<description> | ||
</description> | ||
<tutorials> | ||
</tutorials> | ||
<methods> | ||
<method name="_spawn_custom" qualifiers="virtual"> | ||
<return type="Node" /> | ||
<argument index="0" name="custom_data" type="Variant" /> | ||
<description> | ||
Virtual method called when spawning a custom node, either on the multiplayer authority or on a puppet. | ||
|
||
Do not add custom nodes to the scene, as this is done automatically. | ||
</description> | ||
</method> | ||
<method name="spawn_custom"> | ||
<return type="Node" /> | ||
<argument index="0" name="custom_data" type="Variant" default="null" /> | ||
<description> | ||
Request, as the multiplayer authority, to spawn a node on all clients. Calls [method _spawn_custom] internally. | ||
</description> | ||
</method> | ||
</methods> | ||
<members> | ||
<member name="spawn_limit" type="int" setter="set_spawn_limit" getter="get_spawn_limit" default="0"> | ||
Maxmium node count that can be spawned. Includes both custom spawns and spawned scenes. A value of 0 means no limit. | ||
</member> | ||
<member name="spawn_path" type="NodePath" setter="set_spawn_path" getter="get_spawn_path" default="NodePath("..")"> | ||
Parent node that listens for spawnable children. Custom spawned nodes are added here too. | ||
</member> | ||
<member name="spawnable_scenes" type="Array" setter="set_spawnable_scenes" getter="get_spawnable_scenes" default="[]"> | ||
Array of scenes that, when added as a child of [member spawn_path], are automatically spawned on multiplayer puppets. | ||
</member> | ||
</members> | ||
<signals> | ||
<signal name="despawned"> | ||
<argument index="0" name="scene_index" type="int" /> | ||
<argument index="1" name="node" type="Node" /> | ||
<description> | ||
Signal emitted after the multiplayer authority despawns a scene instance. Not called for custom spawns. | ||
</description> | ||
</signal> | ||
<signal name="spawned"> | ||
<argument index="0" name="scene_index" type="int" /> | ||
<argument index="1" name="node" type="Node" /> | ||
<description> | ||
Signal emitted after the multiplayer authority spawns a scene instance. Not called for custom spawns. | ||
</description> | ||
</signal> | ||
</signals> | ||
</class> |
2 changes: 1 addition & 1 deletion
2
doc/classes/MultiplayerSynchronizer.xml → ...n/doc_classes/MultiplayerSynchronizer.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
doc/classes/SceneReplicationConfig.xml → ...on/doc_classes/SceneReplicationConfig.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
Oops, something went wrong.