getRoom not detecting deleted vars

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

Moderators: Lapo, Bax

amnesya
Posts: 18
Joined: 10 Dec 2007, 21:54

getRoom not detecting deleted vars

Postby amnesya » 30 Dec 2007, 01:16

hi,

I build up a room and set up some vars serverside.

then on connect i make the client join the main room (limbo).

the client has a getRoom to this room that is invoked every 5 seconds to detect changes in the rooms property and display in the main menu (changes that i cannot detect using onRoomVariablesUpdate because i need to use this command to detect changes in the game room).

everything works fine, and the client displays correctly all the info about the main room (limbo).

but when i set a variable to null in the main room (limbo), i do not get the update in the object recieved by getRoom command. I basically still see the variables that i have just set to null in the main room properties (limbo) as if they are still there.

they should disappear from the list of properties returned by getRoom command.

HOW CAN I DELETE THEM ?

thanks in advance 4 answering.

any idea ?
User avatar
Lapo
Site Admin
Posts: 21685
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 30 Dec 2007, 18:34

RoomVariables don't work with Limbo rooms. The concept behind a Limbo room is that it can hold many hundreds/thousands clients but it suppresses all broadcast-type messages (like user counts, public messages etc...)

Why? In order not to waste bandwidth. If the room contained 2000 clients it would need to send huge broadcast messages to all users on each variable change.

So, even if don't know the details of your application I can suggest two possible options

    1. Revert to a "regular room" so that broadcast messages will work
    2. Use your own custom dispatching system together with the Room.properties object. To minimize the amount of data you could use the JSON or String protocol


the client has a getRoom to this room that is invoked every 5 seconds to detect changes in the rooms property and display in the main menu

I don't get what you mean here, but this sounds inefficient. With a socket connection is not necessary to use these poll-type systems. It would be much better to fire the changes from the server side only when a the values have been modified.
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 21685
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 30 Dec 2007, 18:35

More on rooms and their characteristics here -> http://www.smartfoxserver.com/docs/docP ... ecture.htm
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 27 guests