diff options
author | Jeija <norrepli@gmail.com> | 2012-12-25 12:20:51 +0100 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2013-01-21 16:42:56 +0200 |
commit | 6f93c01af942d75db105eac6afcd7d477967ccb6 (patch) | |
tree | 1347a607424b65c1d4cc9e13fbcfa30b7fc3936f /src/main.cpp | |
parent | c691d619c24cdca11655455c510920ab7937b319 (diff) | |
download | minetest-6f93c01af942d75db105eac6afcd7d477967ccb6.tar.gz minetest-6f93c01af942d75db105eac6afcd7d477967ccb6.tar.bz2 minetest-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.cpp | 12 |
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){ |