mirror of
https://github.com/minetest/minetest.git
synced 2024-09-12 00:26:50 +02:00
game.conf: Add setting to use volatile a map backend (#12956)
This commit is contained in:
parent
cd8a7fe472
commit
8de9e2ac84
@ -85,6 +85,8 @@ The game directory can contain the following files:
|
|||||||
(this does not work for `enable_server`).
|
(this does not work for `enable_server`).
|
||||||
Only these settings are supported:
|
Only these settings are supported:
|
||||||
`enable_damage`, `creative_mode`, `enable_server`.
|
`enable_damage`, `creative_mode`, `enable_server`.
|
||||||
|
* `map_persistent`: Specifies whether newly created worlds should use
|
||||||
|
a persistent map backend. Defaults to `true` (= "sqlite3")
|
||||||
* `author`: The author of the game. It only appears when downloaded from
|
* `author`: The author of the game. It only appears when downloaded from
|
||||||
ContentDB.
|
ContentDB.
|
||||||
* `release`: Ignore this: Should only ever be set by ContentDB, as it is
|
* `release`: Ignore this: Should only ever be set by ContentDB, as it is
|
||||||
|
@ -380,11 +380,21 @@ void loadGameConfAndInitWorld(const std::string &path, const std::string &name,
|
|||||||
// Create world.mt if does not already exist
|
// Create world.mt if does not already exist
|
||||||
std::string worldmt_path = final_path + DIR_DELIM "world.mt";
|
std::string worldmt_path = final_path + DIR_DELIM "world.mt";
|
||||||
if (!fs::PathExists(worldmt_path)) {
|
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("world_name", name);
|
||||||
conf.set("gameid", gamespec.id);
|
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("player_backend", "sqlite3");
|
||||||
conf.set("auth_backend", "sqlite3");
|
conf.set("auth_backend", "sqlite3");
|
||||||
conf.set("mod_storage_backend", "sqlite3");
|
conf.set("mod_storage_backend", "sqlite3");
|
||||||
|
Loading…
Reference in New Issue
Block a user