From e6634ed26c50e99f6ccd285235fe477cb4168b06 Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Sat, 9 May 2020 15:51:15 +0100 Subject: Update submodules (#4727) Closes #4708 This updates jsoncpp, mbedtls, TCLAP and SQLiteCpp to their latest stable release. A few additional changes were needed: * jsoncpp deprecated Reader, FastWriter and StyledWriter which I've replaced with some helper functions in JsonUtils.cpp * SQLiteCpp changed how it builds with external sqlite libraries, now expecting them to be installed. The simplest path was to remove sqlite from cuberite's submodule and just use SQLiteCpp's internal version. --- src/WorldStorage/CMakeLists.txt | 2 +- src/WorldStorage/StatSerializer.cpp | 7 +++---- src/WorldStorage/WSSAnvil.cpp | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src/WorldStorage') diff --git a/src/WorldStorage/CMakeLists.txt b/src/WorldStorage/CMakeLists.txt index a0875e351..341d88e68 100644 --- a/src/WorldStorage/CMakeLists.txt +++ b/src/WorldStorage/CMakeLists.txt @@ -27,5 +27,5 @@ SET (HDRS if(NOT MSVC) add_library(WorldStorage ${SRCS} ${HDRS}) - target_link_libraries(WorldStorage fmt::fmt OSSupport) + target_link_libraries(WorldStorage fmt::fmt OSSupport SQLiteCpp) endif() diff --git a/src/WorldStorage/StatSerializer.cpp b/src/WorldStorage/StatSerializer.cpp index 2bc4b783f..b9f188c11 100644 --- a/src/WorldStorage/StatSerializer.cpp +++ b/src/WorldStorage/StatSerializer.cpp @@ -6,6 +6,7 @@ #include "StatSerializer.h" #include "../Statistics.h" +#include "../JsonUtils.h" @@ -44,9 +45,8 @@ bool cStatSerializer::Load(void) } Json::Value Root; - Json::Reader Reader; - if (Reader.parse(Data, Root, false)) + if (JsonUtils::ParseString(Data, Root)) { return LoadStatFromJSON(Root); } @@ -69,8 +69,7 @@ bool cStatSerializer::Save(void) return false; } - Json::StyledWriter Writer; - AString JsonData = Writer.write(Root); + AString JsonData = JsonUtils::WriteStyledString(Root); File.Write(JsonData.data(), JsonData.size()); File.Close(); diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index 22564248a..060d1f4df 100755 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -16,6 +16,7 @@ #include "../SetChunkData.h" #include "../Root.h" #include "../BlockType.h" +#include "../JsonUtils.h" #include "../BlockEntities/BeaconEntity.h" #include "../BlockEntities/BedEntity.h" @@ -830,8 +831,7 @@ AString cWSSAnvil::DecodeSignLine(const AString & a_Line) // Try to parse the JSON: Json::Value root; - Json::Reader reader; - if (!reader.parse(a_Line, root, false) || !root.isObject()) + if (!JsonUtils::ParseString(a_Line, root) || !root.isObject()) { return a_Line; } -- cgit v1.2.3