userLost problem

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

Moderators: Lapo, Bax

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

userLost problem

Post by Goddes »

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: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: userLost problem

Post by Lapo »

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

Post by Goddes »

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

Re: userLost problem

Post by Lapo »

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

Post by Goddes »

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: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: userLost problem

Post by Lapo »

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

Post by Goddes »

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: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: userLost problem

Post by Lapo »

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

Post by Goddes »

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

Re: userLost problem

Post by Lapo »

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

Post by Goddes »

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

Re: userLost problem

Post by Lapo »

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
Post Reply