| 230 | } |
| 231 | |
| 232 | void MultiplayerSpawner::_node_added(Node *p_node) { |
| 233 | if (!get_multiplayer()->has_multiplayer_peer() || !is_multiplayer_authority()) { |
| 234 | return; |
| 235 | } |
| 236 | if (tracked_nodes.has(p_node->get_instance_id())) { |
| 237 | return; |
| 238 | } |
| 239 | const Node *parent = get_spawn_node(); |
| 240 | if (!parent || p_node->get_parent() != parent) { |
| 241 | return; |
| 242 | } |
| 243 | int id = find_spawnable_scene_index_from_path(p_node->get_scene_file_path()); |
| 244 | if (id == INVALID_ID) { |
| 245 | return; |
| 246 | } |
| 247 | const String name = p_node->get_name(); |
| 248 | ERR_FAIL_COND_MSG(name.validate_node_name() != name, vformat("Unable to auto-spawn node with reserved name: %s. Make sure to add your replicated scenes via 'add_child(node, true)' to produce valid names.", name)); |
| 249 | _track(p_node, Variant(), id); |
| 250 | } |
| 251 | |
| 252 | NodePath MultiplayerSpawner::get_spawn_path() const { |
| 253 | return spawn_path; |
nothing calls this directly
no test coverage detected