From de7873c2d87c3ee8af8c27e35f49767fcc384e75 Mon Sep 17 00:00:00 2001 From: Nathan Franke Date: Wed, 29 Sep 2021 21:06:28 -0500 Subject: [PATCH] Auto-Increment Debugger Port Note: This PR also changes the port of the GDScript Language Server from 6008 to 6005. This opens enough ports above the debug port (6007) for this change to be useful. --- editor/debugger/editor_debugger_node.cpp | 5 ++ editor/debugger/editor_debugger_node.h | 3 +- editor/debugger/editor_debugger_server.cpp | 48 ++++++++++++++----- editor/debugger/editor_debugger_server.h | 4 +- editor/editor_node.cpp | 12 +---- editor/editor_run.cpp | 30 ++++++------ editor/editor_run.h | 2 +- .../gdscript_language_server.h | 2 +- .../editor_debugger_server_websocket.cpp | 34 ++++++++++++- .../editor_debugger_server_websocket.h | 14 +++--- 10 files changed, 106 insertions(+), 48 deletions(-) diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index 391839d639b..85cf1558fec 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -183,6 +183,11 @@ ScriptEditorDebugger *EditorDebuggerNode::get_default_debugger() const { return Object::cast_to(tabs->get_tab_control(0)); } +String EditorDebuggerNode::get_server_uri() const { + ERR_FAIL_COND_V(server.is_null(), ""); + return server->get_uri(); +} + Error EditorDebuggerNode::start(const String &p_uri) { stop(); ERR_FAIL_COND_V(p_uri.find("://") < 0, ERR_INVALID_PARAMETER); diff --git a/editor/debugger/editor_debugger_node.h b/editor/debugger/editor_debugger_node.h index 4d9e846834a..135122db68d 100644 --- a/editor/debugger/editor_debugger_node.h +++ b/editor/debugger/editor_debugger_node.h @@ -188,8 +188,9 @@ public: void set_camera_override(CameraOverride p_override); CameraOverride get_camera_override(); - Error start(const String &p_uri = "tcp://"); + String get_server_uri() const; + Error start(const String &p_uri = "tcp://"); void stop(); void add_debugger_plugin(const Ref