OpenTTD Source: src/network/core/game.h Source File

OpenTTD Source 1.11.0-RC1

game.h
Go to the documentation of this file.
1 /*
2 * This file is part of OpenTTD.
3 * 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.
4 * 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.
5 * 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/>.
6 */
7
13 #ifndef NETWORK_CORE_GAME_H
14 #define NETWORK_CORE_GAME_H
15
16 #include "config.h"
17 #include "../../newgrf_config.h"
18 #include "../../date_type.h"
19
24 struct NetworkServerGameInfo {
25 char map_name[NETWORK_NAME_LENGTH];
26 byte clients_on;
27 };
28
32 struct NetworkGameInfo : NetworkServerGameInfo {
33 GRFConfig *grfconfig;
34 Date start_date;
35 Date game_date;
36 uint16 map_width;
37 uint16 map_height;
38 char server_name[NETWORK_NAME_LENGTH];
39 char hostname[NETWORK_HOSTNAME_LENGTH];
40 char server_revision[NETWORK_REVISION_LENGTH];
41 bool dedicated;
42 bool version_compatible;
43 bool compatible;
44 bool use_password;
45 byte game_info_version;
46 byte server_lang;
47 byte clients_max;
48 byte companies_on;
49 byte companies_max;
50 byte spectators_on;
51 byte spectators_max;
52 byte map_set;
53 };
54
55 const char * GetNetworkRevisionString();
56
57 #endif /* NETWORK_CORE_GAME_H */
NetworkGameInfo
The game information that is sent from the server to the clients.
Definition: game.h:32
NetworkGameInfo::companies_max
byte companies_max
Max companies allowed on server.
Definition: game.h:49
NETWORK_NAME_LENGTH
static const uint NETWORK_NAME_LENGTH
The maximum length of the server name and map name, in bytes including '\0'.
Definition: config.h:40
NetworkServerGameInfo::map_name
char map_name[NETWORK_NAME_LENGTH]
Map which is played ["random" for a randomized map].
Definition: game.h:25
NetworkGameInfo::use_password
bool use_password
Is this server passworded?
Definition: game.h:44
NetworkServerGameInfo
The game information that is not generated on-the-fly and has to be sent to the clients.
Definition: game.h:24
NetworkGameInfo::hostname
char hostname[NETWORK_HOSTNAME_LENGTH]
Hostname of the server (if any)
Definition: game.h:39
NetworkGameInfo::game_info_version
byte game_info_version
Version of the game info.
Definition: game.h:45
NetworkGameInfo::map_width
uint16 map_width
Map width.
Definition: game.h:36
NetworkGameInfo::version_compatible
bool version_compatible
Can we connect to this server or not? (based on server_revision)
Definition: game.h:42
NetworkGameInfo::start_date
Date start_date
When the game started.
Definition: game.h:34
NetworkGameInfo::server_lang
byte server_lang
Language of the server (we should make a nice table for this)
Definition: game.h:46
GRFConfig
Information about GRF, used in the game and (part of it) in savegames.
Definition: newgrf_config.h:152
NetworkGameInfo::companies_on
byte companies_on
How many started companies do we have.
Definition: game.h:48
Date
int32 Date
The type to store our dates in.
Definition: date_type.h:14
NetworkGameInfo::server_name
char server_name[NETWORK_NAME_LENGTH]
Server name.
Definition: game.h:38
NETWORK_REVISION_LENGTH
static const uint NETWORK_REVISION_LENGTH
The maximum length of the revision, in bytes including '\0'.
Definition: config.h:44
NetworkGameInfo::clients_max
byte clients_max
Max clients allowed on server.
Definition: game.h:47
NetworkGameInfo::game_date
Date game_date
Current date.
Definition: game.h:35
NetworkGameInfo::server_revision
char server_revision[NETWORK_REVISION_LENGTH]
The version number the server is using (e.g.: 'r304' or 0.5.0)
Definition: game.h:40
config.h
NETWORK_HOSTNAME_LENGTH
static const uint NETWORK_HOSTNAME_LENGTH
The maximum length of the host name, in bytes including '\0'.
Definition: config.h:42
NetworkGameInfo::spectators_on
byte spectators_on
How many spectators do we have?
Definition: game.h:50
NetworkGameInfo::map_height
uint16 map_height
Map height.
Definition: game.h:37
NetworkServerGameInfo::clients_on
byte clients_on
Current count of clients on server.
Definition: game.h:26
GetNetworkRevisionString
const char * GetNetworkRevisionString()
Get the network version string used by this build.
Definition: network.cpp:1098
NetworkGameInfo::grfconfig
GRFConfig * grfconfig
List of NewGRF files used.
Definition: game.h:33
NetworkGameInfo::compatible
bool compatible
Can we connect to this server or not? (based on server_revision and grf_match.
Definition: game.h:43
NetworkGameInfo::dedicated
bool dedicated
Is this a dedicated server?
Definition: game.h:41
NetworkGameInfo::spectators_max
byte spectators_max
Max spectators allowed on server.
Definition: game.h:51
NetworkGameInfo::map_set
byte map_set
Graphical set.
Definition: game.h:52