aboutsummaryrefslogtreecommitdiff
path: root/core/script_debugger_remote.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/script_debugger_remote.cpp')
-rw-r--r--core/script_debugger_remote.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp
index 14f0cddb9..56056268f 100644
--- a/core/script_debugger_remote.cpp
+++ b/core/script_debugger_remote.cpp
@@ -609,13 +609,24 @@ void ScriptDebuggerRemote::_send_object_id(ObjectID p_id) {
Array prop;
prop.push_back(pi.name);
prop.push_back(pi.type);
- prop.push_back(pi.hint);
- if (res.is_null())
- prop.push_back(pi.hint_string);
- else
- prop.push_back(String("RES:") + res->get_path());
- prop.push_back(pi.usage);
- prop.push_back(var);
+
+ //only send information that can be sent..
+ int len = 0; //test how big is this to encode
+ encode_variant(var, NULL, len);
+ if (len > packet_peer_stream->get_output_buffer_max_size()) { //limit to max size
+ prop.push_back(PROPERTY_HINT_OBJECT_TOO_BIG);
+ prop.push_back("");
+ prop.push_back(pi.usage);
+ prop.push_back(Variant());
+ } else {
+ prop.push_back(pi.hint);
+ if (res.is_null())
+ prop.push_back(pi.hint_string);
+ else
+ prop.push_back(String("RES:") + res->get_path());
+ prop.push_back(pi.usage);
+ prop.push_back(var);
+ }
send_props.push_back(prop);
}