Question about disconnect 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

Skills07
Posts: 103
Joined: 07 Nov 2016, 14:54
Location: Italy

Question about disconnect users

Postby Skills07 » 25 Apr 2017, 11:07

Hello Lapo and friends

i have a simple question to ask.
I think that users can play game with muliple devices, like cellphones and tablets.
I need to know this:

If i have user Pippo that is playing on his phone, before 5 minutes, without disconnecting on his phone or closing the app, he enters in the app with a tablet.
How can i disconnect Pippo from the phone and the reconnect on the Tablet?

Now if a user is logged in he cannot enter with another device.

Thanks to all for the help
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Question about disconnect users

Postby meanvel » 25 Apr 2017, 11:29

Skills07 wrote:Hello Lapo and friends
If i have user Pippo that is playing on his phone, before 5 minutes, without disconnecting on his phone or closing the app, he enters in the app with a tablet.
How can i disconnect Pippo from the phone and the reconnect on the Tablet?

Now if a user is logged in he cannot enter with another device.

Thanks to all for the help


Just set this setting in your zone extension, it will be handled automatically.
<isForceLogout>true</isForceLogout>

Alternatively, you can goto Admin Tool > Zone Configurator > General > Force logout (Set it right for Active)
Skills07
Posts: 103
Joined: 07 Nov 2016, 14:54
Location: Italy

Re: Question about disconnect users

Postby Skills07 » 25 Apr 2017, 11:42

meanvel wrote:
Skills07 wrote:Hello Lapo and friends
If i have user Pippo that is playing on his phone, before 5 minutes, without disconnecting on his phone or closing the app, he enters in the app with a tablet.
How can i disconnect Pippo from the phone and the reconnect on the Tablet?

Now if a user is logged in he cannot enter with another device.

Thanks to all for the help


Just set this setting in your zone extension, it will be handled automatically.
<isForceLogout>true</isForceLogout>

Alternatively, you can goto Admin Tool > Zone Configurator > General > Force logout (Set it right for Active)



can you send me an example of

Code: Select all

Just set this setting in your zone extension, it will be handled automatically.
  <isForceLogout>true</isForceLogout>


we have to set this on smartfox admin panel??
Skills07
Posts: 103
Joined: 07 Nov 2016, 14:54
Location: Italy

Re: Question about disconnect users

Postby Skills07 » 25 Apr 2017, 11:58

I have activated forcelogout on my zone

but if i try to access with another device i have error on login
User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

Re: Question about disconnect users

Postby meanvel » 25 Apr 2017, 12:25

Skills07 wrote:I have activated forcelogout on my zone

but if i try to access with another device i have error on login


What is the error? Are you using your own Custom login class?
Skills07
Posts: 103
Joined: 07 Nov 2016, 14:54
Location: Italy

Re: Question about disconnect users

Postby Skills07 » 25 Apr 2017, 15:09

meanvel wrote:
Skills07 wrote:I have activated forcelogout on my zone

but if i try to access with another device i have error on login


What is the error? Are you using your own Custom login class?



Yes i use a custom login...
but the problem is that smartfox server consolle print something
about a missing room.

Code: Select all

25 apr 2017 | 13:57:36,669 | DEBUG | SFSWorker:Sys:3 | controllers.v290.SystemReqController |     | {IN}: JoinRoom
25 apr 2017 | 13:57:36,670 | WARN  | SFSWorker:Sys:3 | controllers.system.JoinRoom |     | Client requested non-existent Room with name: provadata1
25 apr 2017 | 13:57:36,670 | DEBUG | SFSWorker:Sys:3 | v2.protocol.SFSProtocolCodec |     | {OUT}: JoinRoom
25 apr 2017 | 13:57:36,670 | DEBUG | SFSWorker:Sys:3 | protocol.binary.BinaryIoHandler |     | Binary size: 34
12 00 03 00 01 70 12 00 02 00 02 65 70 10 00 00    .....p.....ep...
00 02 65 63 03 00 16 00 01 61 03 00 04 00 01 63    ..ec.....a.....c
02 00                                              ..             

25 apr 2017 | 13:57:36,670 | WARN  | SFSWorker:Sys:3 | controllers.v290.SystemReqController |     | com.smartfoxserver.v2.exceptions.SFSJoinRoomException: Join Error - Requested room doesn't exist
   com.smartfoxserver.v2.api.SFSApi.joinRoom(SFSApi.java:990)
   com.smartfoxserver.v2.api.SFSApi.joinRoom(SFSApi.java:808)
   com.smartfoxserver.v2.controllers.system.JoinRoom.execute(JoinRoom.java:87)
   com.smartfoxserver.v2.controllers.v290.SystemReqController.processRequest(SystemReqController.java:172)
   com.smartfoxserver.v2.controllers.v290.SystemReqController.enqueueRequest(SystemReqController.java:127)
   com.smartfoxserver.bitswarm.io.protocols.AbstractProtocolCodec.dispatchRequestToController(AbstractProtocolCodec.java:39)
   com.smartfoxserver.v2.protocol.SFSProtocolCodec.dispatchRequest(SFSProtocolCodec.java:133)
   com.smartfoxserver.v2.protocol.SFSProtocolCodec.onPacketRead(SFSProtocolCodec.java:90)
   com.smartfoxserver.v2.protocol.binary.BinaryIoHandler$1.run(BinaryIoHandler.java:477)
   java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   java.lang.Thread.run(Unknown Source)
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Question about disconnect users

Postby Lapo » 26 Apr 2017, 08:16

The error is very clear about the problem:
Client requested non-existent Room with name: provadata1

That room does not exist.
Lapo
--
gotoAndPlay()
...addicted to flash games
Skills07
Posts: 103
Joined: 07 Nov 2016, 14:54
Location: Italy

Re: Question about disconnect users

Postby Skills07 » 26 Apr 2017, 08:29

Lapo wrote:The error is very clear about the problem:
Client requested non-existent Room with name: provadata1

That room does not exist.



ok i think the problem is when the creator of the room disconnect the room is destroyed.
i can try to fix the settings of the room
Skills07
Posts: 103
Joined: 07 Nov 2016, 14:54
Location: Italy

Re: Question about disconnect users

Postby Skills07 » 26 Apr 2017, 17:53

Lapo wrote:The error is very clear about the problem:
Client requested non-existent Room with name: provadata1

That room does not exist.


Lapo i have done this command

Code: Select all

List<Room> roomname = getParentExtension().getParentZone().getRoomList();


how can i scan this list to see if a room is existing yet??
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Question about disconnect users

Postby Lapo » 26 Apr 2017, 18:12

Usually you don't need to scan a list to see if a Room exists or not.
You can use Zone.getRoomById(...) or Zone.getRoomByName(...) If they return null the Room does not exist.
Lapo

--

gotoAndPlay()

...addicted to flash games
minh_129
Posts: 4
Joined: 17 Feb 2017, 08:45

Re: Question about disconnect users

Postby minh_129 » 27 Apr 2017, 11:39

Hello, i got a question about disconnect user. Example, i'm just login and join InitZone, in SFS2X Administrator Tool, i kick myself but in my games it's not run into OnConnectionLost callback although it exist (other callbacks work well). Im using C++ API ver 1.7.
User avatar
Lapo
Site Admin
Posts: 23009
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Question about disconnect users

Postby Lapo » 27 Apr 2017, 13:30

minh_129 wrote:Hello, i got a question about disconnect user. Example, i'm just login and join InitZone, in SFS2X Administrator Tool, i kick myself but in my games it's not run into OnConnectionLost callback although it exist (other callbacks work well). Im using C++ API ver 1.7.

Sorry but this is off topic. Please start a new thread in the C++ section. You can copy the same message but please also specify exactly which version you're using. 1.7 is not specific enough.
The latest is 1.7.2 but there've also been 1.7.1 and 1.7.0

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 68 guests