From 6779036d25e460ca5e8c6d290772e78c3277ccfc Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 25 Mar 2012 20:29:56 +0300 Subject: Make server world selection not brain dead and use gameid 'minetest' instead of 'mesetint' --- src/subgame.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/subgame.cpp') diff --git a/src/subgame.cpp b/src/subgame.cpp index 3d4480ebf..d7668b0e5 100644 --- a/src/subgame.cpp +++ b/src/subgame.cpp @@ -78,7 +78,13 @@ std::vector getAvailableGames() return specs; } -#define LEGACY_GAMEID "mesetint" +#define LEGACY_GAMEID "minetest" + +bool getWorldExists(const std::string &world_path) +{ + return (fs::PathExists(world_path + DIR_DELIM + "map_meta.txt") || + fs::PathExists(world_path + DIR_DELIM + "world.mt")); +} std::string getWorldGameId(const std::string &world_path, bool can_be_legacy) { @@ -95,6 +101,9 @@ std::string getWorldGameId(const std::string &world_path, bool can_be_legacy) } if(!conf.exists("gameid")) return ""; + // The "mesetint" gameid has been discarded + if(conf.get("gameid") == "mesetint") + return "minetest"; return conf.get("gameid"); } @@ -113,7 +122,9 @@ std::vector getAvailableWorlds() continue; std::string fullpath = *i + DIR_DELIM + dirvector[j].name; std::string name = dirvector[j].name; - std::string gameid = getWorldGameId(fullpath); + // Just allow filling in the gameid always for now + bool can_be_legacy = true; + std::string gameid = getWorldGameId(fullpath, can_be_legacy); WorldSpec spec(fullpath, name, gameid); if(!spec.isValid()){ infostream<<"(invalid: "<