User Reconnection In SFS2X

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

sankarganesh86
Posts: 108
Joined: 06 Jan 2010, 09:50
Location: chennai
Contact:

User Reconnection In SFS2X

Postby sankarganesh86 » 08 Aug 2019, 08:29

Hi,


Client - AS3.0
Server - Java

Due to poor internet connection some times our client got disconnected from the server and after few sec again Internet is connected
So how to handle this kind of scenario ? We need to maintain same session for that user in our server
Please guide me ASAP
Sankar.G
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: User Reconnection In SFS2X

Postby Lapo » 08 Aug 2019, 09:22

Hi,
I would recommend activating this:
http://docs2x.smartfoxserver.com/Gettin ... n-hrc-plus

It will help when there are hiccups/instability in the client network. It's not a silver-bullet for every type of bad connection but it usually improves the overall stability.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
sankarganesh86
Posts: 108
Joined: 06 Jan 2010, 09:50
Location: chennai
Contact:

Re: User Reconnection In SFS2X

Postby sankarganesh86 » 08 Aug 2019, 09:32

Hi

Thanks for the fast Response !!!

Where we need to enable or disable the HRC+ in SFS2X ?

private function onConnectionLost(evt:SFSEvent):void
{
Trace("Connection was lost. Reason: " + evt.params.reason)
}

We need to trigger any other Event from client side from the above Function for to reconnect ?
Sankar.G
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: User Reconnection In SFS2X

Postby Lapo » 08 Aug 2019, 12:12

If you follow the link at the bottom of the article it will bring you to the page with all the details:
http://docs2x.smartfoxserver.com/Develo ... tion-phase

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
sankarganesh86
Posts: 108
Joined: 06 Jan 2010, 09:50
Location: chennai
Contact:

Re: User Reconnection In SFS2X

Postby sankarganesh86 » 10 Aug 2019, 14:39

Hi Lapo,

Client AS3

We added the 2 events CONNECTION_RETRY & CONNECTION_RESUME in Client Side

Server Side

We added the 2 Events SFSEventType.USER_RECONNECTION_TRY & SFSEventType.USER_RECONNECTION_SUCCESS

In Admin Page

I set User Reconnect time frame to 10 and restart the server too

Is there any other things i need to do ?
Just we need to capture the event and based on that event trigger we need to run our game that's it ?
The Reconnection and Resume all events will trigger automatically on both server and client ?
Sankar.G
sankarganesh86
Posts: 108
Joined: 06 Jan 2010, 09:50
Location: chennai
Contact:

Re: User Reconnection In SFS2X

Postby sankarganesh86 » 13 Aug 2019, 03:48

Hi Lapo,

I am waiting for ur response for my previous post questions !!!
Now a days why u didn't give response for some post any reasons behind it to skip some post in forums ?
Sankar.G
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: User Reconnection In SFS2X

Postby Lapo » 13 Aug 2019, 08:27

sankarganesh86 wrote:Hi Lapo,

Client AS3

We added the 2 events CONNECTION_RETRY & CONNECTION_RESUME in Client Side

Server Side

We added the 2 Events SFSEventType.USER_RECONNECTION_TRY & SFSEventType.USER_RECONNECTION_SUCCESS

In Admin Page

I set User Reconnect time frame to 10 and restart the server too

Is there any other things i need to do ?

No, you have set it up correctly.

Just we need to capture the event and based on that event trigger we need to run our game that's it ?

Yes, that's correct.

The Reconnection and Resume all events will trigger automatically on both server and client ?

Yes.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 96 guests