changeset 5917:ad77d11aeccf draft

(svn r8544) -Codechange: move game list related function/struct declarations to network_gamelist.h
author rubidium <rubidium@openttd.org>
date Fri, 02 Feb 2007 21:32:58 +0000
parents 33f17e261853
children 8fc3143d239c
files src/network/network.h src/network/network_gamelist.cpp src/network/network_gamelist.h
diffstat 3 files changed, 24 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/network/network.h
+++ b/src/network/network.h
@@ -65,16 +65,6 @@
 	char unique_id[NETWORK_NAME_LENGTH];            // Every play sends an unique id so we can indentify him
 } NetworkClientInfo;
 
-typedef struct NetworkGameList {
-	NetworkGameInfo info;
-	uint32 ip;
-	uint16 port;
-	bool online;                                    // False if the server did not respond (default status)
-	bool manually;                                  // True if the server was added manually
-	uint8 retries;
-	struct NetworkGameList *next;
-} NetworkGameList;
-
 typedef enum {
 	NETWORK_JOIN_STATUS_CONNECTING,
 	NETWORK_JOIN_STATUS_AUTHORIZING,
@@ -94,8 +84,6 @@
 	NETLANG_FRENCH  = 3,
 } NetworkLanguage;
 
-VARDEF NetworkGameList *_network_game_list;
-
 VARDEF NetworkGameInfo _network_game_info;
 VARDEF NetworkPlayerInfo _network_player_info[MAX_PLAYERS];
 VARDEF NetworkClientInfo _network_client_info[MAX_CLIENT_INFO];
--- a/src/network/network_gamelist.cpp
+++ b/src/network/network_gamelist.cpp
@@ -4,17 +4,23 @@
 
 #include "../stdafx.h"
 #include "../debug.h"
-#include "network_data.h"
 #include "../newgrf_config.h"
 #include "../helpers.hpp"
+#include "core/game.h"
 #include "network_udp.h"
+#include "network_gamelist.h"
+#include "network_gui.h"
+
+/**
+ * @file network_gamelist.cpp This file handles the GameList
+ * Also, it handles the request to a server for data about the server
+ */
+
+NetworkGameList *_network_game_list = NULL;
 
 /** Should we stop/contiue requerying of offline servers? */
 static bool _stop_requerying = false;
 
-// This file handles the GameList
-// Also, it handles the request to a server for data about the server
-
 /** Add a new item to the linked gamelist. If the IP and Port match
  * return the existing item instead of adding it again
  * @param ip the IP-address (inet_addr) of the to-be added item
--- a/src/network/network_gamelist.h
+++ b/src/network/network_gamelist.h
@@ -3,10 +3,22 @@
 #ifndef NETWORK_GAMELIST_H
 #define NETWORK_GAMELIST_H
 
-void NetworkGameListClear(void);
+/** Structure with information shown in the game list (GUI) */
+struct NetworkGameList {
+	NetworkGameInfo info;  ///< The game information of this server
+	uint32 ip;             ///< The IP of the game server
+	uint16 port;           ///< The port of the game server
+	bool online;           ///< False if the server did not respond (default status)
+	bool manually;         ///< True if the server was added manually
+	uint8 retries;         ///< Number of retries (to stop requerying)
+	NetworkGameList *next; ///< Next pointer to make a linked game list
+};
+
+/** Game list of this client */
+extern NetworkGameList *_network_game_list;
+
 NetworkGameList *NetworkGameListAddItem(uint32 ip, uint16 port);
 void NetworkGameListRemoveItem(NetworkGameList *remove);
-void NetworkGameListAddQueriedItem(const NetworkGameInfo *info, bool server_online);
 void NetworkGameListRequery(void);
 
 #endif /* NETWORK_GAMELIST_H */