User already logged in. Disconnecting previous instance

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

Moderators: Lapo, Bax

Mrm83
Posts: 155
Joined: 17 Dec 2017, 04:02

User already logged in. Disconnecting previous instance

Postby Mrm83 » 04 Sep 2020, 14:59

04 Sep 2020 | 10:01:18,978 | INFO | SFSWorker:Ext:1 | v2.api.SFSApi | | User login: { Zone: SG2.0 }, ( User Name: 26784, Id: 8363, Priv: 0, Sess: 17.232.10.35:62444 ) , Type: Unity / .Net
04 Sep 2020 | 10:01:30,811 | INFO | SFSWorker:Ext:3 | v2.scala.DefLI | | User already logged in. Disconnecting previous instance : ( User Name: 26784, Id: 8363, Priv: 0, Sess: 17.232.10.35:62444 )
04 Sep 2020 | 10:01:30,812 | INFO | SFSWorker:Ext:3 | v2.api.SFSApi | | User disconnected: { Zone: SG2.0 }, ( User Name: 26784, Id: 8363, Priv: 0, Sess: 17.232.10.35:62444 ) , SessionLen: 11834, Type: Unity / .Net
04 Sep 2020 | 10:01:32,812 | INFO | pool-1-thread-1 | v2.api.SFSApi | | User login: { Zone: SG2.0 }, ( User Name: 26784, Id: 8364, Priv: 0, Sess: 17.232.10.35:62445 ) , Type: Unity / .Net
04 Sep 2020 | 10:02:14,029 | INFO | SFSWorker:Ext:2 | v2.scala.DefLI | | User already logged in. Disconnecting previous instance : ( User Name: 26784, Id: 8364, Priv: 0, Sess: 17.232.10.35:62445 )
04 Sep 2020 | 10:02:14,029 | INFO | SFSWorker:Ext:2 | v2.api.SFSApi | | User disconnected: { Zone: SG2.0 }, ( User Name: 26784, Id: 8364, Priv: 0, Sess: 17.232.10.35:62445 ) , SessionLen: 41217, Type: Unity / .Net
04 Sep 2020 | 10:02:16,030 | INFO | pool-1-thread-3 | v2.api.SFSApi | | User login: { Zone: SG2.0 }, ( User Name: 26784, Id: 8368, Priv: 0, Sess: 17.232.10.35:62446 ) , Type: Unity / .Net
04 Sep 2020 | 10:03:09,766 | INFO | SFSWorker:Ext:3 | v2.scala.DefLI | | User already logged in. Disconnecting previous instance : ( User Name: 26784, Id: 8368, Priv: 0, Sess: 17.232.10.35:62446 )
04 Sep 2020 | 10:03:09,766 | INFO | SFSWorker:Ext:3 | v2.api.SFSApi | | User disconnected: { Zone: SG2.0 }, ( User Name: 26784, Id: 8368, Priv: 0, Sess: 17.232.10.35:62446 ) , SessionLen: 53736, Type: Unity / .Net
04 Sep 2020 | 10:03:11,767 | INFO | pool-1-thread-1 | v2.api.SFSApi | | User login: { Zone: SG2.0 }, ( User Name: 26784, Id: 8376, Priv: 0, Sess: 17.232.10.35:62447 ) , Type: Unity / .Net
04 Sep 2020 | 10:04:01,045 | INFO | SFSWorker:Sys:2 | v2.api.SFSApi | | User disconnected: { Zone: SG2.0 }, ( User Name: 26784, Id: 8376, Priv: 0, Sess: 17.232.10.35:62447 ) , SessionLen: 49278, Type: Unity / .Net

Not sure why this is happening. The user is a NEW user, but it says user is already log in and boots him off? Is this a bug with v2.15?
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: User already logged in. Disconnecting previous instance

Postby Lapo » 05 Sep 2020, 10:18

Hi,
the client port numbers are all different so the User is actually opening multiple connections a trying to login multiple times. Because your Zone is configured with the "Force Logout" option, the previous session is removed and the new one is allowed to log in.

It's not a bug.
Cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
Mrm83
Posts: 155
Joined: 17 Dec 2017, 04:02

Re: User already logged in. Disconnecting previous instance

Postby Mrm83 » 07 Sep 2020, 15:44

Ok this is a problem then.

The game is getting rejected by Apple because Apple can not login.

The only log I have with apple trying to connect to the server are those.

I can't reproduce what they are doing. Have tested IPv6 connection already and it isn't that.
What else could be wrong?

I noticed that apple's connection have 2 of the following:
07 Sep 2020 | 11:16:31,629 | WARN | SFSWorker:Sys:3 | v2.protocol.SFSIoHandler | | Client already UDP inited: { Id: 20533, Type: DEFAULT, Logged: Yes, IP: 17.232.6.107:52195 }
07 Sep 2020 | 11:16:34,632 | WARN | SFSWorker:Sys:2 | v2.protocol.SFSIoHandler | | Client already UDP inited: { Id: 20533, Type: DEFAULT, Logged: Yes, IP: 17.232.6.107:52195 }

I also checked our logs, it seems other users's connection that have those 2 lines after connecting are also having connection issues.
Last edited by Mrm83 on 07 Sep 2020, 16:08, edited 1 time in total.
Mrm83
Posts: 155
Joined: 17 Dec 2017, 04:02

Re: User already logged in. Disconnecting previous instance

Postby Mrm83 » 07 Sep 2020, 15:52

This is all the smartfox log from Apple IP today..

07 Sep 2020 | 11:16:28,283 | INFO | SocketReader | bitswarm.sessions.DefaultSessionManager | | Session created: { Id: 20533, Type: DEFAULT, Logged: No, IP: 17.232.6.107:52195 } on Server port: 9933 <---> 52195
07 Sep 2020 | 11:16:28,474 | INFO | SFSWorker:Ext:2 | v2.api.SFSApi | | User login: { Zone: SG2.0 }, ( User Name: 28253, Id: 20325, Priv: 0, Sess: 17.232.6.107:52195 ) , Type: Unity / .Net
07 Sep 2020 | 11:16:31,629 | WARN | SFSWorker:Sys:3 | v2.protocol.SFSIoHandler | | Client already UDP inited: { Id: 20533, Type: DEFAULT, Logged: Yes, IP: 17.232.6.107:52195 }
07 Sep 2020 | 11:16:34,632 | WARN | SFSWorker:Sys:2 | v2.protocol.SFSIoHandler | | Client already UDP inited: { Id: 20533, Type: DEFAULT, Logged: Yes, IP: 17.232.6.107:52195 }
07 Sep 2020 | 11:17:39,975 | INFO | SocketReader | bitswarm.sessions.DefaultSessionManager | | Session created: { Id: 20541, Type: DEFAULT, Logged: No, IP: 17.232.6.107:52196 } on Server port: 9933 <---> 52196
07 Sep 2020 | 11:17:40,170 | INFO | SFSWorker:Ext:3 | v2.scala.DefLI | | User already logged in. Disconnecting previous instance : ( User Name: 28253, Id: 20325, Priv: 0, Sess: 17.232.6.107:52195 )
07 Sep 2020 | 11:17:40,170 | INFO | SFSWorker:Ext:3 | bitswarm.sessions.DefaultSessionManager | | Session removed: { Id: 20533, Type: DEFAULT, Logged: Yes, IP: 17.232.6.107:52195 }
07 Sep 2020 | 11:17:40,170 | INFO | SFSWorker:Ext:3 | v2.api.SFSApi | | User disconnected: { Zone: SG2.0 }, ( User Name: 28253, Id: 20325, Priv: 0, Sess: 17.232.6.107:52195 ) , SessionLen: 71696, Type: Unity / .Net
07 Sep 2020 | 11:17:42,171 | INFO | pool-1-thread-2 | v2.api.SFSApi | | User login: { Zone: SG2.0 }, ( User Name: 28253, Id: 20334, Priv: 0, Sess: 17.232.6.107:52196 ) , Type: Unity / .Net
07 Sep 2020 | 11:17:45,405 | WARN | SFSWorker:Sys:3 | v2.protocol.SFSIoHandler | | Client already UDP inited: { Id: 20541, Type: DEFAULT, Logged: Yes, IP: 17.232.6.107:52196 }
07 Sep 2020 | 11:17:48,405 | WARN | SFSWorker:Sys:3 | v2.protocol.SFSIoHandler | | Client already UDP inited: { Id: 20541, Type: DEFAULT, Logged: Yes, IP: 17.232.6.107:52196 }
07 Sep 2020 | 11:21:07,405 | INFO | SocketReader | bitswarm.sessions.DefaultSessionManager | | Session removed: { Id: 20541, Type: DEFAULT, Logged: Yes, IP: 17.232.6.107:52196 }
07 Sep 2020 | 11:21:07,406 | INFO | SFSWorker:Sys:1 | v2.api.SFSApi | | User disconnected: { Zone: SG2.0 }, ( User Name: 28253, Id: 20334, Priv: 0, Sess: 17.232.6.107:52196 ) , SessionLen: 205235, Type: Unity / .Net
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: User already logged in. Disconnecting previous instance

Postby Lapo » 08 Sep 2020, 08:57

Mrm83 wrote:Ok this is a problem then.

Why is it a problem exactly?
Also you can configure that option to "off" and a client who attempts a second login with the same credentials will be rejected.

The game is getting rejected by Apple because Apple can not login.

This sounds like an entirely different issue, though.

The only log I have with apple trying to connect to the server are those.

Are you actually sure that's their login, have you verified it with them?

In any case the logs you have sent don't show an inability to connect. In fact you can see that a Session is created, so they are actually connected, and then they login, so they are actually accessing the game Zone. So from the logs perspective there is nothing wrong.

In those logs you can see that they logged in once and about a minute later they tried to login again with the same credentials, while the previous user was still logged in. The server then kicked the first user and let them in again, which was successful. Finally they disconnected 4 minutes later.

Did they report exactly what problem they are having with your game client?

As regards the double "UDP inited" message, it sounds like an issue with client logic where the client is requesting the "UDP Init" multiple times. In any case this is unlikely to create issues on both client or server side, though I'd recommend to double check the flow of the client logic.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
Mrm83
Posts: 155
Joined: 17 Dec 2017, 04:02

Re: User already logged in. Disconnecting previous instance

Postby Mrm83 » 08 Sep 2020, 13:40

Yes, it is their login 100%.

The logic is fine, the client has been in production for half a year on Android with active users.

They just say the game won't connect with wifi. We don't know what exactly the problem or error is as we can't reproduce it at all. We can only speculate and guess what the problem is as Apple doesn't give details to ANYTHING. I am 90% sure this is a UDP issue. Will be taking out UDP entirely and submit again and see if they can connect.

The UDP logic is like this:
on login to server callback, client will connect to UDP.
on connected to UDP callback, the client will login to lobby.

They obviously isnt going to the lobby because they are thrown back to the main screen screen.


Client will only init UDP from OnLogin server callback. So if our client is doing it multiple times, then that means the server is sending the callback multiple times?
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: User already logged in. Disconnecting previous instance

Postby Lapo » 08 Sep 2020, 15:26

The InitUDP call will return a success/failure boolean. Don't you report this to the User?
In other words, if the client fails to initialize the UDP channel, don't you give an error with some details to the client? If so the folks at Apple could report back what error they got and you could better understand what's going on.

The "Client already UDP inited" error is only generated when a User has already successfully initialized the UDP protocol so this suggests that UDP is not an issue.

The UDP logic is like this:
on login to server callback, client will connect to UDP.
on connected to UDP callback, the client will login to lobby.

Sorry, this isn't very clear...
You say that you call the InitUDP when you receive the login callback. But then you say that on UDP callback you login into the Lobby?
Are you saying that you log in one Zone, init the UDP, and then logout from that Zone and login in a different one?
If so, why?

So if our client is doing it multiple times, then that means the server is sending the callback multiple times?

Well, no. The client UI should not allow the User to send more than one login request.
In other words if you're waiting the login response or you're already logged in, there should be no way in the user interface to re-send the LoginRequest.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
Mrm83
Posts: 155
Joined: 17 Dec 2017, 04:02

Re: User already logged in. Disconnecting previous instance

Postby Mrm83 » 08 Sep 2020, 16:15

Lapo wrote:The InitUDP call will return a success/failure boolean. Don't you report this to the User?
In other words, if the client fails to initialize the UDP channel, don't you give an error with some details to the client? If so the folks at Apple could report back what error they got and you could better understand what's going on.

No, we do not report UDP errors. This has never been an issue.


The UDP logic is like this:
on login to server callback, client will connect to UDP.
on connected to UDP callback, the client will login to lobby.
Sorry, this isn't very clear...
You say that you call the InitUDP when you receive the login callback. But then you say that on UDP callback you login into the Lobby?
Are you saying that you log in one Zone, init the UDP, and then logout from that Zone and login in a different one?
If so, why?

Sorry, should use SFS terms.
On connected to zone, client will connect to UDP.
On connected to UDP, client will login to room.

So if our client is doing it multiple times, then that means the server is sending the callback multiple times?
Well, no. The client UI should not allow the User to send more than one login request.
In other words if you're waiting the login response or you're already logged in, there should be no way in the user interface to re-send the LoginRequest.

No, as you saw from the logs, only 1 session was created but 2 udp inits followed. So that meant apple only requested login once. The server have logs for zone login request and we only saw 1 per 2 udp.
Mrm83
Posts: 155
Joined: 17 Dec 2017, 04:02

Re: User already logged in. Disconnecting previous instance

Postby Mrm83 » 08 Sep 2020, 22:54

Our client no longer init UDP, but the following is still shown with apple reviews:
Client already UDP inited (2 times)

Why is UDP still being initialized? Is there a server setting that forces client to init UDP?
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: User already logged in. Disconnecting previous instance

Postby Lapo » 09 Sep 2020, 07:45

No there is no such thing.
It can only mean that they are still using the old version.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
Mrm83
Posts: 155
Joined: 17 Dec 2017, 04:02

Re: User already logged in. Disconnecting previous instance

Postby Mrm83 » 09 Sep 2020, 15:49

Ok, so it is confirmed it is an UDP issue, but not a SFS UDP issue.

Apple reviewers are blocking UDP connections.
https://www.reddit.com/r/iOSProgramming ... ewers_vpn/
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: User already logged in. Disconnecting previous instance

Postby Lapo » 09 Sep 2020, 16:53

Thanks for the update.
Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Alexwek and 116 guests