is Get/SetUserData persistent?

soybeansoybean said

a long time ago | Post #1
My game usually use SharedObject to store save states. With nonobaAPI, I thought I might use the Get/SetUserData to store it on server. As I tried using it, resetting the game works fine as it reloads all data nicely. But when I refresh the page, it won't load previous saves :(:(. Help?

soybeansoybean said

a long time ago | Post #2
OK, I added an in-game trace panel to see what was going on with the API and found that on setUserData, it returned an Error note. So I guess, my new question is, what makes setUserData output error?

Thanks :)

TobyToby said

a long time ago | Post #3
Of course you would get an error. Using the trace panel means you were running it locally, and the API needs to be running on Nonoba.com (so In other words, upload it).

soybeansoybean said

a long time ago | Post #4
the trace panel I'm talking about is in-game.. inherit it from flash.text.TextField, and showed in-game (so I didn't call it by the regular trace(msg), but using a custom class TracePanel.trace(msg)). it's uploaded, and I tested it online, only it's hidden.

soybeansoybean said

a long time ago | Post #5
oh, and btw.. GetUserName works, and shows the correct output (although I've only tried for my account)

MysteryMystery said

a long time ago | Post #6 | in reply to #2
Did you remember to convert your data to strings before passing it to setUserData? Remember that setUserData accepts data as strings (unlike SharedObject which can store various types), and that maybe passing non-string data causes the error.

soybeansoybean said

a long time ago | Post #7 | in reply to #6
yep.. I've converted it using JSON.serialize.. erm... has anyone experienced the same with JSON?

Oh, and all of this is in AS3 btw... :/

Anyway, thanks for the replies, guys :)

HenrikHenrik said

a long time ago | Post #8 | in reply to #7
There's a limit on the amount of data you can store, I think it's 1000 bytes or something. A serialized JSON object would probably be larger than that, which then causes the error.

ChrisChris said

a long time ago | Post #9
Hey Soy

Please send me some fancy pancy code that fails as a private message so I can try it out.

Reply to thread

Sign up now to reply to threads

Funkyball

funkyball.com is an independent gaming site where you can play both single- and multiplayer games for free.

Developer Tools

If you're a flash game developer, we've got some awesome tools to help you make even better games.

Great Games

Why not try some of the very best online flash games we've got, completely free?

Copyright ©2007-2012 Funkyball™ - All rights reserved.31.2ms on SERVER34096