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/guiMainMenu.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/guiMainMenu.h') 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 #include #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 worlds; std::vector games; + std::vector 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 -- cgit v1.2.3