From 7e44c2ace136a5dfe1c999167bb0aadcb8a78c4f Mon Sep 17 00:00:00 2001 From: Sfan5 Date: Fri, 6 Sep 2013 18:22:12 +0200 Subject: Make it compile --- src/database-dummy.cpp | 2 +- src/database-leveldb.cpp | 2 +- src/database-sqlite3.cpp | 2 +- src/database.h | 2 ++ src/main.cpp | 8 ++++---- src/map.cpp | 5 ++++- src/server.h | 1 + 7 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/database-dummy.cpp b/src/database-dummy.cpp index c54ff0bce..7a36a8944 100644 --- a/src/database-dummy.cpp +++ b/src/database-dummy.cpp @@ -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(); diff --git a/src/database-leveldb.cpp b/src/database-leveldb.cpp index 34e153988..e0ab4f090 100644 --- a/src/database-leveldb.cpp +++ b/src/database-leveldb.cpp @@ -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(); diff --git a/src/database-sqlite3.cpp b/src/database-sqlite3.cpp index e15aa0c1c..69795a1f2 100644 --- a/src/database-sqlite3.cpp +++ b/src/database-sqlite3.cpp @@ -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(); diff --git a/src/database.h b/src/database.h index 562e3ad20..b6d8950ba 100644 --- a/src/database.h +++ b/src/database.h @@ -7,6 +7,8 @@ #include "mapblock.h" #include "main.h" #include "filesys.h" +#include "serialization.h" +#include class Database; class ServerMap; diff --git a/src/main.cpp b/src/main.cpp index c49829592..98b600f9d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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 blocks; + std::list blocks; ServerMap &old_map = ((ServerMap&)server.getMap()); old_map.listAllLoadableBlocks(blocks); int count = 0; new_db->beginSave(); - for (core::list::Iterator i = blocks.begin(); i != blocks.end(); ++i) { + for (std::list::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)); diff --git a/src/map.cpp b/src/map.cpp index e2191f9e1..7a5296bac 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -3371,7 +3371,10 @@ void ServerMap::listAllLoadableBlocks(std::list &dst) errorstream<<"Map::listAllLoadableBlocks(): Result will be missing " <<"all blocks that are stored in flat files"<listAllLoadableBlocks(dst); + core::list dst_; + dbase->listAllLoadableBlocks(dst_); + for(core::list::Iterator i = dst_.begin(); i != dst_.end(); ++i) + dst.push_back(*i); } void ServerMap::listAllLoadedBlocks(std::list &dst) diff --git a/src/server.h b/src/server.h index 04cdecf88..d502d68a0 100644 --- a/src/server.h +++ b/src/server.h @@ -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 #include #include -- cgit v1.2.3