| 30 | |
| 31 | |
| 32 | bool cScoreboardSerializer::Load(void) |
| 33 | { |
| 34 | AString Data = cFile::ReadWholeFile(FILE_IO_PREFIX + m_Path); |
| 35 | if (Data.empty()) |
| 36 | { |
| 37 | return false; |
| 38 | } |
| 39 | |
| 40 | AString Uncompressed; |
| 41 | int res = UncompressStringGZIP(Data.data(), Data.size(), Uncompressed); |
| 42 | |
| 43 | if (res != Z_OK) |
| 44 | { |
| 45 | return false; |
| 46 | } |
| 47 | |
| 48 | // Parse the NBT data: |
| 49 | cParsedNBT NBT(Uncompressed.data(), Uncompressed.size()); |
| 50 | if (!NBT.IsValid()) |
| 51 | { |
| 52 | // NBT Parsing failed |
| 53 | return false; |
| 54 | } |
| 55 | |
| 56 | return LoadScoreboardFromNBT(NBT); |
| 57 | } |
| 58 | |
| 59 | |
| 60 |
nothing calls this directly
no test coverage detected