SFSRoomManager not work

Post here your questions about the Flash / Flex / Air API for SFS2X

Moderators: Lapo, Bax

Post Reply
Oleg_79
Posts: 161
Joined: 25 Feb 2011, 10:31
Location: Ukraine, Donetsk

SFSRoomManager not work

Post by Oleg_79 »

var sfs:SmartFox = new SmartFox();

var ff:SFSRoomManager = new SFSRoomManager(sfs);

trace(ff.getRoomList());


1. Connect
2. Login
3. User is not in the room

Always comes to 0.
How to deal with this class? :(
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Post by rjgtav »

Hi. If you create a new instance of the SFSRoomManager class, of course it will be empty, and will never be used by the SmartFox class.

The SFSRoomManager that is being used by the SmartFox class is its roomManager property.
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.
Oleg_79
Posts: 161
Joined: 25 Feb 2011, 10:31
Location: Ukraine, Donetsk

Post by Oleg_79 »

I need to get a list of all rooms in the zone. User in zone, but not in the room.
sfs.roomManger.getRoomList() - shows the room in which the user is. this does not suit
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Post by rjgtav »

Please make sure that you are subscribed to the room group where those rooms are. You should get the whole list of rooms that are in that group.
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.
Oleg_79
Posts: 161
Joined: 25 Feb 2011, 10:31
Location: Ukraine, Donetsk

Post by Oleg_79 »

sfs.roomManager.getRoomList() - length 0, but in zone 10 rooms
sfs.roomManager.getRoomListFromGroup("GroupName") - length 0.
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Post by rjgtav »

But are you subscribed to that group? you need to subscribe to it in order to receive it's room list.
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.
jamalsoueidan
Posts: 153
Joined: 15 Aug 2011, 16:33

Post by jamalsoueidan »

How do you create the rooms?

Maybe you are using the wrong server-side methods to create rooms, and that's why your client doesn't get updated :)
---------------------------------------------------
Jamal Soueidan
http://linkedin.com/in/jamalsoueidan
Oleg_79
Posts: 161
Joined: 25 Feb 2011, 10:31
Location: Ukraine, Donetsk

Post by Oleg_79 »

Create in smartfox with admintools
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

But.. did you restart SmartFoxServer after creating the Rooms?
Paolo Bax
The SmartFoxServer Team
Oleg_79
Posts: 161
Joined: 25 Feb 2011, 10:31
Location: Ukraine, Donetsk

Post by Oleg_79 »

bax wrote:But.. did you restart SmartFoxServer after creating the Rooms?
Yes.

Maybe I'm doing something wrong? I need to get a list of zone in which the room sits a given user (which is the type of search by nick). Could you suggest how to do it?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

On the client side you can't know the rooms joined by all the users. You can just know the rooms joined by the user corresponding to the current client.
In order to do this use the SmartFox.roomManager.getJoinedRooms property.
Paolo Bax
The SmartFoxServer Team
Post Reply