Login Error Duplicate Name

Post here your questions about the Java client / Android API for SFS2X

Moderators: Lapo, Bax

Sreelu
Posts: 22
Joined: 03 Oct 2016, 08:02

Login Error Duplicate Name

Postby Sreelu » 24 Mar 2017, 12:45

I have to get User object for 6 players, and for that I need to do Login first.
So, I had done the below code which gave me login errors:

ISession session = SmartFoxServer.getInstance().getSessionManager().getAllLocalSessions().get(0);
SmartFoxServer.getInstance().getAPIManager().getSFSApi().login(session, ""+playerid, "", "MyRoom", data, true);

It says Duplicate Name, even though Iam sending all different playerids..Please let me know how to make n number of logins from server side itself!!

Stacktrace:

24 Mar 2017 | 18:12:02,909 | INFO | SFSWorker:Sys:1 | smartfoxserver.v2.SmartFoxServer | | SmartFoxServer 2X (2.9.0) READY!
24 Mar 2017 | 18:12:06,122 | INFO | main | bluebox.v3.SessionFilter | | BlueBox-2X Service (3.0.0) ready.
24 Mar 2017 | 18:12:10,677 | INFO | SocketReader | bitswarm.sessions.DefaultSessionManager | | Session created: { Id: 1, Type: DEFAULT, Logged: No, IP: 205.147.97.92:45692 } on Server port: 9933 <---> 45692
24 Mar 2017 | 18:12:10,728 | INFO | SFSWorker:Sys:4 | v2.api.SFSApi | | User login: { Zone: MyRoom}, ( User Name: OperationsIntelligence, Id: 0, Priv: 0, Sess: 205.147.97.92:45692 ) , Type: UnityPlayer::

24 Mar 2017 | 18:12:12,118 | INFO | SFSWorker:Ext:4 | Extensions | | {TourneyExtension}: Registering request handlers!!!!!!!!!!!!!!!11
24 Mar 2017 | 18:12:12,118 | INFO | SFSWorker:Ext:4 | entities.managers.SFSRoomManager | | Room created: { Zone: MyRoom}, [ SFSGame: 1stRoom 1, Id: 3, Group: 301, public: true, minPlayers: 0 ]
24 Mar 2017 | 18:12:12,127 | INFO | SFSWorker:Ext:4 | v2.api.SFSApi | | Login error: Duplicate login: ( User Name: 5250, Id: 1, Priv: 0, Sess: 205.147.97.92:45692 ) . Requested by: { Id: 1, Type: DEFAULT, Logged: Yes, IP: 205.147.97.92:45692 }
24 Mar 2017 | 18:12:12,130 | INFO | SFSWorker:Ext:4 | v2.api.SFSApi | | Login error: Duplicate login: ( User Name: 5251, Id: 2, Priv: 0, Sess: 205.147.97.92:45692 ) . Requested by: { Id: 1, Type: DEFAULT, Logged: Yes, IP: 205.147.97.92:45692 }
24 Mar 2017 | 18:12:12,135 | INFO | SFSWorker:Ext:4 | v2.api.SFSApi | | Login error: Duplicate login: ( User Name: 5246, Id: 3, Priv: 0, Sess: 205.147.97.92:45692 ) . Requested by: { Id: 1, Type: DEFAULT, Logged: Yes, IP: 205.147.97.92:45692 }
24 Mar 2017 | 18:12:12,136 | INFO | SFSWorker:Ext:4 | v2.api.SFSApi | | Login error: Duplicate login: ( User Name: 5249, Id: 4, Priv: 0, Sess: 205.147.97.92:45692 ) . Requested by: { Id: 1, Type: DEFAULT, Logged: Yes, IP: 205.147.97.92:45692 }
24 Mar 2017 | 18:12:12,141 | INFO | SFSWorker:Ext:4 | v2.api.SFSApi | | Login error: Duplicate login: ( User Name: 5281, Id: 5, Priv: 0, Sess: 205.147.97.92:45692 ) . Requested by: { Id: 1, Type: DEFAULT, Logged: Yes, IP: 205.147.97.92:45692 }
24 Mar 2017 | 18:12:12,142 | INFO | SFSWorker:Ext:4 | v2.api.SFSApi | | Login error: Duplicate login: ( User Name: 5280, Id: 6, Priv: 0, Sess: 205.147.97.92:45692 ) . Requested by: { Id: 1, Type: DEFAULT, Logged: Yes, IP: 205.147.97.92:45692 }
User avatar
Lapo
Site Admin
Posts: 19988
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Login Error Duplicate Name

Postby Lapo » 24 Mar 2017, 15:30

I am sorry, this is far from clear.
For starters you can't login people from the server side. The client must send a LoginRequest.

The basic flow is
1- Client connects and wait for SFSEvent.CONNECT event which returns a parameter called "success"
2- If success == true you send the LoginRequest and wait for the SFSEvent.LOGIN

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

Return to “SFS2X Java / Android API”

Who is online

Users browsing this forum: No registered users and 1 guest