summaryrefslogtreecommitdiffstats
path: root/modules/multiplayer/multiplayer_synchronizer.cpp
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-09-16 22:42:05 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2022-09-17 00:06:42 +0200
commitba6f5471c4ace6c2b5177d400b5d58aa626e05ef (patch)
treea5c69a462d32ace1a3975cd974074079b6d05c01 /modules/multiplayer/multiplayer_synchronizer.cpp
parent57bdddce02370af3d13e6edc583afdc17264147d (diff)
downloadredot-engine-ba6f5471c4ace6c2b5177d400b5d58aa626e05ef.tar.gz
[MP] Add warnings to spawner and synchronizer.
MultiplayerSpawner: - When spawn_path is invalid. - When the auto spawn list is empty and _spawn_custom is not overridden. Note: We remove the warning for placeholder scripts since there's no way of knowing if they have a certain method. MultiplayerSynchronizer: - When root_path is invalid.
Diffstat (limited to 'modules/multiplayer/multiplayer_synchronizer.cpp')
-rw-r--r--modules/multiplayer/multiplayer_synchronizer.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/multiplayer/multiplayer_synchronizer.cpp b/modules/multiplayer/multiplayer_synchronizer.cpp
index eee1495c14..01ecd1a7de 100644
--- a/modules/multiplayer/multiplayer_synchronizer.cpp
+++ b/modules/multiplayer/multiplayer_synchronizer.cpp
@@ -94,6 +94,16 @@ void MultiplayerSynchronizer::_update_process() {
}
}
+TypedArray<String> MultiplayerSynchronizer::get_configuration_warnings() const {
+ TypedArray<String> warnings = Node::get_configuration_warnings();
+
+ if (root_path.is_empty() || !has_node(root_path)) {
+ warnings.push_back(RTR("A valid NodePath must be set in the \"Root Path\" property in order for MultiplayerSynchronizer to be able to synchronize properties."));
+ }
+
+ return warnings;
+}
+
Error MultiplayerSynchronizer::get_state(const List<NodePath> &p_properties, Object *p_obj, Vector<Variant> &r_variant, Vector<const Variant *> &r_variant_ptrs) {
ERR_FAIL_COND_V(!p_obj, ERR_INVALID_PARAMETER);
r_variant.resize(p_properties.size());