You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Consolidate JSON, JSONParseResults and JSONParser into JSON
Renames JSON.parse_string() to parse() Renames JSON.decode_data() to stringify()
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
/*************************************************************************/
|
||||
|
||||
#include "jsonrpc.h"
|
||||
|
||||
#include "core/io/json.h"
|
||||
|
||||
JSONRPC::JSONRPC() {
|
||||
@@ -156,19 +157,17 @@ String JSONRPC::process_string(const String &p_input) {
|
||||
}
|
||||
|
||||
Variant ret;
|
||||
Variant input;
|
||||
String err_message;
|
||||
int err_line;
|
||||
if (OK != JSON::parse(p_input, input, err_message, err_line)) {
|
||||
ret = make_response_error(JSONRPC::PARSE_ERROR, "Parse error");
|
||||
JSON json;
|
||||
if (json.parse(p_input) == OK) {
|
||||
ret = process_action(json.get_data(), true);
|
||||
} else {
|
||||
ret = process_action(input, true);
|
||||
ret = make_response_error(JSONRPC::PARSE_ERROR, "Parse error");
|
||||
}
|
||||
|
||||
if (ret.get_type() == Variant::NIL) {
|
||||
return "";
|
||||
}
|
||||
return JSON::print(ret);
|
||||
return ret.to_json_string();
|
||||
}
|
||||
|
||||
void JSONRPC::set_scope(const String &p_scope, Object *p_obj) {
|
||||
|
||||
Reference in New Issue
Block a user