userList variable updates.

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

Moderators: Lapo, Bax

Post Reply
Mordan
Posts: 9
Joined: 25 Jan 2012, 08:56
Location: Yerevan

userList variable updates.

Post by Mordan »

Hi.
I'm developing a flash application, and such a situation occurs.
I'm entering a room. Then I set an event handler for room variables change.
Then another user enters room, and sets some room variables.
When my room variables change handler is fired, I get the users list, and don't find anybody in it except me.
The question is how can I get the updated userList, so I can know who is in the same room with me, when he changed the room variable value?

And can you please describe what is updated and when? For example when will be updated result of _sfs.roomManager.getRoomList() ???
Do I need to explicitly say "go and update that list??" Or I don't need to worry of it?? Now I'm trying to get the updated rooms list, but it always returns the same value,
the value about the time when I first logged in!

Thanks and Regards,
Martun.
Thanks and Regards,
Martun Karapetyan.
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: userList variable updates.

Post by rjgtav »

Hi.
Hmm... How are you trying to get the room's userList? What code are you using?
Please also make sure that you're running the latest SFS2x Final (2.0.1) alongside with the latest ActionScript 3.0 API.
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.
Mordan
Posts: 9
Joined: 25 Jan 2012, 08:56
Location: Yerevan

Re: userList variable updates.

Post by Mordan »

Yes, I have downloaded both from the site some 4-5 days ago. On the old API everything was working OK.
Here is a fragment of my code(whole code is huge, and copyrighted.)

/// Current room.
var room:Room = _sfs.lastJoinedRoom;
// Retrive the users list.
var userList:Array = room.userList; // Returns information about the time joined, not now!
Thanks and Regards,
Martun Karapetyan.
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Re: userList variable updates.

Post by rjgtav »

Hmm... That sounds weird... Sorry, but I don't have time left today for testing if that is really a bug.
In the mean time, if in the ROOM_VARIABLES_UPDATE handler, you do something like:

Code: Select all

var room:Room = evt.params.room as Room;
var userList:Array = room.userList;
Doesn't that code show you the updated userList?
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.
Mordan
Posts: 9
Joined: 25 Jan 2012, 08:56
Location: Yerevan

Re: userList variable updates.

Post by Mordan »

No. It shows the old one. May be the information that a new user has entered room comes later than the information that he has set a new room variable. Because in my case, the first thing after entering the room is to set a room variable for every user entering the room.
Thanks and Regards,
Martun Karapetyan.
secret007
Posts: 58
Joined: 29 May 2009, 06:27

Re: userList variable updates.

Post by secret007 »

For the updated room list, listen for onJoinRoom event (you dont have to say go and get updated rooms),

For the updated user list, you can listen for onUserCountChange handler...



Thanks ....
======================================================
Choose a job of your choice and you will never have to work in life !!!
Post Reply