MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / process_string

Method process_string

modules/jsonrpc/jsonrpc.cpp:172–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172String JSONRPC::process_string(const String &p_input) {
173 if (p_input.is_empty()) {
174 return String();
175 }
176
177 Variant ret;
178 JSON json;
179 if (json.parse(p_input) == OK) {
180 ret = process_action(json.get_data(), true);
181 } else {
182 ret = make_response_error(JSONRPC::PARSE_ERROR, "Parse error");
183 }
184
185 if (ret.get_type() == Variant::NIL) {
186 return "";
187 }
188 return ret.to_json_string();
189}
190
191void JSONRPC::set_method(const String &p_name, const Callable &p_callback) {
192 methods[p_name] = p_callback;

Callers 3

_server_loopMethod · 0.80
test_process_stringFunction · 0.80
test_jsonrpc.hFile · 0.80

Calls 6

to_json_stringMethod · 0.80
StringClass · 0.50
is_emptyMethod · 0.45
parseMethod · 0.45
get_dataMethod · 0.45
get_typeMethod · 0.45

Tested by 1

test_process_stringFunction · 0.64