2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 /** @file network_gamelist.h Handling of the list of games. */
10 #ifndef NETWORK_GAMELIST_H
11 #define NETWORK_GAMELIST_H
13 #include "core/address.h"
14 #include "core/game_info.h"
15 #include "network_type.h"
17 /** Structure with information shown in the game list (GUI) */
18 struct NetworkGameList
{
19 NetworkGameList(const std::string
&connection_string
) : connection_string(connection_string
) {}
21 NetworkGameInfo info
= {}; ///< The game information of this server
22 std::string connection_string
; ///< Address of the server
23 bool online
= false; ///< False if the server did not respond (default status)
24 bool manually
= false; ///< True if the server was added manually
25 uint8 retries
= 0; ///< Number of retries (to stop requerying)
26 int version
= 0; ///< Used to see which servers are no longer available on the Game Coordinator and can be removed.
27 NetworkGameList
*next
= nullptr; ///< Next pointer to make a linked game list
30 extern NetworkGameList
*_network_game_list
;
31 extern int _network_game_list_version
;
33 NetworkGameList
*NetworkGameListAddItem(const std::string
&connection_string
);
34 void NetworkGameListRemoveItem(NetworkGameList
*remove
);
35 void NetworkGameListRemoveExpired();
37 #endif /* NETWORK_GAMELIST_H */