1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Format remote printerr properly in script debugger output

Fixes #33324
This commit is contained in:
PouleyKetchoupp
2019-11-29 15:06:42 +01:00
parent 44a516986d
commit 83e376e731
3 changed files with 48 additions and 6 deletions

View File

@@ -382,8 +382,14 @@ void ScriptDebuggerRemote::_get_output() {
packet_peer_stream->put_var(output_strings.size());
while (output_strings.size()) {
const OutputString &output_string = output_strings.front()->get();
Array msg_data;
msg_data.push_back(output_string.message);
msg_data.push_back(output_string.type);
packet_peer_stream->put_var(msg_data);
packet_peer_stream->put_var(output_strings.front()->get());
output_strings.pop_front();
}
locking = false;
@@ -1157,10 +1163,15 @@ void ScriptDebuggerRemote::_print_handler(void *p_this, const String &p_string,
if (overflowed)
s += "[...]";
sdr->output_strings.push_back(s);
OutputString output_string;
output_string.message = s;
output_string.type = p_error ? MESSAGE_TYPE_ERROR : MESSAGE_TYPE_LOG;
sdr->output_strings.push_back(output_string);
if (overflowed) {
sdr->output_strings.push_back("[output overflow, print less text!]");
output_string.message = "[output overflow, print less text!]";
output_string.type = MESSAGE_TYPE_ERROR;
sdr->output_strings.push_back(output_string);
}
}
sdr->mutex->unlock();