summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2017-06-08 21:24:36 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2017-06-10 23:34:24 +0200
commitfc1368bee00301ef7c789982474876c5a6ea9854 (patch)
tree235132ef6b7d8d69cee9d70ecfe7d079153ba893
parent935f730170d75955f708b5014da3e11c95fcdac4 (diff)
Editor now shows error when debug port is in use
-rw-r--r--editor/script_editor_debugger.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index 7f1e6023bf..6d22935dcb 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -1035,14 +1035,17 @@ void ScriptEditorDebugger::start() {
EditorNode::get_singleton()->make_bottom_panel_item_visible(this);
}
- uint16_t port = GLOBAL_GET("network/debug/remote_port");
perf_history.clear();
for (int i = 0; i < Performance::MONITOR_MAX; i++) {
perf_max[i] = 0;
}
- server->listen(port);
+ int remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port");
+ if (server->listen(remote_port) != OK) {
+ EditorNode::get_log()->add_message(String("** Error listening on port ") + itos(remote_port) + String(" **"));
+ return;
+ }
set_process(true);
}