Update to 14.0-RC2

This commit is contained in:
dP
2024-03-17 01:01:56 +07:00
parent 53ff9d1f9f
commit da761f41e2
164 changed files with 9303 additions and 5998 deletions
+14 -1
View File
@@ -235,6 +235,20 @@ void SurveyOpenTTD(nlohmann::json &survey)
;
}
/**
* Convert game session information to JSON.
*
* @param survey The JSON object.
*/
void SurveyGameSession(nlohmann::json &survey)
{
survey["id"] = _game_session_stats.savegame_id;
survey["seconds"] = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::steady_clock::now() - _game_session_stats.start_time).count();
if (_game_session_stats.savegame_size.has_value()) {
survey["savegame_size"] = _game_session_stats.savegame_size.value();
}
}
/**
* Convert generic game information to JSON.
*
@@ -330,7 +344,6 @@ void SurveyCompanies(nlohmann::json &survey)
void SurveyTimers(nlohmann::json &survey)
{
survey["ticks"] = TimerGameTick::counter;
survey["seconds"] = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::steady_clock::now() - _switch_mode_time).count();
TimerGameEconomy::YearMonthDay economy_ymd = TimerGameEconomy::ConvertDateToYMD(TimerGameEconomy::date);
survey["economy"] = fmt::format("{:04}-{:02}-{:02} ({})", economy_ymd.year, economy_ymd.month + 1, economy_ymd.day, TimerGameEconomy::date_fract);