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/guiMainMenu.h | |
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/guiMainMenu.h')
-rw-r--r-- | src/guiMainMenu.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/guiMainMenu.h b/src/guiMainMenu.h index f87ad0fdb..2c657cb23 100644 --- a/src/guiMainMenu.h +++ b/src/guiMainMenu.h @@ -25,6 +25,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include <string> #include <list> #include "subgame.h" +#include "serverlist.h" + class IGameCallback; struct MainMenuData @@ -33,6 +35,8 @@ struct MainMenuData // Generic int selected_tab; // Client options + std::string servername; + std::string serverdescription; std::wstring address; std::wstring port; std::wstring name; @@ -58,8 +62,11 @@ struct MainMenuData std::string create_world_gameid; bool only_refresh; + bool serverlist_show_available; // if false show local favorites only + std::vector<WorldSpec> worlds; std::vector<SubgameSpec> games; + std::vector<ServerListSpec> servers; MainMenuData(): // Generic @@ -73,7 +80,9 @@ struct MainMenuData selected_world(0), simple_singleplayer_mode(false), // Actions - only_refresh(false) + only_refresh(false), + + serverlist_show_available(false) {} }; @@ -110,12 +119,15 @@ private: gui::IGUIElement* parent; s32 id; IMenuManager *menumgr; - + bool m_is_regenerating; v2s32 m_topleft_client; v2s32 m_size_client; v2s32 m_topleft_server; v2s32 m_size_server; + void updateGuiServerList(); + void serverListOnSelected(); + ServerListSpec getServerListSpec(std::string address, std::string port); }; #endif |