diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-06-05 00:10:06 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-06-05 00:10:06 +0300 |
commit | a649d43fe7349e5cfa4c67de93377004902c1b07 (patch) | |
tree | 9a9b58f29a1c8690f118318420d9606c58f26c1f /src | |
parent | f07e445f80c6666b3d4713c85e668aaa5b086f16 (diff) | |
download | minetest-a649d43fe7349e5cfa4c67de93377004902c1b07.tar.gz minetest-a649d43fe7349e5cfa4c67de93377004902c1b07.tar.bz2 minetest-a649d43fe7349e5cfa4c67de93377004902c1b07.zip |
Messed around with genmap.py. Now supports format version 17.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 2 | ||||
-rw-r--r-- | src/map.cpp | 6 | ||||
-rw-r--r-- | src/mapblock.cpp | 3 | ||||
-rw-r--r-- | src/serialization.cpp | 6 |
4 files changed, 11 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp index 4bf741b96..2c85c2595 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -223,6 +223,8 @@ FIXME: The new optimized map sending doesn't sometimes send enough blocks * Take player's walking direction into account in GetNextBlocks
+TODO: Map saving should be done by EmergeThread
+
Environment:
------------
diff --git a/src/map.cpp b/src/map.cpp index f9809e9fd..579f30e9a 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -5540,9 +5540,11 @@ void ServerMap::loadBlock(std::string sectordir, std::string blockfile, MapSecto catch(SerializationError &e) { dstream<<"WARNING: Invalid block data on disk " - "(SerializationError). Ignoring. " - "A new one will be generated." + "(SerializationError). " + "what()="<<e.what() <<std::endl; + //" Ignoring. A new one will be generated. + assert(0); // TODO: Backup file; name is in fullpath. } diff --git a/src/mapblock.cpp b/src/mapblock.cpp index e31596b9c..1ebdd6b0d 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -2450,7 +2450,8 @@ void MapBlock::deSerialize(std::istream &is, u8 version) std::string s = os.str(); if(s.size() != nodecount*3) throw SerializationError - ("MapBlock::deSerialize: invalid format"); + ("MapBlock::deSerialize: decompress resulted in size" + " other than nodecount*3"); // Set contents for(u32 i=0; i<nodecount; i++) diff --git a/src/serialization.cpp b/src/serialization.cpp index 6a43d9190..ff7ca15f2 100644 --- a/src/serialization.cpp +++ b/src/serialization.cpp @@ -128,7 +128,7 @@ void decompressZlib(std::istream &is, std::ostream &os) ret = inflateInit(&z); if(ret != Z_OK) - throw SerializationError("compressZlib: inflateInit failed"); + throw SerializationError("dcompressZlib: inflateInit failed"); z.avail_in = 0; @@ -162,7 +162,7 @@ void decompressZlib(std::istream &is, std::ostream &os) || status == Z_MEM_ERROR) { zerr(status); - throw SerializationError("compressZlib: inflate failed"); + throw SerializationError("decompressZlib: inflate failed"); } int count = bufsize - z.avail_out; //dstream<<"count="<<count<<std::endl; @@ -182,7 +182,7 @@ void decompressZlib(std::istream &is, std::ostream &os) { dstream<<"unget #"<<i<<" failed"<<std::endl; dstream<<"fail="<<is.fail()<<" bad="<<is.bad()<<std::endl; - throw SerializationError("compressZlib: unget failed"); + throw SerializationError("decompressZlib: unget failed"); } } |