Page 1 of 1

Can't get the userlist

Posted: 11 Aug 2011, 02:14
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?

Posted: 11 Aug 2011, 13:18
by Bax
Please report the server and API version.

Posted: 11 Aug 2011, 20:00
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).

Posted: 12 Aug 2011, 09:30
by Bax
Please upgrade to the latest RC3 version, thank you.

Posted: 12 Aug 2011, 23:05
by heovespa
The same result with SFS2X RC3 and AS3 API ver 0.9.17 :(

Posted: 13 Aug 2011, 09:23
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.

Posted: 13 Aug 2011, 10:09
by heovespa
Its okie now. Thanks. The reason is the client is outside the room :D

Posted: 19 Aug 2011, 07:17
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?

Posted: 19 Aug 2011, 07:21
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.

Posted: 19 Aug 2011, 14:15
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