Hi Lapo,
sorry for remaining silent, I didn't receive a notification of your reply and wasn't aware of it.
Let me give you more details.
- we have a lobby which is a limbo room
- our server extension (java) does an autoconnect in the lobby and immediately tries to find an available room for the player to join. If no available room is found a new room is created dynamically (all our rooms are dynamic and empty rooms are closed)
- there can be up to 5 players per room, and up to 50 spectators
- at the end of a game, a player gets moved to the lobby and back in the room as a spectator
After one day of usage, I end up with 5 to 10 percent of the rooms which show connected users that are idle. I can't kick them with the admin tool.
When I try to kick one of those players with a server side extension (tested successfully with non ghost users) :
Code: Select all
User kick_user = zone.getUserByName(params[0]);
helper.disconnectUser(kick_user);
(I checked that the kick_user object is correctly fetched with those ghost user)
I just get the following message :
INFO | jvm 1 | 2008/07/23 05:26:10 | 05:26:10.413 - [ FINE ] > User [ java.nio.channels.SocketChannel[closed] ] removed
but the user will still be there in the room !
Then we try do delete the room with the following code (tested successfully with non ghost users)
Code: Select all
Room destroy_room = zone.getRoomByName(params[0]);
if(destroy_room.isTemp()){
User[] users_in_room = destroy_room.getAllUsers();
for(int i = 0; i < users_in_room.length; i++){
helper.disconnectUser(users_in_room[i]);
}
gameMap.remove(destroy_room.getName());
this.trace("Gameroom " + destroy_room.getName() + " has been removed from HashMap.");
helper.destroyRoom(zone, destroy_room.getId());
}
but didn't get more lucky : we get the following trace :
INFO | jvm 1 | 2008/07/23 05:29:40 | 05:29:40.868 - [ FINE ] > User [ java.nio.channels.SocketChannel[closed] ] removed
INFO | jvm 1 | 2008/07/23 05:29:40 | [ it.gotoandplay.extensions.dm.DuelManager ]: Gameroom gameroom_1557 has been removed from HashMap.
but guess what, the room is still there.
I managed to catch the creation of one of those ghost users, here is the log for the soon to be "ghost" user : the player "ULYSSE320"
Code: Select all
[size=6]INFO | jvm 1 | 2008/07/23 06:49:30 | 06:49:30.006 - [ FINE ] > Setting RoomVar [challengerChips]: 8, priv: true, persist: true, in room: gameroom_8
INFO | jvm 1 | 2008/07/23 06:49:30 | 06:49:30.006 - [ FINE ] > Setting RoomVar [championChips]: 8, priv: true, persist: true, in room: gameroom_8
INFO | jvm 1 | 2008/07/23 06:49:30 | 06:49:30.007 - [ FINE ] > Setting RoomVar [challengerId]: 0, priv: true, persist: true, in room: gameroom_8
INFO | jvm 1 | 2008/07/23 06:49:30 | 06:49:30.007 - [ FINE ] > User [ ULYSSE320 ] removed
INFO | jvm 1 | 2008/07/23 06:49:30 | 06:49:30.014 - [ FINE ] > Buddy List loaded --> ULYSSE320
INFO | jvm 1 | 2008/07/23 06:49:30 | 06:49:30.014 - [ FINE ] > User [ ULYSSE320 ] logged in
INFO | jvm 1 | 2008/07/23 06:49:30 | [ it.gotoandplay.extensions.dm.DuelManager ]: Exception Thrown at loginRequest(): java.lang.NullPointerException
INFO | jvm 1 | 2008/07/23 06:49:30 | 06:49:30.067 - [ WARNING ] > Exception during client disconnection: java.lang.NullPointerException
INFO | jvm 1 | 2008/07/23 06:49:30 | java.lang.NullPointerException
INFO | jvm 1 | 2008/07/23 06:49:30 | at it.gotoandplay.extensions.dm.DuelManager.handleInternalEvent(DuelManager.java:1196)
INFO | jvm 1 | 2008/07/23 06:49:30 | at it.gotoandplay.smartfoxserver.controllers.MessageHandler.dispatchEvent(MessageHandler.java:198)
INFO | jvm 1 | 2008/07/23 06:49:30 | at it.gotoandplay.smartfoxserver.controllers.SystemHandler.broadcastUserLost(SystemHandler.java:3381)
INFO | jvm 1 | 2008/07/23 06:49:30 | at it.gotoandplay.smartfoxserver.SmartFoxServer.lostConnection(SmartFoxServer.java:1465)
INFO | jvm 1 | 2008/07/23 06:49:30 | at it.gotoandplay.smartfoxserver.SmartFoxServer.readIncomingMessages(SmartFoxServer.java:969)
INFO | jvm 1 | 2008/07/23 06:49:30 | at it.gotoandplay.smartfoxserver.EventReader.run(EventReader.java:32)
INFO | jvm 1 | 2008/07/23 06:49:30 | at java.lang.Thread.run(Unknown Source)
INFO | jvm 1 | 2008/07/23 06:49:30 | 06:49:30.068 - [ FINE ] > User [ java.nio.channels.SocketChannel[closed] ] removed[/size]
Also, the list of all connected users show many of those ghost players even outside rooms.
We set up MaxUserIdleTime to 300 and also tried automated kick procedure where players do not send any messages, but none seem to work to get rid of those users.
Let me add the the admin tool get disconnected very frequently where the server becomes moderately loaded (or when there are around 250 ghosts ?). Sometimes I can't even get the list of the rooms available before I get disconnected.
Many of my users also complain of savage disconnection (connection to the SFS lost during a game), I hope this is related to our problem.
This is a big problem to us since some players get stuck in rooms for minutes before they relize something is frozen, and we are obliged to restart the SFS everyday since there is no other way to get rid of those ghosts.
We have SFS v1.6.2,
Please advise !
Thanks !
Pedro