The status and ID should be reals anyway....?
When doing loading/requests.... the lookup isn't exactly the time sink.
Posted 14 March 2012 - 01:22 PM
Posted 15 March 2012 - 03:15 AM
Posted 15 March 2012 - 01:19 PM
Posted 15 March 2012 - 06:39 PM
async = http_get(url);
if (ds_map_read(async,"status") == 200) {
result = ds_map_read(async,"result")
}Edited by Manuel777, 15 March 2012 - 06:42 PM.
Posted 16 March 2012 - 10:31 PM
Posted 18 March 2012 - 05:13 PM
Posted 19 March 2012 - 04:27 PM
Posted 19 March 2012 - 04:43 PM
Posted 19 March 2012 - 04:49 PM
Speaking of JSON, will there be functions like string_json_encode and string_json_decode to help parse json strings, like in PHP?This demo will return a JSON string with the parameters you supplied in the post/get
Edited by alexandervrs, 19 March 2012 - 04:49 PM.
Posted 19 March 2012 - 04:53 PM
Posted 19 March 2012 - 05:06 PM
Posted 19 March 2012 - 05:26 PM
So you're thinking it's a cross domain issue? I will certainly try your test app this eve. However, I'm running everything locally on a wampserver in one folder. The game code and server scripts are all together. One thing that is different on my setup is I'm using localhost:81. Is there a problem with the port maybe?
Posted 19 March 2012 - 05:42 PM
Edited by scurvycapn, 19 March 2012 - 05:43 PM.
Posted 19 March 2012 - 06:02 PM
So you're thinking it's a cross domain issue? I will certainly try your test app this eve. However, I'm running everything locally on a wampserver in one folder. The game code and server scripts are all together. One thing that is different on my setup is I'm using localhost:81. Is there a problem with the port maybe?
when you're entering URL to browse any site ont that localhost, is it http://localhost:81/ or just http://localhost/ ? Then, when you're executing that from GM, you're using exactly same protocol, host name and port ?
Edited by locohost, 19 March 2012 - 09:03 PM.
Posted 19 March 2012 - 09:22 PM
Edited by True Valhalla, 19 March 2012 - 09:40 PM.
Posted 21 March 2012 - 08:38 PM
I'm only getting -1 status and 0 http_status as well from a URL I know should be returning different values.
I tried Mike's demo and that all seemed to work fine. I guess it's a problem with my host
Posted 25 March 2012 - 08:55 PM
Edited by Destron, 25 March 2012 - 09:18 PM.
Posted 25 March 2012 - 09:01 PM
If your struggling to get this to work it is because you can not test locally on your PC. You will need to upload your HTML5 game to your web server and try it there.
Since GMS does not let you export the game(create application) and the async events don't work in GM:HTML5 then what you need to do is run your game but don't close it, then look in the compile window to where the temp game is created, will be %AppData%/Local/Temp/gm_ttt_XXXXX/game_name/ and go to that location to get the game and upload it to your web server (or transfer to the www folder of your wamp server).
From there you can run it and get the expected results.
Posted 25 March 2012 - 09:19 PM
If your struggling to get this to work it is because you can not test locally on your PC. You will need to upload your HTML5 game to your web server and try it there.
Since GMS does not let you export the game(create application) and the async events don't work in GM:HTML5 then what you need to do is run your game but don't close it, then look in the compile window to where the temp game is created, will be %AppData%/Local/Temp/gm_ttt_XXXXX/game_name/ and go to that location to get the game and upload it to your web server (or transfer to the www folder of your wamp server).
From there you can run it and get the expected results.
Have you ever installed a web server on your laptop? It's quite easy. Wampserver is one very simple way. My game is running in a folder on my local web server right beside the PHP scripts. I can call them just fine from my Javascript extension. But I'd like to replace the extension and that bit of complexity with http_get. It -might- be because Wampserver is not running on port 80 but so far I can get a comment on that.
Edited by Destron, 25 March 2012 - 09:21 PM.
Posted 25 March 2012 - 09:25 PM
If your struggling to get this to work it is because you can not test locally on your PC. You will need to upload your HTML5 game to your web server and try it there.
Since GMS does not let you export the game(create application) and the async events don't work in GM:HTML5 then what you need to do is run your game but don't close it, then look in the compile window to where the temp game is created, will be %AppData%/Local/Temp/gm_ttt_XXXXX/game_name/ and go to that location to get the game and upload it to your web server (or transfer to the www folder of your wamp server).
From there you can run it and get the expected results.
Have you ever installed a web server on your laptop? It's quite easy. Wampserver is one very simple way. My game is running in a folder on my local web server right beside the PHP scripts. I can call them just fine from my Javascript extension. But I'd like to replace the extension and that bit of complexity with http_get. It -might- be because Wampserver is not running on port 80 but so far I can get a comment on that.
Yes, that was why I mentioned copying to the www folder of Wampserver as well. I do have a local server running in my house that I use but I like to test both my local server and my paid hosting server. Sometimes I get different results. Just wanted to make people aware that running your game from the GM "play button" and calling the scripts from either wamp server or your paid hosting won't return you the expected results.
Edited by locohost, 25 March 2012 - 09:58 PM.
0 members, 0 guests, 0 anonymous users