mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
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"
This commit is contained in:
parent
c691d619c2
commit
6f93c01af9
9 changed files with 431 additions and 16 deletions
12
src/main.cpp
12
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){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue