Game Save not working after page refresh

2 posts (showing 1-2)
Juice-Tin

Market Level 8Community Level 5
93 posts

The game seems to save and load just fine while the game is running, using setSavedGame(str, 0); and then getSavedGame(0) to verify.

However when the page is refreshed, getSavedGame(0) returns an empty string. Is there some sort of flush command to send the data to the server? It seems the data just sits around locally and is never submitted.

Thanks

Edit: It seems to work on other tests, however this is the string I'm submitting
11121211100|player:1:10000:8170094:3750201|0,0:0,0:1:0:0,6,12:::0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,:0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,:0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,|0:12:12:12|0-0-0,0,0:9-0-0,0,0:19-0-0,0,0:29-0-0,0,0:39-0-0,0,0|0:9:19:29:39

The string is most likely to grow up to 5-10 times longer when they play through the game, however this string does not save. Is there something being conflicted with it's formatting? Too long?

Note: Tests with a new file and a basic save string work, only my save above does not work.

Problem solved: Major gamersafe bugIt turns out gamersafe will NOT save any data if the first character is not a letter. In my case the first character was a number, and so I spent hours trying to figure out what the problem was. This is a major flaw and can easily be fixed be appending a prefix letter in the backend when saving, and removing it when loading data.

posted 2014-06-13T17:02:06-07:00 | edited 2014-06-13T19:38:36-07:00
FGL_Devault

FGL AdminCommunity Level 3
246 posts

BTW, I have read this bug, but I can't reproduce it with your data. The size limit on save games is 10kb. You'll get a warning message if you try to set one larger.

Frankly, Save Games are one of the first and oldest features of GS, and also the simplest. After a quick review, I don't see a mechanism for this on my side. I'm sure you've found something, but I can't seem to find it in my GS code.

posted 2014-06-18T16:52:24-07:00