summaryrefslogtreecommitdiff
path: root/src/subgame.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-03-25 20:29:56 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-03-25 20:30:58 +0300
commit6779036d25e460ca5e8c6d290772e78c3277ccfc (patch)
tree79eef0ca1026053b740ca1ec1e5314c73f0d3ea4 /src/subgame.cpp
parent4fb6c07535cff9a385344f5025b25892b828ebc4 (diff)
downloadminetest-6779036d25e460ca5e8c6d290772e78c3277ccfc.tar.gz
minetest-6779036d25e460ca5e8c6d290772e78c3277ccfc.tar.bz2
minetest-6779036d25e460ca5e8c6d290772e78c3277ccfc.zip
Make server world selection not brain dead and use gameid 'minetest' instead of 'mesetint'
Diffstat (limited to 'src/subgame.cpp')
-rw-r--r--src/subgame.cpp15
1 files changed, 13 insertions, 2 deletions
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<SubgameSpec> 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<WorldSpec> 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: "<<name<<") ";