userLost problem

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

Moderators: Lapo, Bax

Goddes
Posts: 15
Joined: 25 Jan 2014, 21:08

userLost problem

Postby Goddes » 17 Jan 2016, 22:20

Hello there, it seems like very often when I login i get directly disconnected, not kicked but disconnected It's like the emu gets userLost but I don't even receive anything from sfs that I have been logged out. It happens very often and most of the times its directly when I login
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: userLost problem

Postby Lapo » 18 Jan 2016, 08:28

Hi,
it would help if you could check the server logs at the time of the disconnection, to see if there have been any errors.

It's like the emu gets userLost

What is "the emu"?

thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
Goddes
Posts: 15
Joined: 25 Jan 2014, 21:08

Re: userLost problem

Postby Goddes » 19 Jan 2016, 07:50

Haha sorry I meant extension
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: userLost problem

Postby Lapo » 19 Jan 2016, 09:21

Do you mean that when the disconnection occurs you don't get an error on the client side?
Is the client code listening for the CONNECTION_LOST event?

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
Goddes
Posts: 15
Joined: 25 Jan 2014, 21:08

Re: userLost problem

Postby Goddes » 20 Jan 2016, 08:41

Yea, please let me explain it again clearly. When an user connects for the first time he is fine but when he disconnects from the client (without refreshing page or something else) whenever he tries to login again he gets automatically disconnected and in the extension there are notifications such as "user has been kicked" or any other error. I just get the event userLost. While when he refreshes the page and connects and logins again its all fine.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: userLost problem

Postby Lapo » 20 Jan 2016, 08:58

Can you explain how the manual disconnection from client side is done?
Do you recreate the main SmartFoxClient object after the user has disconnected? That's needed.

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
Goddes
Posts: 15
Joined: 25 Jan 2014, 21:08

Re: userLost problem

Postby Goddes » 20 Jan 2016, 22:38

Yeah I got you, you might be pretty much correct you know, can you help me out and tell me which lines of code exactly create the smartfoxserver user object or what ever you mentioned so i can manually look and fix it, thanks x) Tigru loves u
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: userLost problem

Postby Lapo » 21 Jan 2016, 08:35

I mean the SmartFoxClient object which is created before you connect.
When the client is disconnected you should recreate that object if you want to start a new game session.

The creation is done like this:

Code: Select all

var sfs:SmartFoxClient = new SmartFoxClient();


Makes sense?
Lapo

--

gotoAndPlay()

...addicted to flash games
Goddes
Posts: 15
Joined: 25 Jan 2014, 21:08

Re: userLost problem

Postby Goddes » 23 Jan 2016, 13:46

I already have that, I kinda used avatarChat example so I don't know whats causing the problem
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: userLost problem

Postby Lapo » 25 Jan 2016, 08:49

The data I have is not sufficient for to understand what might be wrong.
I can suggest to review your disconnection handler, make sure your remove all previous event listeners from the current SmartFoxClient instance.
When it's time to connect again you will recreate the aforementioned object and re-attach new instances of the event listeners you need.

If this doesn't solve the problem we will need a way to reproduce the problem.
If you have a stripped down version of your code that shows the issue discussed here, you can zip it and send it to us. We will take a look.

Email to support@... with a reference to this discussion.

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
Goddes
Posts: 15
Joined: 25 Jan 2014, 21:08

Re: userLost problem

Postby Goddes » 30 Jan 2016, 15:43

Is it fine If i send the game source, you set it up and take a look yourself
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: userLost problem

Postby Lapo » 01 Feb 2016, 10:04

Only if it is a stripped down version with the minimal code to reproduce the problem.
Please do not send a full project containing assets and big amount of code. We need a repro case.

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 32 guests