OpenTTD Source 20241224-master-gf74b0cf984
|
Functions to survey the current game / system, for crashlog and network-survey. More...
#include "3rdparty/nlohmann/json.hpp"
Go to the source code of this file.
Functions | |
std::string | SurveyMemoryToText (uint64_t memory) |
Change the bytes of memory into a textual version rounded up to the biggest unit. | |
void | SurveyCompanies (nlohmann::json &survey) |
Convert company information to JSON. | |
void | SurveyCompiler (nlohmann::json &survey) |
Convert compiler information to JSON. | |
void | SurveyGameSession (nlohmann::json &survey) |
Convert game session information to JSON. | |
void | SurveyConfiguration (nlohmann::json &survey) |
Convert generic game information to JSON. | |
void | SurveyFont (nlohmann::json &survey) |
Convert font information to JSON. | |
void | SurveyGameScript (nlohmann::json &survey) |
Convert game-script information to JSON. | |
void | SurveyGrfs (nlohmann::json &survey) |
Convert GRF information to JSON. | |
void | SurveyLibraries (nlohmann::json &survey) |
Convert compiled libraries information to JSON. | |
void | SurveyPlugins (nlohmann::json &survey) |
Convert plugin information to JSON. | |
void | SurveyOpenTTD (nlohmann::json &survey) |
Convert generic OpenTTD information to JSON. | |
void | SurveySettings (nlohmann::json &survey, bool skip_if_default) |
Convert settings to JSON. | |
void | SurveyTimers (nlohmann::json &survey) |
Convert timer information to JSON. | |
void | SurveyOS (nlohmann::json &json) |
Functions to survey the current game / system, for crashlog and network-survey.
Definition in file survey.h.
void SurveyCompanies | ( | nlohmann::json & | survey | ) |
Convert company information to JSON.
survey | The JSON object. |
Definition at line 308 of file survey.cpp.
References _vehicle_type_to_string, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Iterate(), and VEH_COMPANY_END.
Referenced by CrashLog::FillCrashLog().
void SurveyCompiler | ( | nlohmann::json & | survey | ) |
Convert compiler information to JSON.
survey | The JSON object. |
Definition at line 178 of file survey.cpp.
Referenced by CrashLog::FillCrashLog().
void SurveyConfiguration | ( | nlohmann::json & | survey | ) |
Convert generic game information to JSON.
survey | The JSON object. |
Definition at line 252 of file survey.cpp.
References _current_language, _network_server, _networking, LanguageMetadata::file, FS2OTTD(), BlitterFactory::GetCurrentBlitter(), MusicDriver::GetInstance(), SoundDriver::GetInstance(), VideoDriver::GetInstance(), Driver::GetName(), Blitter::GetName(), BaseMedia< MusicSet >::GetUsedSet(), BaseMedia< SoundsSet >::GetUsedSet(), BaseMedia< GraphicsSet >::GetUsedSet(), LanguagePackHeader::isocode, LanguagePackHeader::name, and GRFConfig::param.
Referenced by CrashLog::FillCrashLog().
void SurveyFont | ( | nlohmann::json & | survey | ) |
Convert font information to JSON.
survey | The JSON object. |
Definition at line 295 of file survey.cpp.
References FS_LARGE, FS_MONO, FS_NORMAL, FS_SMALL, FontCache::Get(), and FontCache::GetFontName().
Referenced by CrashLog::FillCrashLog().
void SurveyGameScript | ( | nlohmann::json & | survey | ) |
Convert game-script information to JSON.
survey | The JSON object. |
Definition at line 382 of file survey.cpp.
References Game::GetInfo().
Referenced by CrashLog::FillCrashLog().
void SurveyGameSession | ( | nlohmann::json & | survey | ) |
Convert game session information to JSON.
survey | The JSON object. |
Definition at line 238 of file survey.cpp.
References _game_session_stats, GameSessionStats::savegame_id, GameSessionStats::savegame_size, and GameSessionStats::start_time.
Referenced by CrashLog::FillCrashLog().
void SurveyGrfs | ( | nlohmann::json & | survey | ) |
Convert GRF information to JSON.
survey | The JSON object. |
Definition at line 355 of file survey.cpp.
References _grfconfig, BSWAP32(), FormatArrayAsHex(), GCF_STATIC, GRFP_BLT_32BPP, GRFP_BLT_MASK, GRFP_BLT_UNSET, GRFP_GRF_ANY, GRFP_GRF_DOS, GRFP_GRF_MASK, GRFP_GRF_UNSET, GRFP_GRF_WINDOWS, HasBit(), and GRFConfig::next.
Referenced by CrashLog::FillCrashLog().
void SurveyLibraries | ( | nlohmann::json & | survey | ) |
Convert compiled libraries information to JSON.
survey | The JSON object. |
Definition at line 394 of file survey.cpp.
Referenced by CrashLog::FillCrashLog().
std::string SurveyMemoryToText | ( | uint64_t | memory | ) |
Change the bytes of memory into a textual version rounded up to the biggest unit.
For example, 16751108096 would become 16 GiB.
memory | The bytes of memory. |
Definition at line 487 of file survey.cpp.
void SurveyOpenTTD | ( | nlohmann::json & | survey | ) |
Convert generic OpenTTD information to JSON.
survey | The JSON object. |
Definition at line 206 of file survey.cpp.
Referenced by CrashLog::FillCrashLog().
void SurveyOS | ( | nlohmann::json & | json | ) |
Definition at line 21 of file survey_osx.cpp.
void SurveyPlugins | ( | nlohmann::json & | survey | ) |
Convert plugin information to JSON.
survey | The JSON object. |
Definition at line 464 of file survey.cpp.
References _plugins, and SocialIntegration::GetPlugins().
Referenced by CrashLog::FillCrashLog().
void SurveySettings | ( | nlohmann::json & | survey, |
bool | skip_if_default | ||
) |
Convert settings to JSON.
survey | The JSON object. |
Definition at line 160 of file survey.cpp.
References _settings_client, _settings_game, ClientSettings::company, GenericSettingTables(), GetCustomCurrency(), and SurveySettingsTable().
Referenced by CrashLog::FillCrashLog().
void SurveyTimers | ( | nlohmann::json & | survey | ) |
Convert timer information to JSON.
survey | The JSON object. |
Definition at line 339 of file survey.cpp.
References TimerGameCalendar::ConvertDateToYMD(), TimerGameEconomy::ConvertDateToYMD(), TimerGameTick::counter, TimerGameCalendar::date, TimerGameEconomy::date, TimerGameCalendar::date_fract, and TimerGameEconomy::date_fract.
Referenced by CrashLog::FillCrashLog().