Buddy isOnline() always returns true

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

Moderators: Lapo, Bax

ersindemir
Posts: 30
Joined: 30 Apr 2016, 07:23
Location: Turkey

Buddy isOnline() always returns true

Postby ersindemir » 14 Jan 2018, 14:03

Buddy isOnline() always returns true in backend side. No problem on Client side.
I found this solution : viewtopic.php?f=18&t=16686&p=71953&hilit=isOnline#p71953

Code: Select all

boolean isOnline = getZone().getUserByName(buddy.getName());


but is it fixed any 2.12.0+ version ?

Smartfox Backend Version : 2.12.0
Smartfox Unity Client Version : 1.7.2
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Buddy isOnline() always returns true

Postby Lapo » 15 Jan 2018, 09:14

Hi,
the ONLINE state of a buddy does not tell you if the user is logged in the system or not.
So, if you need to know if User A is logged in the system you should check using the code you've posted (getUserByName...);

This is because a User can be logged in the system but have his "Online" buddy state turned off. In this case he will not show up as "online" to his buddies.

Makes sense?
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 53 guests