aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2022-11-15 16:45:48 +0100
committerGitHub <noreply@github.com>2022-11-15 16:45:48 +0100
commit8de9e2ac845e62965d895f217ac3a5acd794f8bb (patch)
tree74bf5f53d77b40900a6f32bccd80745cad494ce4 /src
parentcd8a7fe47298be12620cab62be8cf0816fabb095 (diff)
downloadminetest-8de9e2ac845e62965d895f217ac3a5acd794f8bb.tar.xz
game.conf: Add setting to use volatile a map backend (#12956)
Diffstat (limited to 'src')
-rw-r--r--src/content/subgames.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/content/subgames.cpp b/src/content/subgames.cpp
index 3658fa83e..c50c6f429 100644
--- a/src/content/subgames.cpp
+++ b/src/content/subgames.cpp
@@ -380,11 +380,21 @@ void loadGameConfAndInitWorld(const std::string &path, const std::string &name,
// Create world.mt if does not already exist
std::string worldmt_path = final_path + DIR_DELIM "world.mt";
if (!fs::PathExists(worldmt_path)) {
- Settings conf;
+ Settings gameconf;
+ std::string gameconf_path = gamespec.path + DIR_DELIM "game.conf";
+ gameconf.readConfigFile(gameconf_path.c_str());
+
+ Settings conf; // for world.mt
conf.set("world_name", name);
conf.set("gameid", gamespec.id);
- conf.set("backend", "sqlite3");
+
+ std::string backend = "sqlite3";
+ if (gameconf.exists("map_persistent") && !gameconf.getBool("map_persistent")) {
+ backend = "dummy";
+ }
+ conf.set("backend", backend);
+
conf.set("player_backend", "sqlite3");
conf.set("auth_backend", "sqlite3");
conf.set("mod_storage_backend", "sqlite3");