Forum GameFS Kongregate Issues

Discussion and help relating to the PlayerIO game asset hosting and CDN solution, GameFS.

Kongregate Issues

Postby FuzzySlash » May 4th, 2012, 6:10 pm

Hey,
For the past 5 days we've been having all sorts of issues with Kongregate throwing out errors that weren't there when we tested the game locally.

There was an error when I tried to load a map swf file using GameFS which I managed to fix using this:
Code: Select all
var context:LoaderContext=new LoaderContext();
context.checkPolicyFile=true;
context.applicationDomain=ApplicationDomain.currentDomain;
if(Security.sandboxType==Security.REMOTE)context.securityDomain=SecurityDomain.currentDomain;
setTimeout(function():void{mapLoader.load(fileRequest,context);},1);


This fixed the first map loading, the Main City file.
However, none of the battle maps are loading, even though they use the exact same function to load. Everything works perfectly fine locally, but for some reason when it's on Kongregate, it still uses the Main City swf instead of the real one. The music and data is loaded fine, so the game is told which one to load correctly, it's just the Swf that it's 'choosing' is wrong..
And note that it is loading the map file from GameFS, because it loads longer the first time, which means its loading different content than the city file.

This is quite a complicated error I believe, but maybe someone has an idea what this could be.
You can check out the preview of the game here, just use the guest login and you'll see when you go in to battle (click on the portal to the left when you get to the city):
http://www.kongregate.com/games/OneShar ... 4188ac00d9

Is there any way I can trace anything from a Kong session? Just to see where exactly something might be triggered etc.

Thank you,
Fuzzy


Edit: It seems that whatever SWF passes to the loader using "mapLoader.load(fileRequest,context)", ends up being the same SWF (The first one loaded in a session is the city).

Edit 2: I've now tried inspecting the file whilst playing live on Kong, and the policy file is ok:


So it seems that it does load the new SWF, but then does not refer to it, even though I'm using the same variable to load it, like this (MapLoader):
Code: Select all
//Before calling the next statement, MapLoader is a reference to the city swf.
MapLoader=new Loader();
//A little bit later, after setting the context.
MapLoader.load(fileRequest,context);
//On complete, the load function ends and calls joinedMap();
function joinedMap():void{
var MapC:Class=getExternalClass("Map",MapLoader); //getExternalClass is just grabbing the definition and outputting the class.
gameMC=MovieClip(MapC);
addChild(gameMC);
}


Basically "Map" is the definition I'm trying to grab out of the new SWF.
I don't see why this is happening, it's not happening locally. :cry:


Edit3:Looks like its happening on any website, even when I locally load the TinyLoader. It's only when i play the base game locally that it works.

I tested it removing the security context. Now it works using the TinyLoader, but Kongregate refuses to load (obviously). So this is kind of bad. I can either choose 1 bug or the other, and both ruin the game.
Hopefully its only 1 part of the security context that causes this.
FuzzySlash
 
Posts: 37
Joined: April 15th, 2011, 3:59 am

Re: Kongregate Issues

Postby Benjaminsen » May 7th, 2012, 2:05 pm

Should be as simple as setting Security.allowDomain("*") for both files
You naturally still need the loadPolicyFile attribute.

- Chris
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Kongregate Issues

Postby FuzzySlash » May 7th, 2012, 2:09 pm

Hi,
Indeed, after fiddling around more this morning, that was it.
All solved then, thanks.
Fuzzy
FuzzySlash
 
Posts: 37
Joined: April 15th, 2011, 3:59 am


Return to GameFS