Zhen-Xlogic Posted March 7, 2016 Posted March 7, 2016 (edited) Hello, I notice in GitHub wiki section, you have a Server List API in json format, where we can find the json to call it in php page ? Edited March 7, 2016 by Zhen-Xlogic
GingerAdonis Posted March 7, 2016 Posted March 7, 2016 (edited) <?php $url = "https://servers.openrct2.website"; $headers = array( "GET HTTP/1.1", "Accept: application/json" ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $data = curl_exec($ch); if (curl_errno($ch)) print "Error: " . curl_error($ch); else { //Show output var_dump($data); } curl_close($ch); This should work! (untested) Edited March 7, 2016 by JarnoVgr
Zhen-Xlogic Posted March 7, 2016 Author Posted March 7, 2016 @JarnoVgr Script returns --> Error: SSL certificate problem: unable to get local issuer certificate. Any ideas ?
GingerAdonis Posted March 7, 2016 Posted March 7, 2016 You can consider adding this. This will stop checking the SSL certificate: curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); A proper fix can be found on Google.
janisozaur Posted March 8, 2016 Posted March 8, 2016 you probably are looking for something like this: https://github.com/OpenRCT2/OpenRCT2/blob/develop/src/network/http.cpp#L139
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now