aboutsummaryrefslogtreecommitdiff
path: root/src/serverenvironment.cpp
diff options
context:
space:
mode:
authorluk3yx <luk3yx@users.noreply.github.com>2020-06-13 04:54:20 +1200
committerGitHub <noreply@github.com>2020-06-12 18:54:20 +0200
commit982a030f330bd4f4953ed7d4a7f88286f6fd645d (patch)
treead8a2bdb6708f06aadf33323c78ade1436df6a52 /src/serverenvironment.cpp
parent3f0cbbc372d5f359af18f5cbad37a1b165d3df4e (diff)
downloadminetest-982a030f330bd4f4953ed7d4a7f88286f6fd645d.tar.gz
minetest-982a030f330bd4f4953ed7d4a7f88286f6fd645d.tar.bz2
minetest-982a030f330bd4f4953ed7d4a7f88286f6fd645d.zip
Add LevelDB player database (#9982)
Diffstat (limited to 'src/serverenvironment.cpp')
-rw-r--r--src/serverenvironment.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/serverenvironment.cpp b/src/serverenvironment.cpp
index 222b4d203..2c6a39ee3 100644
--- a/src/serverenvironment.cpp
+++ b/src/serverenvironment.cpp
@@ -2089,6 +2089,7 @@ PlayerDatabase *ServerEnvironment::openPlayerDatabase(const std::string &name,
if (name == "dummy")
return new Database_Dummy();
+
#if USE_POSTGRESQL
if (name == "postgresql") {
std::string connect_string;
@@ -2096,6 +2097,12 @@ PlayerDatabase *ServerEnvironment::openPlayerDatabase(const std::string &name,
return new PlayerDatabasePostgreSQL(connect_string);
}
#endif
+
+#if USE_LEVELDB
+ if (name == "leveldb")
+ return new PlayerDatabaseLevelDB(savedir);
+#endif
+
if (name == "files")
return new PlayerDatabaseFiles(savedir + DIR_DELIM + "players");
@@ -2116,7 +2123,7 @@ bool ServerEnvironment::migratePlayersDatabase(const GameParams &game_params,
if (!world_mt.exists("player_backend")) {
errorstream << "Please specify your current backend in world.mt:"
<< std::endl
- << " player_backend = {files|sqlite3|postgresql}"
+ << " player_backend = {files|sqlite3|leveldb|postgresql}"
<< std::endl;
return false;
}