Problem with duplicate users

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

mizerakl
Posts: 4
Joined: 19 May 2017, 07:06

Problem with duplicate users

Postby mizerakl » 19 May 2017, 07:38

Hello.

I'm using Smartfoxserver v 2.13. I tested the reconnection to the server with the client android via switching the connection. After several such connections, several users with the same name appears on the server(in admin tool). This is strange, because it is specified in the LoginEventHandler to disable the user with a duplicate name.

Code: Select all

User user = getApi().getUserByName(userName);
if (user != null){
    getApi().disconnect(user.getSession());
}


HRC+ reconnection disabled. In the server logs i can see creating sessions after all logins, but not always closing. Some sessions will close later after idle timeout. I tried disconnect(), disconnectUser(), logout(), no one always works.

Maybe a problem in different ip addresses of one user...

In the admin tool i saw up to 5 different users with the same name. All of them have same name, session and other information. I can attach log files if you need it.

Thank you in advance.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Problem with duplicate users

Postby Lapo » 19 May 2017, 14:03

Hi,
I think the problem is that you call the disconnect and then immediately after you proceed logging in a new user with the same name.
Unfortunately the disconnection may take a long time to complete.

Instead of doing this manually why don't you turn on the "force logout" option in your Zone. It should take care of all issues for you.

Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 58 guests