diff --git a/src/network/core/config.h b/src/network/core/config.h index ccc962081a..524977ac4d 100644 --- a/src/network/core/config.h +++ b/src/network/core/config.h @@ -47,7 +47,7 @@ static const uint16_t TCP_MTU = 32767; ///< Numbe static const uint16_t COMPAT_MTU = 1460; ///< Number of bytes we can pack in a single packet for backward compatibility static const byte NETWORK_GAME_ADMIN_VERSION = 3; ///< What version of the admin network do we use? -static const byte NETWORK_GAME_INFO_VERSION = 6; ///< What version of game-info do we use? +static const byte NETWORK_GAME_INFO_VERSION = 7; ///< What version of game-info do we use? static const byte NETWORK_COORDINATOR_VERSION = 6; ///< What version of game-coordinator-protocol do we use? static const byte NETWORK_SURVEY_VERSION = 1; ///< What version of the survey do we use? diff --git a/src/network/core/network_game_info.cpp b/src/network/core/network_game_info.cpp index 4ca0fc05f9..340047c914 100644 --- a/src/network/core/network_game_info.cpp +++ b/src/network/core/network_game_info.cpp @@ -158,6 +158,7 @@ const NetworkServerGameInfo *GetCurrentNetworkServerGameInfo() _network_game_info.companies_on = (byte)Company::GetNumItems(); _network_game_info.spectators_on = NetworkSpectatorCount(); _network_game_info.game_date = _date; + _network_game_info.ticks_playing = _scaled_tick_counter; return &_network_game_info; } @@ -202,6 +203,9 @@ void SerializeNetworkGameInfo(Packet *p, const NetworkServerGameInfo *info, bool /* Update the documentation in game_info.h on changes * to the NetworkGameInfo wire-protocol! */ + /* NETWORK_GAME_INFO_VERSION = 7 */ + p->Send_uint64(info->ticks_playing); + /* NETWORK_GAME_INFO_VERSION = 6 */ p->Send_uint8(send_newgrf_names ? NST_GRFID_MD5_NAME : NST_GRFID_MD5); diff --git a/src/network/core/network_game_info.h b/src/network/core/network_game_info.h index 3bf2223a98..c847205c44 100644 --- a/src/network/core/network_game_info.h +++ b/src/network/core/network_game_info.h @@ -27,6 +27,8 @@ * Version: Bytes: Description: * all 1 the version of this packet's structure * + * 7+ 8 amount of ticks this game has been running unpaused. + * * 6+ 1 type of storage for the NewGRFs below: * 0 = NewGRF ID and MD5 checksum. * Used as default for version 5 and below, and for @@ -94,6 +96,7 @@ struct NetworkServerGameInfo { GRFConfig *grfconfig; ///< List of NewGRF files used Date start_date; ///< When the game started Date game_date; ///< Current date + uint64_t ticks_playing; ///< Amount of ticks the game has been running unpaused. uint32_t map_width; ///< Map width uint32_t map_height; ///< Map height std::string server_name; ///< Server name