From 6f93c01af942d75db105eac6afcd7d477967ccb6 Mon Sep 17 00:00:00 2001 From: Jeija Date: Tue, 25 Dec 2012 12:20:51 +0100 Subject: Add a list of servers to the "Multiplayer" tab If USE_CURL is set, it also downloads a list from a remote server. The url of this list is configurable in minetest.conf using the setting "serverlist_url" The local list of favorite servers is saved in client/serverlist/filename filename is also configureable using the setting "serverlist_file" --- src/main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 0af9d113c..6f4095148 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -71,6 +71,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "util/string.h" #include "subgame.h" #include "quicktune.h" +#include "serverlist.h" /* Settings. @@ -1581,7 +1582,7 @@ int main(int argc, char *argv[]) if(menudata.selected_world != -1) g_settings->set("selected_world_path", worldspecs[menudata.selected_world].path); - + // Break out of menu-game loop to shut down cleanly if(device->run() == false || kill == true) break; @@ -1598,6 +1599,15 @@ int main(int argc, char *argv[]) current_address = ""; current_port = 30011; } + else if (address != "") + { + ServerListSpec server; + server.name = menudata.servername; + server.address = wide_to_narrow(menudata.address); + server.port = wide_to_narrow(menudata.port); + server.description = menudata.serverdescription; + ServerList::insert(server); + } // Set world path to selected one if(menudata.selected_world != -1){ -- cgit v1.2.3