diff options
author | andrew <xdotftw@gmail.com> | 2014-05-13 13:53:15 +0200 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-05-13 13:53:15 +0200 |
commit | 466ff2204f18fda5f4f0f0b3e19f671d57747c24 (patch) | |
tree | 164ce181d4c1bde9801f51296e497a4a603796dc /src/WorldStorage | |
parent | Movement Statistics (diff) | |
download | cuberite-466ff2204f18fda5f4f0f0b3e19f671d57747c24.tar cuberite-466ff2204f18fda5f4f0f0b3e19f671d57747c24.tar.gz cuberite-466ff2204f18fda5f4f0f0b3e19f671d57747c24.tar.bz2 cuberite-466ff2204f18fda5f4f0f0b3e19f671d57747c24.tar.lz cuberite-466ff2204f18fda5f4f0f0b3e19f671d57747c24.tar.xz cuberite-466ff2204f18fda5f4f0f0b3e19f671d57747c24.tar.zst cuberite-466ff2204f18fda5f4f0f0b3e19f671d57747c24.zip |
Diffstat (limited to 'src/WorldStorage')
-rw-r--r-- | src/WorldStorage/StatSerializer.cpp | 7 | ||||
-rw-r--r-- | src/WorldStorage/StatSerializer.h | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/WorldStorage/StatSerializer.cpp b/src/WorldStorage/StatSerializer.cpp index 66e5e1e9e..74113941c 100644 --- a/src/WorldStorage/StatSerializer.cpp +++ b/src/WorldStorage/StatSerializer.cpp @@ -11,15 +11,18 @@ -cStatSerializer::cStatSerializer(const AString& a_WorldName, const AString& a_PlayerName, cStatManager* a_Manager) +cStatSerializer::cStatSerializer(const AString & a_WorldName, const AString & a_PlayerName, cStatManager * a_Manager) : m_Manager(a_Manager) { + // Even though stats are shared between worlds, they are (usually) saved + // inside the folder of the default world. + AString StatsPath; Printf(StatsPath, "%s/stats", a_WorldName.c_str()); m_Path = StatsPath + "/" + a_PlayerName + ".json"; - /* Ensure that the directory exists. */ + // Ensure that the directory exists. cFile::CreateFolder(FILE_IO_PREFIX + StatsPath); } diff --git a/src/WorldStorage/StatSerializer.h b/src/WorldStorage/StatSerializer.h index 43514465b..72f8d74f1 100644 --- a/src/WorldStorage/StatSerializer.h +++ b/src/WorldStorage/StatSerializer.h @@ -25,10 +25,12 @@ class cStatSerializer { public: - cStatSerializer(const AString& a_WorldName, const AString& a_PlayerName, cStatManager* a_Manager); + cStatSerializer(const AString & a_WorldName, const AString & a_PlayerName, cStatManager * a_Manager); + /* Try to load the player statistics. Returns whether the operation was successful or not. */ bool Load(void); + /* Try to save the player statistics. Returns whether the operation was successful or not. */ bool Save(void); |