OpenTTD

game.h
Go to the documentation of this file.
1 /* $Id: game.h 17699 2009-10-04 20:00:56Z rubidium $ */
2
3 /*
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
8 */
9
15 #ifndef NETWORK_CORE_GAME_H
16 #define NETWORK_CORE_GAME_H
17
18 #include "config.h"
19 #include "../../newgrf_config.h"
20 #include "../../date_type.h"
21
22 #ifdef ENABLE_NETWORK
23
28 struct NetworkServerGameInfo {
29 char map_name[NETWORK_NAME_LENGTH];
30 byte clients_on;
31 };
32
36 struct NetworkGameInfo : NetworkServerGameInfo {
37 GRFConfig *grfconfig;
38 Date start_date;
39 Date game_date;
40 uint16 map_width;
41 uint16 map_height;
42 char server_name[NETWORK_NAME_LENGTH];
43 char hostname[NETWORK_HOSTNAME_LENGTH];
44 char server_revision[NETWORK_REVISION_LENGTH];
45 bool dedicated;
46 bool version_compatible;
47 bool compatible;
48 bool use_password;
49 byte game_info_version;
50 byte server_lang;
51 byte clients_max;
52 byte companies_on;
53 byte companies_max;
54 byte spectators_on;
55 byte spectators_max;
56 byte map_set;
57 };
58
59 #endif /* ENABLE_NETWORK */
60
61 #endif /* NETWORK_CORE_GAME_H */
NetworkGameInfo::start_date
Date start_date
When the game started.
Definition: game.h:38
NetworkGameInfo::spectators_max
byte spectators_max
Max spectators allowed on server.
Definition: game.h:55
NetworkGameInfo::map_height
uint16 map_height
Map height.
Definition: game.h:41
NetworkGameInfo::game_info_version
byte game_info_version
Version of the game info.
Definition: game.h:49
NetworkServerGameInfo
The game information that is not generated on-the-fly and has to be sent to the clients.
Definition: game.h:28
NetworkGameInfo::server_lang
byte server_lang
Language of the server (we should make a nice table for this)
Definition: game.h:50
NetworkGameInfo::version_compatible
bool version_compatible
Can we connect to this server or not? (based on server_revision)
Definition: game.h:46
NetworkGameInfo::map_width
uint16 map_width
Map width.
Definition: game.h:40
config.h
Configuration options of the network stuff.
NetworkGameInfo
The game information that is sent from the server to the clients.
Definition: game.h:36
NetworkGameInfo::companies_max
byte companies_max
Max companies allowed on server.
Definition: game.h:53
NetworkGameInfo::companies_on
byte companies_on
How many started companies do we have.
Definition: game.h:52
GRFConfig
Information about GRF, used in the game and (part of it) in savegames.
Definition: newgrf_config.h:153
NetworkGameInfo::clients_max
byte clients_max
Max clients allowed on server.
Definition: game.h:51
NetworkGameInfo::use_password
bool use_password
Is this server passworded?
Definition: game.h:48
NetworkServerGameInfo::clients_on
byte clients_on
Current count of clients on server.
Definition: game.h:30
NETWORK_HOSTNAME_LENGTH
static const uint NETWORK_HOSTNAME_LENGTH
The maximum length of the host name, in bytes including &#39;\0&#39;.
Definition: config.h:44
NetworkGameInfo::dedicated
bool dedicated
Is this a dedicated server?
Definition: game.h:45
NetworkServerGameInfo::map_name
char map_name[NETWORK_NAME_LENGTH]
Map which is played ["random" for a randomized map].
Definition: game.h:29
NetworkGameInfo::map_set
byte map_set
Graphical set.
Definition: game.h:56
NetworkGameInfo::game_date
Date game_date
Current date.
Definition: game.h:39
Date
int32 Date
The type to store our dates in.
Definition: date_type.h:16
NETWORK_NAME_LENGTH
static const uint NETWORK_NAME_LENGTH
The maximum length of the server name and map name, in bytes including &#39;\0&#39;.
Definition: config.h:42
NETWORK_REVISION_LENGTH
static const uint NETWORK_REVISION_LENGTH
The maximum length of the revision, in bytes including &#39;\0&#39;.
Definition: config.h:46
NetworkGameInfo::grfconfig
GRFConfig * grfconfig
List of NewGRF files used.
Definition: game.h:37
NetworkGameInfo::spectators_on
byte spectators_on
How many spectators do we have?
Definition: game.h:54
NetworkGameInfo::compatible
bool compatible
Can we connect to this server or not? (based on server_revision and grf_match.
Definition: game.h:47