|
Veteran Member
Join Date: Mar 2010
Location: m_flZipcore
|
08-09-2017
, 21:23
Re: [ANY] SteamWorks
|
#604
|
Quote:
Originally Posted by Deathknife
Cheap workaround for "non-threaded call" (Wouldn't recommend ever doing this though)
PHP Code:
Handle request = SteamWorks_CreateHTTPRequest(k_EHTTPMethodGET, "https://www.google.com");
SteamWorks_SetHTTPCallbacks(request, HTTPCompleted, INVALID_FUNCTION, HTTPReceive);
SteamWorks_SendHTTPRequest(request);
int p = 0;
SteamWorks_GetHTTPResponseBodySize(request, p);
while(p == 0) {
SteamWorks_GetHTTPResponseBodySize(request, p);
}
the events are fired the next tick, but it's ready to use and you can get response data with callback easily after the while loop ends.
PHP Code:
SteamWorks_GetHTTPResponseBodyCallback(request, fCallback, data);
|
If the target url returns a blank page or is unreachable your gameserver is fucked
__________________
|
|
|
|