mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-06 22:37:22 +00:00
(svn r8544) -Codechange: move game list related function/struct declarations to network_gamelist.h
This commit is contained in:
parent
6a820a30d1
commit
9ddd227eb3
@ -65,16 +65,6 @@ typedef struct NetworkClientInfo {
|
|||||||
char unique_id[NETWORK_NAME_LENGTH]; // Every play sends an unique id so we can indentify him
|
char unique_id[NETWORK_NAME_LENGTH]; // Every play sends an unique id so we can indentify him
|
||||||
} NetworkClientInfo;
|
} 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 {
|
typedef enum {
|
||||||
NETWORK_JOIN_STATUS_CONNECTING,
|
NETWORK_JOIN_STATUS_CONNECTING,
|
||||||
NETWORK_JOIN_STATUS_AUTHORIZING,
|
NETWORK_JOIN_STATUS_AUTHORIZING,
|
||||||
@ -94,8 +84,6 @@ typedef enum {
|
|||||||
NETLANG_FRENCH = 3,
|
NETLANG_FRENCH = 3,
|
||||||
} NetworkLanguage;
|
} NetworkLanguage;
|
||||||
|
|
||||||
VARDEF NetworkGameList *_network_game_list;
|
|
||||||
|
|
||||||
VARDEF NetworkGameInfo _network_game_info;
|
VARDEF NetworkGameInfo _network_game_info;
|
||||||
VARDEF NetworkPlayerInfo _network_player_info[MAX_PLAYERS];
|
VARDEF NetworkPlayerInfo _network_player_info[MAX_PLAYERS];
|
||||||
VARDEF NetworkClientInfo _network_client_info[MAX_CLIENT_INFO];
|
VARDEF NetworkClientInfo _network_client_info[MAX_CLIENT_INFO];
|
||||||
|
@ -4,17 +4,23 @@
|
|||||||
|
|
||||||
#include "../stdafx.h"
|
#include "../stdafx.h"
|
||||||
#include "../debug.h"
|
#include "../debug.h"
|
||||||
#include "network_data.h"
|
|
||||||
#include "../newgrf_config.h"
|
#include "../newgrf_config.h"
|
||||||
#include "../helpers.hpp"
|
#include "../helpers.hpp"
|
||||||
|
#include "core/game.h"
|
||||||
#include "network_udp.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? */
|
/** Should we stop/contiue requerying of offline servers? */
|
||||||
static bool _stop_requerying = false;
|
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
|
/** Add a new item to the linked gamelist. If the IP and Port match
|
||||||
* return the existing item instead of adding it again
|
* return the existing item instead of adding it again
|
||||||
* @param ip the IP-address (inet_addr) of the to-be added item
|
* @param ip the IP-address (inet_addr) of the to-be added item
|
||||||
|
@ -3,10 +3,22 @@
|
|||||||
#ifndef NETWORK_GAMELIST_H
|
#ifndef NETWORK_GAMELIST_H
|
||||||
#define 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);
|
NetworkGameList *NetworkGameListAddItem(uint32 ip, uint16 port);
|
||||||
void NetworkGameListRemoveItem(NetworkGameList *remove);
|
void NetworkGameListRemoveItem(NetworkGameList *remove);
|
||||||
void NetworkGameListAddQueriedItem(const NetworkGameInfo *info, bool server_online);
|
|
||||||
void NetworkGameListRequery(void);
|
void NetworkGameListRequery(void);
|
||||||
|
|
||||||
#endif /* NETWORK_GAMELIST_H */
|
#endif /* NETWORK_GAMELIST_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user