client reconnect to server.

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

Moderators: Lapo, Bax

prasoon
Posts: 6
Joined: 04 Mar 2014, 14:08

client reconnect to server.

Postby prasoon » 06 Mar 2014, 09:22

Hi,
We are developing a game for which we need reconnect. Suppose the client has a bad connection and reconnects after 2 mins, the server is not recognizing the client and a new user is created when login is happening.
We want that the client should go directly to the game room.
we have kept high values on config.xml
<MaxUserIdleTime>2000</MaxUserIdleTime>
<MaxSocketIdleTime>2000</MaxSocketIdleTime>

We are using sfs 1.6.6.
Please advice and help. I am new to sfs.

Thanks,
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: client reconnect to server.

Postby Lapo » 06 Mar 2014, 18:43

SmartFoxServer 2X offers some facilitations in this regards by providing a reconnection system, that is documented here:
http://docs2x.smartfoxserver.com/Gettin ... n-hrc-plus

This can help with short temporary interruptions and unexpected disconnections and it is fully transparent, meaning that the user state is maintained both client and server side.

SmartFoxServer PRO doesn't have this feature, although you can add it yourself with extra server side code.
How to implement the feature depends heavily on the requirement of your game. You may need to store the user status on a database when you detect a disconnection and retrieve the game state back when the player returns and if he's still on time.
Lapo
--
gotoAndPlay()
...addicted to flash games
prasoon
Posts: 6
Joined: 04 Mar 2014, 14:08

Re: client reconnect to server.

Postby prasoon » 07 Mar 2014, 07:35

Hi Lapo,
Thanks for the reply.
We are storing the state, but whenever the user is logging in to the server after reconnect the previous state is removed. Do we have to change our login logic?

And One more thing, how much time roughly would it take to migrate from pro to 2X?

Thanks,
Prasoon
User avatar
Lapo
Site Admin
Posts: 23025
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: client reconnect to server.

Postby Lapo » 07 Mar 2014, 09:35

prasoon wrote:Hi Lapo,
Thanks for the reply.
We are storing the state, but whenever the user is logging in to the server after reconnect the previous state is removed. Do we have to change our login logic?

You need to be able to store all of the moves of the current match so that when the player returns you can rebuild his previous client state to the point where the game was interrupted.

And One more thing, how much time roughly would it take to migrate from pro to 2X?

This is difficult to say, it depends on how much code you have.
Also SFS2X uses Java on the server side, if you are using Javascript extensions on the PRO it will take a longer time than if you are already using Java.

SFS2X is not very different from the PRO. The programming philosophy it's very similar.
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 55 guests