12 #ifndef NETWORK_CORE_GAME_INFO_H
13 #define NETWORK_CORE_GAME_INFO_H
17 #include "../../newgrf_config.h"
18 #include "../../timer/timer_game_calendar.h"
19 #include "../../timer/timer_game_tick.h"
21 #include <unordered_map>
86 enum NewGRFSerializationType {
88 NST_GRFID_MD5_NAME = 1,
135 typedef std::unordered_map<uint32_t, NamedGRFIdentifier> GameInfoNewGRFLookupTable;
139 std::string_view GetNetworkRevisionString();
140 bool IsNetworkCompatibleVersion(std::string_view other);
143 void FillStaticNetworkServerGameInfo();
150 void DeserializeNetworkGameInfo(
Packet &p,
NetworkGameInfo &info,
const GameInfoNewGRFLookupTable *newgrf_lookup_table =
nullptr);
uint64_t TickCounter
The type that the tick counter is stored in.
Configuration options of the network stuff.
Base for all network types (UDP and TCP)
Information about GRF, used in the game and (part of it) in savegames.
Basic data to distinguish a GRF.
Container to hold the GRF identifier (GRF ID + MD5 checksum) and the name associated with that NewGRF...
std::string name
The name of the NewGRF.
GRFIdentifier ident
The unique identifier of the NewGRF.
The game information that is sent from the server to the clients with extra information only required...
bool version_compatible
Can we connect to this server or not? (based on server_revision)
bool compatible
Can we connect to this server or not? (based on server_revision and grf_match.
The game information that is sent from the server to the client.
TimerGameCalendar::Date calendar_start
When the game started.
bool dedicated
Is this a dedicated server?
std::string server_revision
The version number the server is using (e.g.: 'r304' or 0.5.0)
bool use_password
Is this server passworded?
uint8_t clients_max
Max clients allowed on server.
uint8_t spectators_on
How many spectators do we have?
uint16_t map_height
Map height.
std::string server_name
Server name.
uint16_t map_width
Map width.
TimerGameTick::TickCounter ticks_playing
Amount of ticks the game has been running unpaused.
GRFConfig * grfconfig
List of NewGRF files used.
uint8_t landscape
The used landscape.
uint8_t companies_max
Max companies allowed on server.
std::string gamescript_name
Name of the gamescript.
TimerGameCalendar::Date calendar_date
Current calendar date.
int gamescript_version
Version of the gamescript.
uint8_t companies_on
How many started companies do we have.
uint8_t clients_on
Current count of clients on server.
Internal entity of a packet.
Templated helper to make a type-safe 'typedef' representing a single POD value.