OpenTTD Source: src/network/network_survey.cpp File Reference

OpenTTD Source 15.0-beta1

Functions | Variables
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.

## 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

  reason | The reason for sending the survey.
  for_preview | Whether 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.

## Variable Documentation

## ◆ _survey

NetworkSurveyHandler _survey = {}

Definition at line 22 of file network_survey.cpp.