73bool RoR::GetUrlAsString(
const std::string& url, CURLcode& curl_result,
long& response_code, std::string& response_payload)
75 std::string response_header;
76 std::string user_agent = fmt::format(
"{}/{}",
"Rigs of Rods Client",
ROR_VERSION_STRING);
78 CURL *curl = curl_easy_init();
79 curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
80 curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
82 curl_easy_setopt(curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NATIVE_CA);
84 curl_easy_setopt(curl, CURLOPT_ACCEPT_ENCODING,
"gzip");
85 curl_easy_setopt(curl, CURLOPT_USERAGENT, user_agent.c_str());
87 curl_easy_setopt(curl, CURLOPT_WRITEDATA, &response_payload);
88 curl_easy_setopt(curl, CURLOPT_HEADERDATA, &response_header);
90 curl_result = curl_easy_perform(curl);
91 curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response_code);
93 curl_easy_cleanup(curl);
96 if (curl_result != CURLE_OK || response_code != 200)
98 Ogre::LogManager::getSingleton().stream()
99 <<
"[RoR|CURL] Failed to retrieve url '"<<url<<
"' as string;"
100 <<
" Error: '" << curl_easy_strerror(curl_result) <<
"'; HTTP status code: " << response_code;
101 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_...