Make it compile
authorSfan5 <sfan5@live.de>
Fri, 6 Sep 2013 16:22:12 +0000 (18:22 +0200)
committerSfan5 <sfan5@live.de>
Mon, 9 Sep 2013 20:50:50 +0000 (22:50 +0200)
src/database-dummy.cpp
src/database-leveldb.cpp
src/database-sqlite3.cpp
src/database.h
src/main.cpp
src/map.cpp
src/server.h

index c54ff0bce5f21ce985191a636bcd6ee0a604189b..7a36a8944544b0d7f7edfe2001fdf835d173e996 100644 (file)
@@ -47,7 +47,7 @@ void Database_Dummy::saveBlock(MapBlock *block)
        }
 
        // Format used for writing
-       u8 version = SER_FMT_VER_HIGHEST;
+       u8 version = SER_FMT_VER_HIGHEST_WRITE;
        // Get destination
        v3s16 p3d = block->getPos();
 
index 34e153988fd3952738c3eaa9be3b262576023bf2..e0ab4f0902219919c0190f3ec86920a7c8a50137 100644 (file)
@@ -55,7 +55,7 @@ void Database_LevelDB::saveBlock(MapBlock *block)
        }
 
        // Format used for writing
-       u8 version = SER_FMT_VER_HIGHEST;
+       u8 version = SER_FMT_VER_HIGHEST_WRITE;
        // Get destination
        v3s16 p3d = block->getPos();
 
index e15aa0c1ccaf4d97daace66cbb4df1c94bd0bd39..69795a1f26c4676a3d39b2b8a05e757a34e5d81b 100644 (file)
@@ -135,7 +135,7 @@ void Database_SQLite3::saveBlock(MapBlock *block)
        }
 
        // Format used for writing
-       u8 version = SER_FMT_VER_HIGHEST;
+       u8 version = SER_FMT_VER_HIGHEST_WRITE;
        // Get destination
        v3s16 p3d = block->getPos();
        
index 562e3ad20a12679197d1620f026ad708de324d84..b6d8950baf2002f7348b32c5a5acc022fd9152d6 100644 (file)
@@ -7,6 +7,8 @@
 #include "mapblock.h"
 #include "main.h"
 #include "filesys.h"
+#include "serialization.h"
+#include <irrList.h>
 
 class Database;
 class ServerMap;
index c49829592049ebf68dc0a11879948b3f5e4209c8..98b600f9dc0c312bab7ba1228a3c69fa547a9445 100644 (file)
@@ -795,8 +795,8 @@ int main(int argc, char *argv[])
        allowed_options.insert(std::make_pair("gameid", ValueSpec(VALUETYPE_STRING,
                        _("Set gameid (\"--gameid list\" prints available ones)"))));
        #if USE_LEVELDB
-       allowed_options.insert("migrate", ValueSpec(VALUETYPE_STRING,
-                       _("Migrate from current map backend to another")));
+       allowed_options.insert(std::make_pair("migrate", ValueSpec(VALUETYPE_STRING,
+                       _("Migrate from current map backend to another"))));
        #endif
 #ifndef SERVER
        allowed_options.insert(std::make_pair("videomodes", ValueSpec(VALUETYPE_FLAG,
@@ -1248,12 +1248,12 @@ int main(int argc, char *argv[])
                                return 1;
                        }
 
-                       core::list<v3s16> blocks;
+                       std::list<v3s16> blocks;
                        ServerMap &old_map = ((ServerMap&)server.getMap());
                        old_map.listAllLoadableBlocks(blocks);
                        int count = 0;
                        new_db->beginSave();
-                       for (core::list<v3s16>::Iterator i = blocks.begin(); i != blocks.end(); ++i) {
+                       for (std::list<v3s16>::iterator i = blocks.begin(); i != blocks.end(); ++i) {
                                MapBlock *block = old_map.loadBlock(*i);
                                new_db->saveBlock(block);
                                MapSector *sector = old_map.getSectorNoGenerate(v2s16(i->X, i->Z));
index e2191f9e1b7c4a69cc5c85152cd4a3bee39b2580..7a5296bacdf036dfe79c3c0fc6edda83ba0f1427 100644 (file)
@@ -3371,7 +3371,10 @@ void ServerMap::listAllLoadableBlocks(std::list<v3s16> &dst)
                errorstream<<"Map::listAllLoadableBlocks(): Result will be missing "
                                <<"all blocks that are stored in flat files"<<std::endl;
        }
-       dbase->listAllLoadableBlocks(dst);
+       core::list<v3s16> dst_;
+       dbase->listAllLoadableBlocks(dst_);
+       for(core::list<v3s16>::Iterator i = dst_.begin(); i != dst_.end(); ++i)
+               dst.push_back(*i);
 }
 
 void ServerMap::listAllLoadedBlocks(std::list<v3s16> &dst)
index 04cdecf88e0f5c4c5ec1076f39e9eec2cd4ecdcb..d502d68a0b0fccc77ee45ad0412ed323e10d3047 100644 (file)
@@ -32,6 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "rollback_interface.h" // Needed for rollbackRevertActions()
 #include "util/numeric.h"
 #include "util/thread.h"
+#include "environment.h"
 #include <string>
 #include <list>
 #include <map>