Add: track savegame size to report with survey (#12304)

This commit is contained in:
Patric Stout
2024-03-16 08:58:56 +01:00
committed by GitHub
parent b394c20519
commit 3e625b5b1a
12 changed files with 48 additions and 17 deletions

View File

@@ -517,7 +517,8 @@ static const OptionData _options[] = {
*/
int openttd_main(int argc, char *argv[])
{
_switch_mode_time = std::chrono::steady_clock::now();
_game_session_stats.start_time = std::chrono::steady_clock::now();
_game_session_stats.savegame_size = std::nullopt;
std::string musicdriver;
std::string sounddriver;
@@ -1086,7 +1087,10 @@ void SwitchToMode(SwitchMode new_mode)
if (_game_mode == GM_NORMAL && new_mode != SM_SAVE_GAME) _survey.Transmit(NetworkSurveyHandler::Reason::LEAVE);
/* Keep track when we last switch mode. Used for survey, to know how long someone was in a game. */
if (new_mode != SM_SAVE_GAME) _switch_mode_time = std::chrono::steady_clock::now();
if (new_mode != SM_SAVE_GAME) {
_game_session_stats.start_time = std::chrono::steady_clock::now();
_game_session_stats.savegame_size = std::nullopt;
}
switch (new_mode) {
case SM_EDITOR: // Switch to scenario editor