SFSEvent.USER_COUNT_CHANGE is not firing

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

Moderators: Lapo, Bax

User avatar
levancho
Posts: 71
Joined: 27 Jun 2011, 16:03

SFSEvent.USER_COUNT_CHANGE is not firing

Postby levancho » 24 Aug 2011, 07:28

Hi,

I am trying to figure out why SFSEvent.USER_COUNT_CHANGE is not firing when I join the room from Serverside, I have not tried to rewrite the code to join the room from client side yet but its definately not working when I join the room from server side.

I have Lobby room (non game type room) that has all permissions and events selected, and what I do is as soon as user joins the zone, I am manually joining that user into the zone from Server side.

Code: Select all

getApi().joinRoom(theUser, lobby);


in admin under room monitor it shows correct number of users joineed.

but I am not getting SFSEvent.USER_COUNT_CHANGE on the client side
the only event I am getting is USER_JOIN and USER_ENTER events.


I tried with two clients (both local but different usernames ) I am not sure if that is related .

do I have to join the room from client side for USER_COUNT_CHANGE that event to fire? if so
what other option do I have to know whenever user count changes?


I am using SF2 RC3.

any suggestion would be appreciated.
Kind Regards
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Postby rjgtav » 24 Aug 2011, 07:41

Hi. If I remember correctly, the USER_COUNT_CHANGE event is only fired at the room-level, so you need a room-level extension to listen to that event.

Yes, confirmed, and thats why this event is inside the SFSRoomEvents class.
Last edited by rjgtav on 24 Aug 2011, 07:44, edited 1 time in total.
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
User avatar
levancho
Posts: 71
Joined: 27 Jun 2011, 16:03

Postby levancho » 24 Aug 2011, 07:44

[Solved] might be a bug.

apparently problem is with group subscriptions vs joined room here is what happened.

I modified (under zone config) default groups list and removed group that lobby belonged to from that list, now even if I joined lobby group I was no longer receiving USER_COUNT_CHANGE events for lobby
should not client have still received USER_COUNT_CHANGE because It was in that room ?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Postby rjgtav » 24 Aug 2011, 07:47

Oh, i see, sorry i thought you were talking about the server-side USER_COUNT_CHANGE event. In the client-side, yes you need to subscribe to the room group where the room you want to listen to is.

Hum... I don't know if thats a bug or if was intended to work like that. In SFS2x, for better control of the events, you need to register to the correct room groups
Skills: SFS Pro, SFS2X, AS2.0/AS3.0, Java, HTML5/CSS3/JS, C#
Portfolio: https://rjgtav.wordpress.com/
SFS Tutorials: http://sfs-tutor.blogspot.com/ - Discontinued. Some examples may be bugged.
User avatar
levancho
Posts: 71
Joined: 27 Jun 2011, 16:03

Re: SFSEvent.USER_COUNT_CHANGE is not firing

Postby levancho » 16 Nov 2012, 20:12

bringing back this issue

basically: here is whats happening.

I have joined lobby room,
then I joined room1
and after room1 I have subscribed to ouser count change event, but I am not receving events actually i am not receving any events for that room1
I am listening to
spectator to player
player to spectator
and user count
non of them arrive even if I am in that room current, so my question is
do I need to explicitly subscribe for the group that room1 belongs to, in order to receive its events, even if I am inside that room?

it kind of says in documentation that if you are in the room you will receive its events without subscribing to the group it belongs to,
any ideas why its happening?

here is the quiote from docs:
The User could even avoid to subscribe to any Group at all and still be able to join any Room in the Zone, although he won't receive any updates from Rooms that are not joined.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 4 guests