Hidden variables

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

corwin
Posts: 77
Joined: 17 Jul 2009, 08:19

Hidden variables

Postby corwin » 14 Sep 2009, 11:14

Hi again.
My goal this time is to create hidden variable per user, which can be read only from the server.
I tried to do this using the user variables and limbo room, but the user can sniff the data sent and the user object is there, where are attached all user variables.
The obvious way is to do that using database, but I was wondering if there is another way, as I guess this is pretty common case...
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 14 Sep 2009, 19:40

Each User and Room object exposes a properties object where you can store any transient state.
The object is a java Map<String, Object>
No need to use a database unless you need that data to be persistent.
In any case you can use the properties object to store the data until the User disconnects, then you can save everything to the DB in one shot.

By checking the server side documentation you can find more info

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
corwin
Posts: 77
Joined: 17 Jul 2009, 08:19

Postby corwin » 15 Sep 2009, 12:50

Yes, it is just what i need, thanks. :)

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 63 guests