OpenTTD Source
12.0-beta2
|
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"
20 #include <unordered_map>
@ NST_END
The end of the list (period).
void DeserializeGRFIdentifier(Packet *p, GRFIdentifier *grf)
Deserializes the GRFIdentifier (GRF ID and MD5 checksum) from the packet.
int gamescript_version
Version of the gamescript.
The game information that is sent from the server to the clients with extra information only required...
std::string gamescript_name
Name of the gamescript.
Date game_date
Current date.
std::string server_revision
The version number the server is using (e.g.: 'r304' or 0.5.0)
@ NST_LOOKUP_ID
Unique ID into a lookup table that is sent before.
@ NST_GRFID_MD5
Unique GRF ID and MD5 checksum.
byte clients_max
Max clients allowed on server.
std::string name
The name of the NewGRF.
void SerializeNetworkGameInfo(Packet *p, const NetworkServerGameInfo *info, bool send_newgrf_names=true)
Serializes the NetworkGameInfo struct to the packet.
The game information that is sent from the server to the client.
GRFIdentifier ident
The unique identifier of the NewGRF.
void SerializeGRFIdentifier(Packet *p, const GRFIdentifier *grf)
Serializes the GRFIdentifier (GRF ID and MD5 checksum) to the packet.
void DeserializeGRFIdentifierWithName(Packet *p, NamedGRFIdentifier *grf)
Deserializes the NamedGRFIdentifier (GRF ID, MD5 checksum and name) from the packet.
bool version_compatible
Can we connect to this server or not? (based on server_revision)
Basic data to distinguish a GRF.
void CheckGameCompatibility(NetworkGameInfo &ngi)
Check if an game entry is compatible with our client.
Information about GRF, used in the game and (part of it) in savegames.
int32 Date
The type to store our dates in.
byte companies_on
How many started companies do we have.
byte companies_max
Max companies allowed on server.
NewGRFSerializationType
The different types/ways a NewGRF can be serialized in the GameInfo since version 6.
const NetworkServerGameInfo * GetCurrentNetworkServerGameInfo()
Get the NetworkServerGameInfo structure with the latest information of the server.
Internal entity of a packet.
@ NST_GRFID_MD5_NAME
Unique GRF ID, MD5 checksum and name.
uint16 map_width
Map width.
bool dedicated
Is this a dedicated server?
bool use_password
Is this server passworded?
void FillStaticNetworkServerGameInfo()
Fill a NetworkServerGameInfo structure with the static content, or things that are so static they can...
byte spectators_on
How many spectators do we have?
std::unordered_map< uint32, NamedGRFIdentifier > GameInfoNewGRFLookupTable
Lookup table for the GameInfo in case of NST_LOOKUP_ID.
Date start_date
When the game started.
byte landscape
The used landscape.
std::string server_name
Server name.
byte clients_on
Current count of clients on server.
std::string_view GetNetworkRevisionString()
Get the network version string used by this build.
GRFConfig * grfconfig
List of NewGRF files used.
void DeserializeNetworkGameInfo(Packet *p, NetworkGameInfo *info, const GameInfoNewGRFLookupTable *newgrf_lookup_table=nullptr)
Deserializes the NetworkGameInfo struct from the packet.
Container to hold the GRF identifier (GRF ID + MD5 checksum) and the name associated with that NewGRF...
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.
uint16 map_height
Map height.
bool IsNetworkCompatibleVersion(std::string_view other)
Checks whether the given version string is compatible with our version.