first of all, sfs2x is awesome. No more getRoomList! hoorah.
now I'm trying to figure out the simplest way to keep a user from being disconnected by the maxIdleTime. I've searched around and lapo mentioned sending an empty extension request to the server, but in SFS2x an error is thrown when no extension exists. I guess I could create a blank extension and check for this "ping" event, but what do I need to do server side in order to flag a user as still being logged in? Or is there another way to accomplish this without using extensions? I've tried setting a user variable and that works, but it sends out a "onUserVariablesUpdate" message to all users in the same room which I don't want, and I see no option to declare it as a private update.
Would be nice for future versions to include an automatic "ping" interval to keep a user connected. Something like sfs.setPingInterval(10)
thanks for the help.
*And before it comes up, I don't want to set the maxIdleTime to 63 million years, I still want idle disconnection at certain parts of my app. I'm using smartfox as room/user management only. Once in game, other methods are being used so no calls to the server are ever made. Which means I need a way to keep clients connected to the server in game.
Stopping a user from idle disconnection
-
bart4president.com
- Posts: 74
- Joined: 23 Mar 2010, 02:35
Aye.. a blank extension request seems to be the best option.. and just have that run on an interval event which you can flip on and off. An abstract class with with an On/Off method would suffice.
Its probably in the same vein of what I'll be doing as well as I will have some instances in the game where they might be doing something in singleplayer for long periods of time.
OR.. you can store login info and just relog in after a user "wakes up" automatically.
Its probably in the same vein of what I'll be doing as well as I will have some instances in the game where they might be doing something in singleplayer for long periods of time.
OR.. you can store login info and just relog in after a user "wakes up" automatically.