aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJeija <norrepli@gmail.com>2012-12-25 12:20:51 +0100
committerPerttu Ahola <celeron55@gmail.com>2013-01-21 16:42:56 +0200
commit6f93c01af942d75db105eac6afcd7d477967ccb6 (patch)
tree1347a607424b65c1d4cc9e13fbcfa30b7fc3936f /src/main.cpp
parentc691d619c24cdca11655455c510920ab7937b319 (diff)
downloadhax-minetest-server-6f93c01af942d75db105eac6afcd7d477967ccb6.tar.gz
hax-minetest-server-6f93c01af942d75db105eac6afcd7d477967ccb6.zip
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"
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp12
1 files changed, 11 insertions, 1 deletions
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){