5642
|
1 |
/* $Id$ */
|
|
2 |
|
|
3 |
#ifndef NETWORK_CORE_GAME_H
|
|
4 |
#define NETWORK_CORE_GAME_H
|
|
5 |
|
|
6 |
#ifdef ENABLE_NETWORK
|
|
7 |
|
|
8 |
/**
|
|
9 |
* @file game.h Information about a game that is sent between a
|
|
10 |
* game server, game client and masterserver.
|
|
11 |
*/
|
|
12 |
|
|
13 |
/**
|
|
14 |
* This is the struct used by both client and server
|
|
15 |
* some fields will be empty on the client (like game_password) by default
|
|
16 |
* and only filled with data a player enters.
|
|
17 |
*/
|
|
18 |
typedef struct NetworkGameInfo {
|
|
19 |
byte game_info_version; ///< Version of the game info
|
|
20 |
char server_name[NETWORK_NAME_LENGTH]; ///< Server name
|
|
21 |
char hostname[NETWORK_HOSTNAME_LENGTH]; ///< Hostname of the server (if any)
|
|
22 |
char server_revision[NETWORK_REVISION_LENGTH]; ///< The version number the server is using (e.g.: 'r304' or 0.5.0)
|
|
23 |
bool version_compatible; ///< Can we connect to this server or not? (based on server_revision)
|
|
24 |
bool compatible; ///< Can we connect to this server or not? (based on server_revision _and_ grf_match
|
|
25 |
byte server_lang; ///< Language of the server (we should make a nice table for this)
|
|
26 |
byte use_password; ///< Is set to != 0 if it uses a password
|
|
27 |
char server_password[NETWORK_PASSWORD_LENGTH]; ///< On the server: the game password, on the client: != "" if server has password
|
|
28 |
byte clients_max; ///< Max clients allowed on server
|
|
29 |
byte clients_on; ///< Current count of clients on server
|
|
30 |
byte companies_max; ///< Max companies allowed on server
|
|
31 |
byte companies_on; ///< How many started companies do we have
|
|
32 |
byte spectators_max; ///< Max spectators allowed on server
|
|
33 |
byte spectators_on; ///< How many spectators do we have?
|
|
34 |
Date game_date; ///< Current date
|
|
35 |
Date start_date; ///< When the game started
|
|
36 |
char map_name[NETWORK_NAME_LENGTH]; ///< Map which is played ["random" for a randomized map]
|
|
37 |
uint16 map_width; ///< Map width
|
|
38 |
uint16 map_height; ///< Map height
|
|
39 |
byte map_set; ///< Graphical set
|
|
40 |
bool dedicated; ///< Is this a dedicated server?
|
|
41 |
char rcon_password[NETWORK_PASSWORD_LENGTH]; ///< RCon password for the server. "" if rcon is disabled
|
|
42 |
struct GRFConfig *grfconfig; ///< List of NewGRF files used
|
|
43 |
} NetworkGameInfo;
|
|
44 |
|
|
45 |
#endif /* ENABLE_NETWORK */
|
|
46 |
|
|
47 |
#endif /* NETWORK_CORE_GAME_H */
|