Forum GameFS Security error caused intermittently by GameFS?

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

Security error caused intermittently by GameFS?

Postby markloika » August 14th, 2011, 7:33 am

Today, for approximately 30 minutes, Block Miner wouldn't load because when it tried to load the sprite sheet from GameFS, it got this error:

Code: Select all
SecurityError: Error #2000: No active security context


(game starts off by loading the tilemap, which is why the game itself wouldn't start)

I researched a bit, and this error can be caused when the file name on the server doesn't match exactly what flash is trying to load.

Imagine I have the following code:

Code: Select all
var tileRequest:URLRequest = new URLRequest("myserver.com/tilemap.png");
var loaderContext:LoaderContext = new LoaderContext(true);
tileLoader.load(tileRequest, loaderContext);


If the file on the server wasn't exactly called "tilemap.png", it would create this error. For example, If the file was called "Tilemap.png" or "tilemap.PNG" this error would happen.

So today, I was getting this error for about 30 minutes. I didn't change anything, because I was researching what causes this error, and it magically went away by itself, which leads me to believe that it was caused by GameFS. I literally did not change a single line of code, and the error was happening for me and other people at different locations for the 30 minutes, and it then fixed itself (this was the live version of the game).

On my computer while this error was happening, I tried compiling with commenting out the .load() line, and the error went away, so it was caused by attempting to load the tilemap image from GameFS.

Does GameFS change the file names? Could my tilemap.png become tilemap.PNG or Tilemap.png due to GameFS?
markloika
 
Posts: 76
Joined: July 8th, 2010, 3:46 am

Re: Security error caused intermittently by GameFS?

Postby Benjaminsen » August 15th, 2011, 6:32 pm

GameFS is a CDN service, this means that we are using a lot of edge nodes to host your files. What I think is happening is that you are referring directly to one of the edge nodes where the file might not exist after a period of time.

Said in another way. to use GameFS you must use the GameFS API to load your files: http://playerio.com/documentation/gamefs/

Likewise and even a bit worse, the edge nodes are inconsistent on how they handle casing. Thus its very very important that you use proper casing for your files and requests. IE if the file is called Tilemap.png and you load "tilemap.png" it will only occasionally work.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Security error caused intermittently by GameFS?

Postby wildbunny » August 15th, 2011, 8:00 pm

I get occasion security errors when using LoaderContext from AS3 to load .swfs from the permanent link displayed in the GameFS admin panel...

So do I need to use the API instead of the permanent link?
wildbunny
 
Posts: 217
Joined: March 9th, 2011, 10:35 am

Re: Security error caused intermittently by GameFS?

Postby Benjaminsen » August 29th, 2011, 10:46 pm

You should be able to use the permanent url shown in the GameFS admin panel without any issue. Next time the issue occurs can I get you to open your browsers activity window and send me a screenshot of the files downloaded to chris@player.io?
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark


Return to GameFS