Update: Translations from eints
[openttd-github.git] / src / network / network_gamelist.h
blobcabedd8ff7cff2d1d21dcd28527b7e4f265cf20b
1 /*
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/>.
6 */
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/network_game_info.h"
15 #include "network_type.h"
17 /** The status a server can be in. */
18 enum NetworkGameListStatus {
19 NGLS_OFFLINE, ///< Server is offline (or cannot be queried).
20 NGLS_ONLINE, ///< Server is online.
21 NGLS_FULL, ///< Server is full and cannot be queried.
22 NGLS_BANNED, ///< You are banned from this server.
23 NGLS_TOO_OLD, ///< Server is too old to query.
26 /** Structure with information shown in the game list (GUI) */
27 struct NetworkGameList {
28 NetworkGameList(const std::string &connection_string) : connection_string(connection_string) {}
30 NetworkGameInfo info = {}; ///< The game information of this server.
31 std::string connection_string; ///< Address of the server.
32 NetworkGameListStatus status = NGLS_OFFLINE; ///< Stats of the server.
33 bool manually = false; ///< True if the server was added manually.
34 bool refreshing = false; ///< Whether this server is being queried.
35 int version = 0; ///< Used to see which servers are no longer available on the Game Coordinator and can be removed.
36 NetworkGameList *next = nullptr; ///< Next pointer to make a linked game list.
39 extern NetworkGameList *_network_game_list;
40 extern int _network_game_list_version;
42 NetworkGameList *NetworkGameListAddItem(const std::string &connection_string);
43 void NetworkGameListRemoveItem(NetworkGameList *remove);
44 void NetworkGameListRemoveExpired();
46 #endif /* NETWORK_GAMELIST_H */