Add support for multiple RemoteDebuggerPeer(s).

It is now possible to register protocol handlers (default tcp://) to
support additional debugging communication layers (e.g. websocket).
This commit is contained in:
Fabio Alessandrelli
2020-05-12 15:09:13 +02:00
parent beb87504e0
commit ed225faf31
6 changed files with 49 additions and 30 deletions
+3 -7
View File
@@ -673,6 +673,9 @@ void RemoteDebugger::debug(bool p_can_continue, bool p_is_error_breakpoint) {
ERR_FAIL_COND_MSG(!is_peer_connected(), "Script Debugger failed to connect, but being used anyway.");
if (!peer->can_block())
return; // Peer does not support blocking IO. We could at least send the error though.
ScriptLanguage *script_lang = script_debugger->get_break_language();
const String error_str = script_lang ? script_lang->debug_get_error() : "";
Array msg;
@@ -886,13 +889,6 @@ Error RemoteDebugger::_profiler_capture(const String &p_cmd, const Array &p_data
return OK;
}
RemoteDebugger *RemoteDebugger::create_for_uri(const String &p_uri) {
Ref<RemoteDebuggerPeer> peer = RemoteDebuggerPeer::create_from_uri(p_uri);
if (peer.is_valid())
return memnew(RemoteDebugger(peer));
return nullptr;
}
RemoteDebugger::RemoteDebugger(Ref<RemoteDebuggerPeer> p_peer) {
peer = p_peer;
max_chars_per_second = GLOBAL_GET("network/limits/debugger/max_chars_per_second");