Go to the documentation of this file.
12 #ifndef NETWORK_CORE_GAME_INFO_H
13 #define NETWORK_CORE_GAME_INFO_H
17 #include "../../newgrf_config.h"
18 #include "../../date_type.h"
void DeserializeGRFIdentifier(Packet *p, GRFIdentifier *grf)
Deserializes the GRFIdentifier (GRF ID and MD5 checksum) from the packet.
The game information that is sent from the server to the clients.
byte companies_max
Max companies allowed on server.
static const uint NETWORK_NAME_LENGTH
The maximum length of the server name and map name, in bytes including '\0'.
char map_name[NETWORK_NAME_LENGTH]
Map which is played ["random" for a randomized map].
bool use_password
Is this server passworded?
The game information that is not generated on-the-fly and has to be sent to the clients.
char hostname[NETWORK_HOSTNAME_LENGTH]
Hostname of the server (if any)
byte game_info_version
Version of the game info.
uint16 map_width
Map width.
void SerializeGRFIdentifier(Packet *p, const GRFIdentifier *grf)
Serializes the GRFIdentifier (GRF ID and MD5 checksum) to the packet.
bool version_compatible
Can we connect to this server or not? (based on server_revision)
void SerializeNetworkGameInfo(Packet *p, const NetworkGameInfo *info)
Serializes the NetworkGameInfo struct to the packet.
Basic data to distinguish a GRF.
Date start_date
When the game started.
byte server_lang
Language of the server (we should make a nice table for this)
Information about GRF, used in the game and (part of it) in savegames.
byte companies_on
How many started companies do we have.
int32 Date
The type to store our dates in.
void FillNetworkGameInfo(NetworkGameInfo &ngi)
Fill a NetworkGameInfo structure with the latest information of the server.
const char * GetNetworkRevisionString()
Get the network version string used by this build.
Internal entity of a packet.
char server_name[NETWORK_NAME_LENGTH]
Server name.
static const uint NETWORK_REVISION_LENGTH
The maximum length of the revision, in bytes including '\0'.
void DeserializeNetworkGameInfo(Packet *p, NetworkGameInfo *info)
Deserializes the NetworkGameInfo struct from the packet.
bool IsNetworkCompatibleVersion(const char *other)
Checks whether the given version string is compatible with our version.
byte clients_max
Max clients allowed on server.
Date game_date
Current date.
char server_revision[NETWORK_REVISION_LENGTH]
The version number the server is using (e.g.: 'r304' or 0.5.0)
static const uint NETWORK_HOSTNAME_LENGTH
The maximum length of the host name, in bytes including '\0'.
byte spectators_on
How many spectators do we have?
uint16 map_height
Map height.
byte clients_on
Current count of clients on server.
GRFConfig * grfconfig
List of NewGRF files used.
NetworkServerGameInfo _network_game_info
Information about our game.
bool compatible
Can we connect to this server or not? (based on server_revision and grf_match.
bool dedicated
Is this a dedicated server?
byte spectators_max
Max spectators allowed on server.
byte map_set
Graphical set.