Multiple SFSEvent callbacks

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

Moderators: Lapo, Bax

Dairladada
Posts: 1
Joined: 17 Jul 2017, 12:21

Multiple SFSEvent callbacks

Postby Dairladada » 17 Jul 2017, 12:27

Hello,

We are trying to update our game Eredan Arena to Unity3d from Adobe Air without changing our server but we get Multiple SFSEvents callbacks even after having logged out.

We use this:

Server Version: 1.6.8
Unity Client Version: 1.2.6

Platform: Unity

Function called:
Logout()
Disconnect()
Dispose()
(at the same time, and timed, this returns the same problem)

ProcessEventQueue() is called on FixedUpdate() and runInQueueMode is true

The problem is:
When you disconnect to the smartfox (with functions above), SFSEvent callbacks is called multiple times, increasing for each new connection.

When we remove manually the events callbacks, it stack to memory too ...

The connection work, messages too, but it stacks infinitely until a crash ...

Some times, the messages receiving just stop, without sending disconnection or anything else....
And without timeout too.

Do you have any solution?
Thank you for your help.

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

Re: Multiple SFSEvent callbacks

Postby Lapo » 17 Jul 2017, 13:24

Dairladada wrote:The problem is:
When you disconnect to the smartfox (with functions above), SFSEvent callbacks is called multiple times, increasing for each new connection.

To disconnect you just need to call Disconnect(). There's no need to invoke 3 methods.
Also I am not sure I follo the "increasing for each new connection" part. Once you have disconnected you should not reuse the current SmartFox object, instead you should release the previous listeners and create a new one (thus dereferencing the former obj.)

When we remove manually the events callbacks, it stack to memory too ...

I am not sure I understand what you mean by that. Can you give me an example?

In any case make sure to recreate the SFS object before you start a new connection.

Thanks
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 35 guests