network.h
changeset 738 b96ab9e63d22
parent 716 8af847728d5b
child 764 7e1e17b7c7d4
equal deleted inserted replaced
737:05082439a150 738:b96ab9e63d22
    99 typedef struct NetworkGameList {
    99 typedef struct NetworkGameList {
   100 	NetworkGameInfo info;
   100 	NetworkGameInfo info;
   101 	uint32 ip;
   101 	uint32 ip;
   102 	uint16 port;
   102 	uint16 port;
   103 	bool online;																		// False if the server did not respond (default status)
   103 	bool online;																		// False if the server did not respond (default status)
       
   104 	bool manually;																	// True if the server was added manually
   104 	struct NetworkGameList *next;
   105 	struct NetworkGameList *next;
   105 } NetworkGameList;
   106 } NetworkGameList;
   106 
   107 
   107 typedef enum {
   108 typedef enum {
   108 	NETWORK_JOIN_STATUS_CONNECTING,
   109 	NETWORK_JOIN_STATUS_CONNECTING,
   130 VARDEF NetworkClientInfo _network_client_info[MAX_CLIENT_INFO];
   131 VARDEF NetworkClientInfo _network_client_info[MAX_CLIENT_INFO];
   131 
   132 
   132 VARDEF char _network_player_name[NETWORK_NAME_LENGTH];
   133 VARDEF char _network_player_name[NETWORK_NAME_LENGTH];
   133 VARDEF char _network_default_ip[NETWORK_HOSTNAME_LENGTH];
   134 VARDEF char _network_default_ip[NETWORK_HOSTNAME_LENGTH];
   134 #define MAX_SAVED_SERVERS 10
   135 #define MAX_SAVED_SERVERS 10
   135 VARDEF char *_network_server_list[MAX_SAVED_SERVERS];
   136 VARDEF char *_network_host_list[MAX_SAVED_SERVERS];
   136 
   137 
   137 VARDEF uint16 _network_own_client_index;
   138 VARDEF uint16 _network_own_client_index;
   138 VARDEF char _network_unique_id[NETWORK_NAME_LENGTH]; // Our own unique ID
   139 VARDEF char _network_unique_id[NETWORK_NAME_LENGTH]; // Our own unique ID
   139 
   140 
   140 VARDEF uint32 _frame_counter_server; // The frame_counter of the server, if in network-mode
   141 VARDEF uint32 _frame_counter_server; // The frame_counter of the server, if in network-mode
   192 VARDEF byte _network_playas; // an id to play as..
   193 VARDEF byte _network_playas; // an id to play as..
   193 
   194 
   194 void ParseConnectionString(const byte **player, const byte **port, byte *connection_string);
   195 void ParseConnectionString(const byte **player, const byte **port, byte *connection_string);
   195 void NetworkUpdateClientInfo(uint16 client_index);
   196 void NetworkUpdateClientInfo(uint16 client_index);
   196 void NetworkAddServer(const byte *b);
   197 void NetworkAddServer(const byte *b);
       
   198 void NetworkRebuildHostList();
       
   199 NetworkGameList *NetworkQueryServer(const byte* host, unsigned short port, bool game_info);
   197 
   200 
   198 #endif /* NETWORK_H */
   201 #endif /* NETWORK_H */