Studio Links

Plugs

MXGuardDog: free spam filter
04 Dec
2011
0

Bugs on Build Day

As you might expect, we’re very excited anytime we get a chance to push out a new build of Trivia Adventure. We look forward to sharing our newest changes with the world and seeing how people take to them, and start thinking of what great new features we get to start adding for the next release.

The truth is, most of the time, release days are a combination of stress and surprise. Today, we were blindsided by a bug in Flash. Naturally, we discovered it just minutes after we pushed live and had opened the servers to other players, and after we’d been testing for several days on both our internal and hosted test servers. It was a shock that in this day and age, it was an unterminated buffer giving us garbage data in very specific circumstances, and it just so happened the only place we ran into that data was on the live server… astronomically unlikely that we were able to isolate the problem and capture it, but some days you catch a break. In our case, anyone who had another specific player as a friend would be completely unable to start the game until this problem was fixed–strictly because their friend record clocked in precisely at 8192 bytes long. It had nothing to do with the content of their data, just the length. And we verified it was a bug in Flash, both in Chrome and Firefox, and that the server produced data that was exactly 8192 bytes after decompression, but only when logging into Facebook with HTTPS. The data coming from Flash’s URLLoader class was not 8192 bytes long even though its length was reported correctly. It was longer, and anyone who has used Flash knows the XML parser will spectacularly fail if any extra non-XML data is present. Crashcrashcrash. Again, luck was on our side and we worked around the issue by throwing away the extra data manually, but it was a couple of hours even to determine the cause of the crash. My guess is, very few people have guarded their code properly to handle this issue, even if it’s something Adobe could reasonably claim is correct behavior.

The solution was something like this:

var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest("mydata.php");
var mydata:String = "";
try
{
loader.load(request);
mydata = loader.data.substr(0, loader.bytesTotal);
}
catch (error:Error)
{
trace("Unable to load requested document.");
}

On the up-side, we put out another release of Trivia Adventure and fixed a bunch of random issues (like this one), meanwhile some gorgeous new levels were added to make the game a bit longer and better.

Author:

spread the word:

You must be logged in to post a comment.

Gaming News :