SFS Room userCount function return not correct.

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

Moderators: Lapo, Bax

vinhbt
Posts: 5
Joined: 01 Sep 2017, 14:55

SFS Room userCount function return not correct.

Postby vinhbt » 01 Sep 2017, 16:44

Hi,
I have issues when update server to v2.13 and use javascript client v1.7.6
1. client user leave room 1. ( call LeaveRoomRequest)
2. At SFSEvent.USER_EXIT_ROOM event call SubscribeRoomGroupRequest to Subscribe to room 2.
3. Client receive event SFSEvent.ROOM_GROUP_SUBSCRIBE with evtParams.newRooms.
with each room of evtParams.newRooms call room.userCount it return 1 expected return is 0.
ex. In 2.12.x room.userCount is return 0 with scenario.
User avatar
Lapo
Site Admin
Posts: 21065
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: SFS Room userCount function return not correct.

Postby Lapo » 04 Sep 2017, 08:14

Hi,
are you sure the user count in those Rooms is really 1.

You can double check via the AdminTool > ZoneMonitor and inspect the Room Group that you have subscribed.

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
vinhbt
Posts: 5
Joined: 01 Sep 2017, 14:55

Re: SFS Room userCount function return not correct.

Postby vinhbt » 05 Sep 2017, 02:18

Hi Lapo

I have checked the problem via AdminTool. It's show correct in AdminTool.
But in html5 code it's not ok, user count in those Rooms is 1.

Thanks.
User avatar
Bax
Site Admin
Posts: 4479
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: SFS Room userCount function return not correct.

Postby Bax » 05 Sep 2017, 08:12

We can't reproduce this issue.
We tested a modified version of the current AdvancedChat example, in which we added support to Room Groups (we can send it to you too, if you drop us an email).
These are the steps:
1) we configured the BasicExamples Zone with 3 public Groups ("default", "games" and "chats") and 1 default Group ("default")
2) using the AdminTool's Zone Monitor module we created two new Rooms in the "chats" Group of the Basic Examples Zone; "The Lobby" Room already existed in the Zone configuration
3) we started the client and connected, logged in and joined "The Lobby" Room
4) we left the Room by sending the LeaveRoomRequest
5) using the browser's console, we subscribed the "chats" Group, like this:

Code: Select all

sfs.send(new SFS2X.SubscribeRoomGroupRequest("chats"))

6) in the ROOM_GROUP_SUBSCRIBE event listener, we printed the newRooms array returned by the event: inspecting its values it shows that the userCount property is 0 for both Rooms in the Group

Maybe something else is going on, or you missed some details of your test.
Could you please compare our test against the behavior of your app?
Paolo Bax
The SmartFoxServer Team

Return to “SFS2X Questions”

Who is online

Users browsing this forum: DavinVicy, DerikFent, JerodSa and 12 guests