Hi,
when the SFSEvent.USER_LEAVE_ROOM is fired, if i trace the userCount property of the supplied room, it has not been updated to represent the new user count of the room? As the user has now left the room (hence the event being fired), should the userCount property not maintain the current state?
Cheers,
James
edit - the issue appears to only happen when the last user leaves the room. i.e if there's 3 users in a room and one leaves, the count get's reduced by one. The same for when the second user leaves. But when the final user leaves, the count is still set to 1 instead of 0?
edit2 - I now have a case where a room has 2 users. The second user leaves and on the event the room user count is 1, as expected. Then when the final user leaves, the user count is 2?
SFSEvent.USER_LEAVE_ROOM - user count on room is not updated
I am not able to reproduce this.
On every user exit I see the counter showing the expected value. There's however a quirk in the last User.
Technically when you are alone in the Room the user count is 1. If you leave that Room you will no longer be there so now the User count is handled via the USER_COUNT_UPDATE event which arrives after the USER_EXIT.
I am taking a note for the next release. What is exactly the scenario in which this is used? To me it looks like a minro thing, maybe I am wrong.
On every user exit I see the counter showing the expected value. There's however a quirk in the last User.
Technically when you are alone in the Room the user count is 1. If you leave that Room you will no longer be there so now the User count is handled via the USER_COUNT_UPDATE event which arrives after the USER_EXIT.
I am taking a note for the next release. What is exactly the scenario in which this is used? To me it looks like a minro thing, maybe I am wrong.
I've now changed my code to use USER_COUNT_UPDATE instead, to monitor any change to the number of users in a room and it's working fine.
All i was doing before was adding and removing users from a room and tracing the user count on the returned room object for the USER_EXIT_ROOM event. If you're the last user in the room, when you leave, the user count is still 1. As the event is called USER_EXIT_ROOM, so is fired when a user exits a room, when the last user leaves i would personally expect it to return 0 for the count, as there's no longer anyone in the room.
I suppose it is only minor, but i'd still consider it a bug. If you can listen for the event, even if you are the last user to leave a room and therefore no longer in it, i'd expect the count returned to accurately reflect the number of users currently in it.
All i was doing before was adding and removing users from a room and tracing the user count on the returned room object for the USER_EXIT_ROOM event. If you're the last user in the room, when you leave, the user count is still 1. As the event is called USER_EXIT_ROOM, so is fired when a user exits a room, when the last user leaves i would personally expect it to return 0 for the count, as there's no longer anyone in the room.
I suppose it is only minor, but i'd still consider it a bug. If you can listen for the event, even if you are the last user to leave a room and therefore no longer in it, i'd expect the count returned to accurately reflect the number of users currently in it.
Return to “SFS2X ActionScript 3 API”
Who is online
Users browsing this forum: No registered users and 19 guests