summaryrefslogtreecommitdiffstats
path: root/src/WorldStorage/StatSerializer.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2020-05-09 16:51:15 +0200
committerGitHub <noreply@github.com>2020-05-09 16:51:15 +0200
commite6634ed26c50e99f6ccd285235fe477cb4168b06 (patch)
treeb533a69db545835a886bcd8c5b05609b4c830d11 /src/WorldStorage/StatSerializer.cpp
parentUpgrade to C++17 [CI] (#4716) (diff)
downloadcuberite-e6634ed26c50e99f6ccd285235fe477cb4168b06.tar
cuberite-e6634ed26c50e99f6ccd285235fe477cb4168b06.tar.gz
cuberite-e6634ed26c50e99f6ccd285235fe477cb4168b06.tar.bz2
cuberite-e6634ed26c50e99f6ccd285235fe477cb4168b06.tar.lz
cuberite-e6634ed26c50e99f6ccd285235fe477cb4168b06.tar.xz
cuberite-e6634ed26c50e99f6ccd285235fe477cb4168b06.tar.zst
cuberite-e6634ed26c50e99f6ccd285235fe477cb4168b06.zip
Diffstat (limited to 'src/WorldStorage/StatSerializer.cpp')
-rw-r--r--src/WorldStorage/StatSerializer.cpp7
1 files changed, 3 insertions, 4 deletions
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();