if (game.getPhase() == Game.PHASE_LOUNGE) { removeAllEntitesOwnedBy(player); }   if (game.getEntitiesOwnedBy(player) > 0) { player.setGhost(true); player.setDone(true); send(createPlayerUpdatePacket(connId)); } else { game.removePlayer(connId); send(new Packet(Packet.COMMAND_PLAYER_REMOVE, new Integer(connId))); }   if (game.phaseHasTurns(game.getPhase())) { if (game.getTurn().getPlayerNum() == connId) { sendGhostSkipMessage(); } } else { checkReady(); }  System.out.println("s: player " + connId + " disconnected"); if (player != null) { sendServerChat(player.getName() + " disconnected."); } else { sendServerChat("Player #" + connId + " disconnected.");
if (getPlayer(conn.getId()) != null) { disconnected(getPlayer(conn.getId()));
    public void disconnected(int connId) {        final Connection conn = getClient(connId);        final Player player = getPlayer(connId);                // if the connection's even still there, remove it        if (conn != null) {            conn.die();            connections.removeElement(conn);            connectionIds.remove(new Integer(connId));        }                // in the lounge, just remove all entities for that player        if (game.getPhase() == Game.PHASE_LOUNGE) {            removeAllEntitesOwnedBy(player);        }                // if a player has active entities, he becomes a ghost        if (game.getEntitiesOwnedBy(player) > 0) {            player.setGhost(true);            player.setDone(true);            send(createPlayerUpdatePacket(connId));        } else {            game.removePlayer(connId);            send(new Packet(Packet.COMMAND_PLAYER_REMOVE, new Integer(connId)));        }                // make sure the game advances        if (game.phaseHasTurns(game.getPhase())) {            if (game.getTurn().getPlayerNum() == connId) {                sendGhostSkipMessage();            }        } else {            checkReady();        }                System.out.println("s: player " + connId + " disconnected");        if (player != null) {            sendServerChat(player.getName() + " disconnected.");        } else {            sendServerChat("Player #" + connId + " disconnected.");        }    }