How to detect login from another device?

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

Moderators: Lapo, Bax

User avatar
tavandung12
Posts: 20
Joined: 19 May 2016, 01:19
Location: Ha Noi
Contact:

How to detect login from another device?

Postby tavandung12 » 05 Jan 2017, 16:26

Hi,
I have an account and two devices (A, B)
The account logged on device A, but now I login the account on device B
and I need show a message on device A: "the account be logged in from another device".
So, How to detect login from another device to show that message?
tvd12
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to detect login from another device?

Postby Lapo » 06 Jan 2017, 11:16

Hi,
sorry this is not possible. When a user with the same account logs in the other connection is shut down immediately.

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
Hassan Khallouf
Posts: 41
Joined: 06 Jul 2017, 04:35

Re: How to detect login from another device?

Postby Hassan Khallouf » 02 Oct 2022, 11:37

Is there a way to know the reason for this disconnection ?
we have a state where the previous device will disconnect and attempt to reconnect, resulting to kick the new device and making it try to reconnect again, they will both be stuck in a loop of connections/disconnections

is there way to tell the disconnect client you were disconnected because you logged in from somewhere else ?
currently SFS sends {"reason":"unknown"}

it would be really helpful if it sent a proper reason
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: How to detect login from another device?

Postby Lapo » 30 Mar 2023, 08:06

Hi,
Is there a way to know the reason for this disconnection ?

In most cases I would say no, but there is a small percentage of cases in which you can and we support the.
Typically you will be able to recognize a "Manual disconnection" because it was initiated by the client or an "Idle Disconnection" because it was caused by the server itself (when a client doesn't send any request for an X amount of time).

Unfortunately most of the other disconnections that affect online gaming are due to a host of other causes that happens outside of the control of both client and server (i.e. any of the network nodes that packets go through from one end to the other)

Noth the client and Server DISCONNECT event provide a "reason" parameter that will tell you which of the possible causes was decteted, where "UNKNOW" is the situation described above.

we have a state where the previous device will disconnect and attempt to reconnect, resulting to kick the new device and making it try to reconnect again, they will both be stuck in a loop of connections/disconnections

I am not sure how this is possible. At least not with HRC.
If you activate the Zone's forceLogout to allow the same User login from multiple devices and the HRC, the second login will kick the first one but the former won't try to reconnect.

Can you describe exactly how the loop is created? And are you using a custom logic for reconnection?

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Stevenor and 42 guests