Can't get the userlist

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

Moderators: Lapo, Bax

Post Reply
heovespa
Posts: 10
Joined: 23 Mar 2011, 05:30

Can't get the userlist

Post by heovespa »

Code: Select all

var myRoom:Room = m_Smartfox.getRoomById(5);
trace(myRoom.userCount, " - ", myRoom.userList.length); 
 // output: 3 - 0
Anybody know why? :( Certainly i can still get the user list of the room by creating a global room variable to save the current user list. But is there any official api in as3 to do that?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

Please report the server and API version.
Paolo Bax
The SmartFoxServer Team
heovespa
Posts: 10
Joined: 23 Mar 2011, 05:30

Post by heovespa »

bax wrote:Please report the server and API version.
I'm using the SmartFoxServer 2X (2.0.0-RC2a) with corresponding API version (0.9.9).
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

Please upgrade to the latest RC3 version, thank you.
Paolo Bax
The SmartFoxServer Team
heovespa
Posts: 10
Joined: 23 Mar 2011, 05:30

Post by heovespa »

The same result with SFS2X RC3 and AS3 API ver 0.9.17 :(
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post by Bax »

This issue was fixed in the last release, so you are probably still seeing a cached version. We just tested it again and everything works fine.
Make sure you recompile your application and clear the browser's cache.

Additional note: the client must join the room in order to be able to retrieve its users list.
Paolo Bax
The SmartFoxServer Team
heovespa
Posts: 10
Joined: 23 Mar 2011, 05:30

Post by heovespa »

Its okie now. Thanks. The reason is the client is outside the room :D
jamalsoueidan
Posts: 153
Joined: 15 Aug 2011, 16:33

Post by jamalsoueidan »

This is not good reason, you should be able to see the userList even if you are outside the room.

I have the same issue now, and I don't know how to fix it?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Post by rjgtav »

Hi. If you really need to get the whole userlist of a room, you could create an extension and attach it to the lobby that would send the userlist of a specific room when asked by the client. NOTE: If you want to see the userlist of all the rooms in the lobby , well... thats not advisable, as it consumes lots of bandwith.
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.
heovespa
Posts: 10
Joined: 23 Mar 2011, 05:30

Post by heovespa »

jamalsoueidan wrote:This is not good reason, you should be able to see the userList even if you are outside the room.

I have the same issue now, and I don't know how to fix it?
Create a room variable to save the userlist and set it to global (on serverside only). When a user enter or exit the room, you must update that variable. So you can see the userlist even if you are outside the room :D
Post Reply