71bool RoR::GetUrlAsString(
const std::string& url, CURLcode& curl_result,
long& response_code, std::string& response_payload)
73 std::string response_header;
74 std::string user_agent = fmt::format(
"{}/{}",
"Rigs of Rods Client",
ROR_VERSION_STRING);
76 CURL *curl = curl_easy_init();
77 curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
78 curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
80 curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NATIVE_CA);
82 curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING,
"gzip");
83 curl_easy_setopt(curl, CURLOPT_USERAGENT, user_agent.c_str());
85 curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response_payload);
86 curl_easy_setopt(curl, CURLOPT_HEADERDATA, &response_header);
88 curl_result = curl_easy_perform(curl);
89 curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
91 curl_easy_cleanup(curl);
94 if (curl_result != CURLE_OK || response_code != 200)
96 Ogre::LogManager::getSingleton().stream()
97 <<
"[RoR|CURL] Failed to retrieve url '"<<url<<
"' as string;"
98 <<
" Error: '" << curl_easy_strerror(curl_result) <<
"'; HTTP status code: " << response_code;
99 response_payload = curl_easy_strerror(curl_result);
Game state manager and message-queue provider.
void PushMessage(Message m)
Doesn't guarantee order! Use ChainMessage() if order matters.
std::string ctc_displayname
MsgType ctc_msg_failure
Sent on failure; Payload: RoR::ScriptEventArgs (see 'gameplay/ScriptEvents.h') with args for RoR::SE_...