From 674be38fc262aab78ed75141c70e5c02830ca80d Mon Sep 17 00:00:00 2001 From: Sfan5 Date: Tue, 8 Apr 2014 21:39:21 +0200 Subject: Add redis database backend --- src/main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index c93af0d77..bb0c3a273 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -84,6 +84,9 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifdef USE_LEVELDB #include "database-leveldb.h" #endif +#if USE_REDIS +#include "database-redis.h" +#endif /* Settings. @@ -1242,7 +1245,7 @@ int main(int argc, char *argv[]) } if (!world_mt.exists("backend")) { errorstream << "Please specify your current backend in world.mt file:" - << std::endl << " backend = {sqlite3|leveldb|dummy}" << std::endl; + << std::endl << " backend = {sqlite3|leveldb|redis|dummy}" << std::endl; return 1; } std::string backend = world_mt.get("backend"); @@ -1257,6 +1260,10 @@ int main(int argc, char *argv[]) else if (migrate_to == "leveldb") new_db = new Database_LevelDB(&(ServerMap&)server.getMap(), world_path); #endif + #if USE_REDIS + else if (migrate_to == "redis") + new_db = new Database_Redis(&(ServerMap&)server.getMap(), world_path); + #endif else { errorstream << "Migration to " << migrate_to << " is not supported" << std::endl; return 1; -- cgit v1.2.3