protected void finalize()
    {
        try
        {
            if (!this.charname.equals(""))
            {
                int[] room = bot.getRoom();
                if (room[0] != -1)
                {
                    lobby.removeRoomPlayer(room, bot.getName());
                }
                lobby.removeuser(charname);
                debug("remove charname " + charname);
                this.charname = "";
            }
            this.server.remove(this.getRemoteAddress());
            this.socketIn.close();
            this.socketOut.close();
            this.socket.close();
        } catch (Exception e)
        {
            debug("Exception (finalize): " + e.getMessage());
        }
    }