Multiple Login Same Account Bug SFS2X Patch 2.12.4

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

Moderators: Lapo, Bax

msaygi
Posts: 11
Joined: 06 Jan 2017, 09:21

Multiple Login Same Account Bug SFS2X Patch 2.12.4

Postby msaygi » 11 Apr 2017, 09:13

Hello There,

We had a code block on our user login struuctre. This block checks users list with user's unique name and if user logged in more than one device, code sends forcelogout message to user and users' firstly logged in device logs out.

On Friday we upgraded our SmartfoxServer 2.12.0 to 2.12.4, after this upgrade this code block started to giving response very lately. User logs in more than one device in game, after two or three minutes users' firstly logged in device logs out. This is problem. Then, we downgraded to SmartfoxServer 2.12.0. Everything is normal. Can we check this problem again? What is the solution about it?

Thanks in advance.
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Multiple Login Same Account Bug SFS2X Patch 2.12.4

Postby meanvel » 11 Apr 2017, 11:21

Having same problem...

Custom login... After upgrading from 2.12.3>2.12.4... When I open two game clients with the same user login, one after the other, the first client isn't immediately logged out with a disconnect message anymore, so my logs get spammed with these from the first clients requests still coming in...

"Exception: com.smartfoxserver.v2.exceptions.SFSRuntimeException
Message: System Request rejected: { Id: 6, Type: DEFAULT, Logged: No, IP: 127.0.0.1:50533 }, Client is not logged in.
Description: Runtime error while processing request"
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Multiple Login Same Account Bug SFS2X Patch 2.12.4

Postby Lapo » 11 Apr 2017, 15:30

From the server side I see that clients are disconnected immediately, no lag. This is locally of course.
Over the internet things will not necessarily happen instantaneously, depending on the conditions of the network.

Anyway, we'll run a few more tests and report back.
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Multiple Login Same Account Bug SFS2X Patch 2.12.4

Postby meanvel » 12 Apr 2017, 01:33

Lapo wrote:From the server side I see that clients are disconnected immediately, no lag. This is locally of course.
Over the internet things will not necessarily happen instantaneously, depending on the conditions of the network.

Anyway, we'll run a few more tests and report back.


I am testing locally. Server side is fine, it's just that the old clients with the same username still think they are connected now... They are not receiving any disconnect message for around thirty seconds to a minute or so.

The previous behavior was that when you logged in with a username that was currently active, the older client with the same username would be immediately disconnected.

This is still set for all my zones... "<isForceLogout>true</isForceLogout>"

Update: I tried adding this to my loginHandler as a workaround...
Older user is disconnected, but the old client still doesn't receive any notification of disconnect and cannot tell its disconnected. Meh... Maybe I should revert back to 2.12.3 to verify that it appeared in 2.12.4.

Code: Select all

                    //Disconnect old client if exists
                    User oldUser = getApi().getUserByName(sfsName);
                    if (oldUser != null) {
                        trace(ExtensionLogLevel.ERROR, "ERROR: Disconnect old user");
                        getApi().disconnectUser(oldUser);
                    }
Last edited by meanvel on 12 Apr 2017, 05:10, edited 2 times in total.
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Multiple Login Same Account Bug SFS2X Patch 2.12.4

Postby meanvel » 12 Apr 2017, 02:13

Update:
Fresh install of SFS2X 2.12...
Patched > Tested version 2.12.2 > No issues.
Patched > Tested version 2.12.3 > No issues.
Patched > Tested version 2.12.4 > Yep... Problem appears in this version...

msaygi, you should be able to update to 2.12.3 without issues for now.
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Multiple Login Same Account Bug SFS2X Patch 2.12.4

Postby meanvel » 12 Apr 2017, 09:14

Working workaround for version 2.12.4. Included this *AFTER* the password verification within my custom login handler class.

Code: Select all

                    //Kick prior client on double login
                    User oldUser = getApi().getUserByName(userNameString);
                    if (oldUser != null) {
                        trace(ExtensionLogLevel.WARN, "Double login attempt");
                        getApi().kickUser(oldUser,null,"Double Login",0);
                    }


If it were placed before password verification, anyone could just enter in anyones name and kick them offline...
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Multiple Login Same Account Bug SFS2X Patch 2.12.4

Postby Lapo » 13 Apr 2017, 09:52

Update: We have a pre-release patch that addresses this issue. You can download it here

Let us know.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Multiple Login Same Account Bug SFS2X Patch 2.12.4

Postby meanvel » 13 Apr 2017, 11:07

Lapo wrote:Update: We have a pre-release patch that addresses this issue. You can download it here

Let us know.


That patch fixed the problem. Thanks!
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Multiple Login Same Account Bug SFS2X Patch 2.12.4

Postby Lapo » 13 Apr 2017, 14:46

Thanks for the feedback.
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Stevenor and 86 guests