OpenTTD Source  20241108-master-g80f628063a
network_survey.cpp File Reference

Opt-in survey part of the network protocol. More...

#include "../stdafx.h"
#include "network_survey.h"
#include "settings_table.h"
#include "network.h"
#include "network_func.h"
#include "../debug.h"
#include "../survey.h"
#include "../3rdparty/fmt/chrono.h"
#include "../3rdparty/fmt/std.h"
#include "../safeguards.h"

Go to the source code of this file.

Functions

 NLOHMANN_JSON_SERIALIZE_ENUM (NetworkSurveyHandler::Reason, { {NetworkSurveyHandler::Reason::PREVIEW, "preview"}, {NetworkSurveyHandler::Reason::LEAVE, "leave"}, {NetworkSurveyHandler::Reason::EXIT, "exit"}, {NetworkSurveyHandler::Reason::CRASH, "crash"}, }) std
 Create the payload for the survey. More...
 

Variables

NetworkSurveyHandler _survey = {}
 

Detailed Description

Opt-in survey part of the network protocol.

Definition in file network_survey.cpp.

Function Documentation

◆ NLOHMANN_JSON_SERIALIZE_ENUM()

NLOHMANN_JSON_SERIALIZE_ENUM ( NetworkSurveyHandler::Reason  ,
{ {NetworkSurveyHandler::Reason::PREVIEW, "preview"}, {NetworkSurveyHandler::Reason::LEAVE, "leave"}, {NetworkSurveyHandler::Reason::EXIT, "exit"}, {NetworkSurveyHandler::Reason::CRASH, "crash"}, }   
)

Create the payload for the survey.

Parameters
reasonThe reason for sending the survey.
for_previewWhether the payload is meant for preview. This indents the result, and filters out the id/key.
Returns
std::string The JSON payload as string for the survey.

Definition at line 24 of file network_survey.cpp.

References NetworkSurveyHandler::CRASH, NetworkSurveyHandler::EXIT, NetworkSurveyHandler::LEAVE, and NetworkSurveyHandler::PREVIEW.