OpenTTD Source 20260206-master-g4d4e37dbf1
crashlog.cpp File Reference

Implementation of generic function to be called to log a crash. More...

#include "stdafx.h"
#include "crashlog.h"
#include "survey.h"
#include "gamelog.h"
#include "map_func.h"
#include "music/music_driver.hpp"
#include "sound/sound_driver.hpp"
#include "video/video_driver.hpp"
#include "saveload/saveload.h"
#include "screenshot.h"
#include "network/network_survey.h"
#include "news_func.h"
#include "news_gui.h"
#include "fileio_func.h"
#include "fileio_type.h"
#include "company_func.h"
#include "3rdparty/fmt/chrono.h"
#include "3rdparty/fmt/std.h"
#include "core/format.hpp"
#include "safeguards.h"

Go to the source code of this file.

Functions

static void SurveyGamelog (nlohmann::json &json)
 Writes the gamelog data to the given JSON object.
static void SurveyRecentNews (nlohmann::json &json)
 Writes up to 32 recent news messages to the given JSON object, with the most recent first.

Variables

constexpr uint8_t CRASHLOG_SURVEY_VERSION = 1
 The version of the schema of the JSON information.

Detailed Description

Implementation of generic function to be called to log a crash.

Definition in file crashlog.cpp.

Function Documentation

◆ SurveyGamelog()

void SurveyGamelog ( nlohmann::json & json)
static

Writes the gamelog data to the given JSON object.

Parameters
jsonThe object to write to.

Definition at line 42 of file crashlog.cpp.

References _gamelog.

Referenced by CrashLog::FillCrashLog().

◆ SurveyRecentNews()

void SurveyRecentNews ( nlohmann::json & json)
static

Writes up to 32 recent news messages to the given JSON object, with the most recent first.

Parameters
jsonThe object to write to.

Definition at line 55 of file crashlog.cpp.

References TimerGameCalendar::ConvertDateToYMD(), GetNews(), and SerialiseNewsReference().

Referenced by CrashLog::FillCrashLog().

Variable Documentation

◆ CRASHLOG_SURVEY_VERSION

uint8_t CRASHLOG_SURVEY_VERSION = 1
constexpr

The version of the schema of the JSON information.

Definition at line 36 of file crashlog.cpp.

Referenced by CrashLog::FillCrashLog().