MCPcopy Create free account
hub / github.com/cuberite/cuberite / Load

Method Load

src/WorldStorage/MapSerializer.cpp:33–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

LoadMapDataMethod · 0.45
cWorldMethod · 0.45

Calls 6

UncompressStringGZIPFunction · 0.85
emptyMethod · 0.80
sizeMethod · 0.80
GetShortMethod · 0.80
IsValidMethod · 0.45
FindChildByNameMethod · 0.45

Tested by

no test coverage detected