Tuesday, August 18, 2015

Abiathar Online - Saving, Kind Of

Today I hammered out the level serialization code for Abiathar Online. Data arrangement and compression were easy thanks to my already having implemented them in FleexCore2. However, there was still the problem of how to get the data to Dropbox.

I did indeed decide to take advantage of a free PHP host to perform the conversion/echo of a Base64 query string to a binary response. One quick PHP script later (my first ever), I had an echo server up and running. Well, it was almost that simple. The hosting service injects a bit of HTML and JavaScript so they can provide me with analytics, but the snippet was getting injected into binary files as well, which is clearly not good. I fixed the problem with an exit; statement to halt execution after dumping the binary data down the wire.

The echo server is available at abiathar.site40.net/echo.php?data= (fill in your own Base64 data after the equals sign). For good measure, I had it also supply a downloaded file name, which can be specified with a filename parameter.

I wired up the serialization function to the Dropbox Saver and the PHP server, and quickly discovered that there is definitely a limit on URL length. The URL for the main maps file is so long that even Chrome won't display the entire thing, no matter how hard I try to scroll right in the address bar. The map header one works, though, and came out unscathed by the long process it went through! Tomorrow I will have to think of something clever to get around this URL length problem.

No comments:

Post a Comment