RigsofRods
Soft-body Physics Simulation
source
main
network
CurlHelpers.h
Go to the documentation of this file.
1
/*
2
This source file is part of Rigs of Rods
3
Copyright 2005-2012 Pierre-Michel Ricordel
4
Copyright 2007-2012 Thomas Fischer
5
Copyright 2013-2023 Petr Ohlidal
6
7
For more information, see http://www.rigsofrods.org/
8
9
Rigs of Rods is free software: you can redistribute it and/or modify
10
it under the terms of the GNU General Public License version 3, as
11
published by the Free Software Foundation.
12
13
Rigs of Rods is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
17
18
You should have received a copy of the GNU General Public License
19
along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20
*/
21
22
#pragma once
23
24
#include "
GameContext.h
"
25
26
#ifdef USE_CURL
27
# include <curl/curl.h>
28
# include <curl/easy.h>
29
30
#include <string>
31
32
namespace
RoR
{
33
34
struct
CurlTaskContext
35
{
36
std::string
ctc_displayname
;
37
std::string
ctc_url
;
38
// Send no messages by default
39
MsgType
ctc_msg_progress
=
MSG_INVALID
;
40
MsgType
ctc_msg_success
=
MSG_INVALID
;
41
MsgType
ctc_msg_failure
=
MSG_INVALID
;
42
// Status
43
double
ctc_old_perc
= 0;
// not threadsafe but whatever
44
};
45
46
bool
GetUrlAsString
(
const
std::string& url, CURLcode& curl_result,
long
& response_code, std::string& response_payload);
47
48
bool
GetUrlAsStringMQ
(
CurlTaskContext
task);
49
50
}
// namespace RoR
51
52
#endif // USE_CURL
GameContext.h
Game state manager and message-queue provider.
RoR::GetUrlAsString
bool GetUrlAsString(const std::string &url, CURLcode &curl_result, long &response_code, std::string &response_payload)
Definition:
CurlHelpers.cpp:71
RoR::CurlTaskContext::ctc_msg_progress
MsgType ctc_msg_progress
Definition:
CurlHelpers.h:39
RoR::CurlTaskContext::ctc_msg_failure
MsgType ctc_msg_failure
Sent on failure; Payload: RoR::ScriptEventArgs (see 'gameplay/ScriptEvents.h') with args for RoR::SE_...
Definition:
CurlHelpers.h:41
RoR::GetUrlAsStringMQ
bool GetUrlAsStringMQ(CurlTaskContext task)
Definition:
CurlHelpers.cpp:106
RoR::MsgType
MsgType
Global gameplay message loop, see struct Message in GameContext.h.
Definition:
Application.h:74
RoR::CurlTaskContext::ctc_old_perc
double ctc_old_perc
Definition:
CurlHelpers.h:43
RoR::CurlTaskContext::ctc_url
std::string ctc_url
Definition:
CurlHelpers.h:37
RoR::MSG_INVALID
@ MSG_INVALID
Definition:
Application.h:83
RoR::CurlTaskContext::ctc_displayname
std::string ctc_displayname
Definition:
CurlHelpers.h:36
RoR::CurlTaskContext
Definition:
CurlHelpers.h:34
RoR
Definition:
AppContext.h:36
RoR::CurlTaskContext::ctc_msg_success
MsgType ctc_msg_success
Definition:
CurlHelpers.h:40
Generated by
1.8.17