I've found something really strange. Here are the steps my program do:
1. User login into the zone and join the default room(room1)
2. The zone extension create a new room(room2) and join this user into the new room
3. User do not leave the old room, so he is in two rooms(room1 and room2)
4. User closed the client flash program so zone extension and room extension both get 'userLost' , and the user is disappeared from the old room(room1) and the new created room(room2) in the admin program.
5. But, the zone's 'total users' number is still = 1, when I try to get zone.getAllUsersInZone(), I can get a LinkedList that contain 1 SocketChannel, but this SocketChannel is closed.
When this user try to login into the zone again, the error 'This user name is already taken.' will occur. How can I disconnect this user from server when the client program is closed?
number of total users is not correct when userLost
-
- Posts: 7
- Joined: 29 Nov 2008, 16:48
The userLost event is fired BEFORE the user is actually removed from the joined rooms.
This is done to allow the developer to check in which rooms the user is located and perform its application logic if necessary.
I don't see how the two things can be connected as the userLost behavior is what it is normally expected.
We are aware of possible similar problems if you have an exception in your extension when dealing with the userLost event.
This happens only if you use Java extensions. If you make sure to trap any exception that might occur this should never happen.
Anyways we're addressing the issue on the next release by adding better error handling for that event behind the scenes.
This is done to allow the developer to check in which rooms the user is located and perform its application logic if necessary.
When this user try to login into the zone again, the error 'This user name is already taken.' will occur. How can I disconnect this user from server when the client program is closed?
I don't see how the two things can be connected as the userLost behavior is what it is normally expected.
We are aware of possible similar problems if you have an exception in your extension when dealing with the userLost event.
This happens only if you use Java extensions. If you make sure to trap any exception that might occur this should never happen.
Anyways we're addressing the issue on the next release by adding better error handling for that event behind the scenes.
-
- Posts: 7
- Joined: 29 Nov 2008, 16:48
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 29 guests