Jump to content


iotech

Member Since 13 Jun 2012
Offline Last Active May 08 2013 11:55 PM

Posts I've Made

In Topic: http_get: repeated callback

01 July 2012 - 11:26 PM

Ok, solved my problem well enough to continue working on it... the key(s) were in the bug report I referenced above: 1) crossdomain.xml and 2) uploading the "production build".

Ok, so I finally noticed (duh!) that when running the game from the GM IDE, it is listening on a non-standard port (51268 for example). Since I didnt openthat listen port on my Apache server, I finally realized that the IDE launches it's own "web server", which listens on the specified port. Even though I have set GM:S to know where my web root is, it doesnt read the crossdomain.xml file in the web root folder.

So, here is how I got it to run:

1. put a valid crossdomain.xml file in my web root. My file is simplistic:
<?xml version="1.0" ?> 
<cross-domain-policy> 
	<allow-access-from domain="*" /> 
</cross-domain-policy>

2. Then, I used the Create Application function of GM:S, and specified a new folder under web root (so I wouldn't overwrite the files I use for in-IDE testing). For example: d:\wamp\www\gamename\build\
GM:S then faithfully compiled the app to this folder.

3. Open the app in my browser by using the proper URL (ex: http://my.domain.com/gamename/build/) and it works just fine.

Hope this helps out the OP and whoever else needs it!

-iotech

In Topic: http_get: repeated callback

01 July 2012 - 10:22 PM

I'm encountering the same behavior. The code works fine on Windows and Android targets, but on HTML5 target I get the http event repeating endlessly.

I have a button, btnLogin, with the following in my Left Pressed event:
get_login_async(global.myusername, global.mypassword);

This causes the User Interactions event...
The User Interactions event:
global.username = ds_map_find_value(async_load,"username");
global.password = NewHash(ds_map_find_value(async_load,"password"));
http_get(global.serverURL + "?f=au&pname="+global.username+"&pword="+global.password);
Note that the correct data is successfully retrieved from async_load at this point. We then (above) send off the username and password
to the php script for authentication (using http_get).

This *should* (and does) generate the http event:

HTTP event:
global.returnedcall = ds_map_find_value(async_load,"result");
As I say, it does generate the HTTP event, but the result field of async_load is empty... and the http event fires over and over and over....

To reiterate, this code works as desired with a Windows or Android target. Any ideas?

p.s. I think this post is the same problem... I am thinking the http_get function is borked in HTML5 compiles, or the ds_map that is returned is formatted differently.

p.s.s. Looks like this problem is discussed in the bug database here In this bug, Russell Kay says the problem is due to "cross site permissions", which I take to mean crossdomain.xml He didnt explain however how to make a properly formatted "cross site permissions", nor do I find it in the docs. Don't see it in the tutorials either... surely this must be a common thing for those of you who have successfully published GMHTML5 projects... how does one go about properly providing "cross site permissions"?

In Topic: how is gm android by your personal experience?

24 June 2012 - 04:03 PM

Hmm well it does sound good, i forgot to ask an important question, can it use mysql on android though?


Not directly, but you can code it with GML to call a parameterized php query on a web server, which will do the data access and return the result to your game. This is actually better than direct access for security, since you have no reason to store your db credentials in the game (which is easily decompiled). If you know how to set up a secure apache/mysql/php stack you should have no problem with the GML side of things.

In Topic: Game Widgets - Your Pure Gml Solution To Dll's

24 June 2012 - 03:21 AM

Amazingly useful, thank you! It even loads on Android (albeit with some issues). Well done, I say!

Gerry

p.s. Did you ever get the Studio file? If not, I can help you with that. pm me.

In Topic: Compatible with Android 4.0?

24 June 2012 - 12:18 AM

Likewise, working fine on my Transformer TF101