Situation:
1. Enter with two users into ther room from two different browsers on the same PC.
2. Unplug ethernet cable from this PC -->> got connect lost in few seconds on client.
3. From third clinet using another PC it could be seen that two disconnected users are still in the room.
4. Plug ethernet cable back.
5. Reload disconnected clients.
6. On the server side handle login event as follows: check if user already exisit in zone:
Code: Select all
User checkUser = getParentExtension().getApi().getUserByName(providedName);
if(checkUser != null) {
getParentExtension().getApi().disconnectUser(checkUser, ClientDisconnectionReason.KICK);
log.warn("UserLoginHandler: kick ".concat(providedName));
log.warn("UserLoginHandler: User already exist in zone - disconnect user | ip address".concat(session.getFullIpAddress()));
}
checkUser = getParentExtension().getParentZone().getUserByName(providedName);
if (checkUser != null) {
getParentExtension().getParentZone().getUserManager().disconnectUser(checkUser);
log.warn("UserLoginHandler: disconnect ".concat(providedName));
log.warn("UserLoginHandler: User already exist in zone - disconnect user | ip address".concat(session.getFullIpAddress()));
}
In server log we see:
Code: Select all
===== LOGIN =======
- UserLoginHandler: kick 100002909477108
- UserLoginHandler: User already exist in zone - disconnect user | ip address192.168.11.174:49271
- UserLoginHandler: disconnect 100002909477108
- UserLoginHandler: User already exist in zone - disconnect user | ip address192.168.11.174:49271
The user was removed by disconnect, not by kick. Why is it posiible?
----------------------
Enter into the room using one of the previously disconnected users. Check if user is in room using function SFSRoom.:
Code: Select all
if (room.containsUser(user.getName())) {
log.warn("USER EXIST IN ROOM");
extension.getApi().leaveRoom(user, room);
} else {
log.warn("USER NOT EXIST IN ROOM");
}
By some unknown reason user is not in the room. But I printed out array of users in the room and !!! it exists there:
Code: Select all
iter = room.getUserList().iterator();
while(iter.hasNext()) {
log.warn("user name1 = ".concat(iter.next().getName()));
}
And in the logs we see:
Code: Select all
- USER UID = 100002909477108
- USER NOT EXIST IN ROOM
- user name1 = 100002909477108
- user name1 = 100002850443247
Manually try to remove user from the room:
Code: Select all
Iterator<User> iter = room.getUserList().iterator();
User temp = null;
while(iter.hasNext()) {
temp = iter.next();
if (temp.getName().equalsIgnoreCase(user.getName())) {
extension.getApi().leaveRoom(temp, room);
log.warn("user remove = ".concat(temp.getName()));
} else {
log.warn("user name = ".concat(temp.getName()));
}
}
See in logs:
Code: Select all
- USER UID = 100002909477108
- USER NOT EXIST IN ROOM
- user name1 = 100002909477108
- user name1 = 100002850443247
- user name = 100002850443247
- user remove = 100002909477108
- user name1 = 100002850443247
From AS client side we see that user 100002909477108 is not disconnected. Why AS clinet has not received leave room event (it is subscribed on this event)? Why the situation when user is able to enter in room multiple times is possible?
Why after deletion user from parent zone of the room user was not deleted from the room? May be we lost something? Is there any way to remove/disconnect user completely from all rooms of the zone.
Is there a way (by API) to allow entering into the room only that users who is not already in the room?
How to receive rooms to which user was joined before reconnect in tha way that other connected clients receive this information?
Thanks in advance