D
DroidFreak36
Guest
I'm working on an HTML5 game that loads level files from other servers, but I'm having a strange bug where it will load an old version of the level after it was updated, making the build-test loop for level creators have an arbitrary delay while they wait for the level to update. I'm pretty sure the issue is that the default http_get() command in GML doesn't disable caching, so a cached version of the level file is returned rather than the current version.
I'm trying to work around that with the http_request() command, but I can't get it to work properly. In fact, it seems to crash my browser when I run the code. Chances are it's a stupid mistake on my part and someone who understands HTTP better will be able to resolve it easily. Either that or it's yet another GML HTML5 bug.
Here's my current code for sending the request:
and for receiving it:
I've noticed in the documentation it doesn't specify that http_request() returns a "result" in the map, but I have no clue how else I would get the content of the page.
I'm trying to work around that with the http_request() command, but I can't get it to work properly. In fact, it seems to crash my browser when I run the code. Chances are it's a stupid mistake on my part and someone who understands HTTP better will be able to resolve it easily. Either that or it's yet another GML HTML5 bug.
Here's my current code for sending the request:
Code:
map = ds_map_create()
ds_map_add(map, "Cache-Control", "no-cache");
ds_map_add(map, "Host", url_get_domain())
http_request("http://www.droidfreak36.com/HATPC/cave_load.php?username=" + keyboard_string, "GET", map, "")
ds_map_destroy(map)
Code:
level_string = async_load[? "result"]