OpenTTD Source
20240919-master-gdf0233f4c2
|
Go to the documentation of this file.
10 #ifndef NETWORK_SURVEY_H
11 #define NETWORK_SURVEY_H
13 #include <condition_variable>
23 void OnReceiveData(std::unique_ptr<
char[]> data,
size_t length)
override;
35 std::string CreatePayload(
Reason reason,
bool for_preview =
false);
37 constexpr
static bool IsSurveyPossible()
std::atomic< bool > transmitted
Whether the survey has been transmitted.
Callback for when the HTTP handler has something to tell us.
bool IsCancelled() const override
Check if there is a request to cancel the transfer.
std::condition_variable transmitted_cv
Condition variable to inform changes to transmitted.
std::mutex mutex
Mutex for the condition variable.
@ PREVIEW
User is previewing the survey result.
void Transmit(Reason reason, bool blocking=false)
Transmit the survey.
void OnFailure() override
An error has occurred and the connection has been closed.
@ LEAVE
User is leaving the game (but not exiting the application).
Socket handler for the survey connection.
void OnReceiveData(std::unique_ptr< char[]> data, size_t length) override
We're receiving data.
@ EXIT
User is exiting the application.