Page 1 of 1

limbo setUserVariables

Posted: 28 Dec 2009, 09:00
by corwin
Hi, first of all, Merry Christmas. :)
Second - we have an application with lobby, where all users stay, even when they play in other rooms. As the number of users grew, we decided to make that lobby limbo. But after that "something" stopped working. After some investigation we saw that that sfs.setUserVariables gives null pointer exception. We moved setting user variables to the server side, but i couldn't find in the documentation, why the client can't set user variables when user is only in limbo room..

Posted: 29 Dec 2009, 07:54
by Lapo
Hi,
thanks and happy holidays to you too :)

As regards the Limbo Room issue this is expected because Limbo Rooms suppress all broadcast-type event, including public messages, room variables and user variables.

The characteristics of each Room type is described in details here:
http://www.smartfoxserver.com/docs/docP ... ecture.htm

Posted: 30 Dec 2009, 08:11
by corwin
Yes, I read the docs - it is normal the broadcast to be suppressed, but we event can't set the user variable from the client. :)

Posted: 30 Dec 2009, 09:55
by Lapo
Exactly, all messages which involve broadcasting to multiple users are suppressed. Users in a Limbo Room have no notion of other clients in the same place. This allows to suppress all the frequent updates and allow thousands of users in the same Room.

The usefulness of a Limbo Rooms becomes clear when you pair it with the Buddy List which allows users to know about each other and communicate without having to know the full list of users and being updated about the state of each one.

Also Buddy Variables can substitute regular User Variables.

Make sure to check the documentation, Chapters 6.10, 8.16 and the SmartMessenger tutorial to learn all the features in greater detail.

Posted: 30 Dec 2009, 10:05
by corwin
Ok, thanks.

Posted: 26 Jul 2011, 05:33
by Carl Lydon
The problem with this is I normally set the user's location in the room before the user joins the new room, so the avatars will appear in the right spot once the userlist comes in.

This doesn't work when going from a Limbo room, since it gives me an error that halts my program.

Posted: 26 Jul 2011, 06:40
by BigFIsh
You could always use sendXtMessage to tell the server to update the user's variable and then join the room, based on the parameters sent from the client.

Posted: 27 Jul 2011, 18:20
by Carl Lydon
I could, but that seems like a big production, to make a special case just because I'm leaving a limbo room. Is this the same in Smartfox 2.0?

It makes sense that vars are not broadcast when a limbo room, but it does not follow as a consequence that those same values should not be settable given that they do persist and exist. I can think of many, many scenarios where you might want to change a user variable even though you are in a Limbo room where nobody would see the change immediately.

I tend to use server - side user properties instead of user variables for many things because they're more secure and because user variables have many problems. There's quite a lack of control with user variables and this is one example.

Posted: 28 Jul 2011, 17:04
by Lapo
User Variables have a defined scope and rules that governs them, for all the rest server side code can be used to create custom behaviors.

In SFS2X you can fine tune the type of events fired by each Room so you can create Limbo-like Room that don't suppress all events. You can check the product for free, so I encourage to take a look at the docs and the downloadable trial