is Get/SetUserData persistent?

soybeansoybean dijo

hace mucho tiempo | Publicación #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 dijo

hace mucho tiempo | Publicación #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 dijo

hace mucho tiempo | Publicación #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 dijo

hace mucho tiempo | Publicación #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 dijo

hace mucho tiempo | Publicación #5
oh, and btw.. GetUserName works, and shows the correct output (although I've only tried for my account)

MysteryMystery dijo

hace mucho tiempo | Publicación #6 | en respuesta a #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 dijo

hace mucho tiempo | Publicación #7 | en respuesta a #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 dijo

hace mucho tiempo | Publicación #8 | en respuesta a #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 dijo

hace mucho tiempo | Publicación #9
Hey Soy

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

Contestar al tema

Regístrate ahora para responder a éste tema

Juegamigo

juegamigo.com es un sitio de juegos independiente donde puedes jugar solo o en conjunto en los juegos multijugador de una manera gratuita.

Herramientas para Desarrolladores

Si eres un desarrollador de juegos flash, tenemos unas increíbles herramientas que te ayudarán a hacer aún mejores tus juegos.

Juegos Padrísimos

¿Por qué no jugar algunos de los mejores juegos flash en línea que tenemos?, ¡es completamente gratis!

Copyright ©2007-2012 Juegamigo™ - All rights reserved.31.2001ms on SERVER34096