OpenTTD Source  20241108-master-g80f628063a
survey.h File Reference

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. More...
 
void SurveyCompanies (nlohmann::json &survey)
 Convert company information to JSON. More...
 
void SurveyCompiler (nlohmann::json &survey)
 Convert compiler information to JSON. More...
 
void SurveyGameSession (nlohmann::json &survey)
 Convert game session information to JSON. More...
 
void SurveyConfiguration (nlohmann::json &survey)
 Convert generic game information to JSON. More...
 
void SurveyFont (nlohmann::json &survey)
 Convert font information to JSON. More...
 
void SurveyGameScript (nlohmann::json &survey)
 Convert game-script information to JSON. More...
 
void SurveyGrfs (nlohmann::json &survey)
 Convert GRF information to JSON. More...
 
void SurveyLibraries (nlohmann::json &survey)
 Convert compiled libraries information to JSON. More...
 
void SurveyPlugins (nlohmann::json &survey)
 Convert plugin information to JSON. More...
 
void SurveyOpenTTD (nlohmann::json &survey)
 Convert generic OpenTTD information to JSON. More...
 
void SurveySettings (nlohmann::json &survey, bool skip_if_default)
 Convert settings to JSON. More...
 
void SurveyTimers (nlohmann::json &survey)
 Convert timer information to JSON. More...
 
void SurveyOS (nlohmann::json &json)
 

Detailed Description

Functions to survey the current game / system, for crashlog and network-survey.

Definition in file survey.h.

Function Documentation

◆ SurveyCompanies()

void SurveyCompanies ( nlohmann::json &  survey)

Convert company information to JSON.

Parameters
surveyThe JSON object.

Definition at line 308 of file survey.cpp.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Iterate().

◆ SurveyCompiler()

void SurveyCompiler ( nlohmann::json &  survey)

Convert compiler information to JSON.

Parameters
surveyThe JSON object.

Definition at line 178 of file survey.cpp.

◆ SurveyConfiguration()

◆ SurveyFont()

void SurveyFont ( nlohmann::json &  survey)

Convert font information to JSON.

Parameters
surveyThe JSON object.

Definition at line 295 of file survey.cpp.

References FS_LARGE, FS_MONO, FS_NORMAL, FS_SMALL, FontCache::Get(), and FontCache::GetFontName().

◆ SurveyGameScript()

void SurveyGameScript ( nlohmann::json &  survey)

Convert game-script information to JSON.

Parameters
surveyThe JSON object.

Definition at line 382 of file survey.cpp.

References Game::GetInfo().

◆ SurveyGameSession()

void SurveyGameSession ( nlohmann::json &  survey)

Convert game session information to JSON.

Parameters
surveyThe 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().

◆ SurveyGrfs()

void SurveyGrfs ( nlohmann::json &  survey)

Convert GRF information to JSON.

Parameters
surveyThe 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.

◆ SurveyLibraries()

void SurveyLibraries ( nlohmann::json &  survey)

Convert compiled libraries information to JSON.

Parameters
surveyThe JSON object.

Definition at line 394 of file survey.cpp.

◆ SurveyMemoryToText()

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.

Parameters
memoryThe bytes of memory.
Returns
std::string A textual representation.

Definition at line 487 of file survey.cpp.

References Ceil(), and CeilDiv().

◆ SurveyOpenTTD()

void SurveyOpenTTD ( nlohmann::json &  survey)

Convert generic OpenTTD information to JSON.

Parameters
surveyThe JSON object.

Definition at line 206 of file survey.cpp.

◆ SurveyPlugins()

void SurveyPlugins ( nlohmann::json &  survey)

Convert plugin information to JSON.

Parameters
surveyThe JSON object.

Definition at line 464 of file survey.cpp.

References _plugins, and SocialIntegration::GetPlugins().

◆ SurveySettings()

void SurveySettings ( nlohmann::json &  survey,
bool  skip_if_default 
)

Convert settings to JSON.

Parameters
surveyThe JSON object.

Definition at line 160 of file survey.cpp.

References SurveySettingsTable().

◆ SurveyTimers()

void SurveyTimers ( nlohmann::json &  survey)