Duplicate sessions when Disconnect a connection and connect again.

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

jamesnguyen121294
Posts: 8
Joined: 02 May 2019, 09:38

Duplicate sessions when Disconnect a connection and connect again.

Postby jamesnguyen121294 » 14 May 2019, 06:26

hi,
Step1: I have a connection to server and login to the Zone. When I disconnect it (use Smartfox.Disconnect()) and connect (+ login same user) again. The server appeared: User already logged in. Disconnecting previous instance.

but it still log in to the Zone. but when I join a room. The event OnJoinRoom was called 2 times if I do "Step1" 2 times. 3 times or more if I do "Step1" 3 or more times.
What happens and how to fix that?

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

Re: Duplicate sessions when Disconnect a connection and connect again.

Postby Lapo » 14 May 2019, 08:29

Hi,
after a disconnection you should remove all listeners from the current SmartFox instance and recreate it, since every SmartFox object is valid for one session.

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
jamesnguyen121294
Posts: 8
Joined: 02 May 2019, 09:38

Re: Duplicate sessions when Disconnect a connection and connect again.

Postby jamesnguyen121294 » 14 May 2019, 09:16

Lapo wrote:Hi,
after a disconnection you should remove all listeners from the current SmartFox instance and recreate it, since every SmartFox object is valid for one session.

Hope it helps


Thank you, it's helpful

Return to “SFS2X C# API”

Who is online

Users browsing this forum: No registered users and 29 guests