Post here your questions about the Flash / Flex / Air API for SFS2X
Moderators: Lapo , Bax
Oleg_79
Posts: 161 Joined: 25 Feb 2011, 10:31
Location: Ukraine, Donetsk
Post
by Oleg_79 » 04 Sep 2011, 10:54
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?
rjgtav
Posts: 2813 Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal
Post
by rjgtav » 04 Sep 2011, 10:58
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.
Oleg_79
Posts: 161 Joined: 25 Feb 2011, 10:31
Location: Ukraine, Donetsk
Post
by Oleg_79 » 04 Sep 2011, 11:04
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
rjgtav
Posts: 2813 Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal
Post
by rjgtav » 04 Sep 2011, 12:24
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.
Oleg_79
Posts: 161 Joined: 25 Feb 2011, 10:31
Location: Ukraine, Donetsk
Post
by Oleg_79 » 04 Sep 2011, 12:33
sfs.roomManager.getRoomList() - length 0, but in zone 10 rooms
sfs.roomManager.getRoomListFromGroup("GroupName") - length 0.
rjgtav
Posts: 2813 Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal
Post
by rjgtav » 04 Sep 2011, 12:34
But are you subscribed to that group? you need to subscribe to it in order to receive it's room list.
jamalsoueidan
Posts: 153 Joined: 15 Aug 2011, 16:33
Post
by jamalsoueidan » 04 Sep 2011, 14:19
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
Oleg_79
Posts: 161 Joined: 25 Feb 2011, 10:31
Location: Ukraine, Donetsk
Post
by Oleg_79 » 06 Sep 2011, 16:59
Create in smartfox with admintools
Bax
Site Admin
Posts: 4626 Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:
Post
by Bax » 07 Sep 2011, 05:41
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 » 07 Sep 2011, 10:48
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?
Bax
Site Admin
Posts: 4626 Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:
Post
by Bax » 08 Sep 2011, 06:15
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