Keeping room variables after the owner is gone.

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

Moderators: Lapo, Bax

User avatar
death_au
Posts: 8
Joined: 23 Mar 2010, 03:17

Keeping room variables after the owner is gone.

Postby death_au » 23 Mar 2010, 03:23

I'm relatively new to smartfox, and so far the tutorials and documentation have been a great help. But I've been building an online card game and came across a problem. I wanted to set it up so that if a user disconnects in the middle of a game, then they have a period of time (about a minute) to rejoin and things continue as normal.

I thought it would be safe to store all the necessary variables as room variables, then when the user reconnects they can just grab what's already there.But if the user who disconnected was the one who broadcast the variable, then that variable is lost and I can't get it back.

Is there any way I can make some variables persistent so that they will not be lost if someone gets disconnected?
User avatar
Lapo
Site Admin
Posts: 23027
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 24 Mar 2010, 10:39

Currently there isn't a way to handle this case.
RoomVariables are removed immediately in order to keep everyone in synch. If you need to implement a different behavior you should use server side code and imlement your logic there.

Good news is that the next major release will address this problem from the root. Stay tuned.
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
death_au
Posts: 8
Joined: 23 Mar 2010, 03:17

Postby death_au » 24 Mar 2010, 22:09

Well for now I guess I'll just leave that functionality out, as it's not a huge deal and probably won't occur that often anyway. Otherwise I would be looking at writing a server-side extension for it.
It's good to know that I may be able to implement this in the future though. Thanks for the info :)
mixart
Posts: 95
Joined: 08 Aug 2007, 20:32

Postby mixart » 30 Mar 2010, 09:28

Lapo wrote:Good news is that the next major release will address this problem from the root. Stay tuned.


Can't wait Lapo - a very desired feature.

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 98 guests