onConnectionRetry fail listener

Post here your questions about the Flash / Flex / Air API for SFS2X

Moderators: Lapo, Bax

aliko
Posts: 117
Joined: 09 Mar 2013, 16:26

onConnectionRetry fail listener

Postby aliko » 09 Dec 2014, 18:04

Hello,

We can listen onConnectionRetry resume with
sfs.addEventListener(SFSEvent.CONNECTION_RESUME, OnConnectionResume);

But how can we listen retry error? connectionlost not fired, and connection status become true again whitout resume fired.


Best Regards
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: onConnectionRetry fail listener

Postby Lapo » 10 Dec 2014, 09:34

Hi,
I am not sure if I understand your question.

When the reconnection system is active you will get one event called CONNECTION_RETRY when the user's connection is lost and the client is retrying to join the server.
If the operation succeeds you will get a CONNECTION_RESUME event, and the client will be back without having lost his previous state.
Otherwise you will get a CONNECTION_LOST event, signaling that the attempt to reconnect has failed.

The API do not fire events for every single reconnection attempt during the time in which the reconnection is being tried.

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
aliko
Posts: 117
Joined: 09 Mar 2013, 16:26

Re: onConnectionRetry fail listener

Postby aliko » 10 Dec 2014, 11:47

Hello,

Thank you very much for your reply.
I try to explain details.

- i login my game
- when i try to login with another browser with same user wihtout closing 1st window.
- new tab or browser open connection and login server
- but old login tab cannot recive connection lost event. it tries to retry but not recieve resume or connection lost event.
- i think it has only get session not logged to server.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: onConnectionRetry fail listener

Postby Lapo » 10 Dec 2014, 11:56

Can you please specify:

- the SFS2X version
- the API language (AS3, C#, Java. Obj-C ...) and version
- if the "ForceLogout" flag is ON or OFF in your zone

Thanks.
Lapo

--

gotoAndPlay()

...addicted to flash games
aliko
Posts: 117
Joined: 09 Mar 2013, 16:26

Re: onConnectionRetry fail listener

Postby aliko » 10 Dec 2014, 16:18

- the SFS2X version -> 2.9.2
- the API language (AS3, C#, Java. Obj-C ...) and version - > AS3
- if the "ForceLogout" flag is ON or OFF in your zone - > I cannot find any setting for that in zone.xml


also i want to inform that i'm using custom login.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: onConnectionRetry fail listener

Postby Lapo » 10 Dec 2014, 16:24

The ForceLogout is to be found via the AdminTool > ZoneConfigurator > [Your Zone Name]

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
aliko
Posts: 117
Joined: 09 Mar 2013, 16:26

Re: onConnectionRetry fail listener

Postby aliko » 10 Dec 2014, 16:57

ForceLogout is On

Thanks
aliko
Posts: 117
Joined: 09 Mar 2013, 16:26

Re: onConnectionRetry fail listener

Postby aliko » 11 Dec 2014, 10:43

Dear Lapo ,

I checked and ForceLogout is On.

do you have any suggest for me to catch connection retry erro.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: onConnectionRetry fail listener

Postby Lapo » 11 Dec 2014, 11:25

aliko wrote:- i login my game
- when i try to login with another browser with same user wihtout closing 1st window.
- new tab or browser open connection and login server
- but old login tab cannot recive connection lost event. it tries to retry but not recieve resume or connection lost event.
- i think it has only get session not logged to server.


I tested your scenario and it works fine.
I can login once with name "Lapo", then start a new tab login again with name "Lapo"
At this point the 2nd client is logged in and the 1st is kicked out and he receives the disconnection event.

Maybe you're using an old AS3 API. Make sure you update to the latest version available here:
http://www.smartfoxserver.com/download/sfs2x#p=client

Last version is 1.2.5
Lapo

--

gotoAndPlay()

...addicted to flash games
aliko
Posts: 117
Joined: 09 Mar 2013, 16:26

Re: onConnectionRetry fail listener

Postby aliko » 11 Dec 2014, 13:40

Thank you very much for your great support.
I'm using version 1.0.1 still :)))

After updating client api problem fixed.


Best Regards

Return to “SFS2X ActionScript 3 API”

Who is online

Users browsing this forum: No registered users and 17 guests