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/main.cpp | 152 ++++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 125 insertions(+), 27 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index fe1bcd450..41b62b1dd 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -739,6 +739,20 @@ void SpeedTests() } } +static void print_worldspecs(const std::vector &worldspecs, + std::ostream &os) +{ + for(u32 i=0; iexists("map-dir")) commanded_world = g_settings->get("map-dir"); + // World name + std::string commanded_worldname = ""; + if(cmd_args.exists("worldname")) + commanded_worldname = cmd_args.get("worldname"); + // Strip world.mt from commanded_world { std::string worldmt = "world.mt"; @@ -1037,21 +1058,74 @@ int main(int argc, char *argv[]) // World directory std::string world_path; + verbosestream<<"Determining world path"< worldspecs = getAvailableWorlds(); + world_path = ""; + for(u32 i=0; i worldspecs = getAvailableWorlds(); + // If a world name was specified, select it + if(commanded_worldname != ""){ + world_path = ""; + for(u32 i=0; i 1){ + dstream<<"Multiple worlds are available."<" + <<" or --world "<get("default_game"); + infostream<<"Using default gameid ["<