@Override
    public int connect(String nick, String password) {
        try {
            Player player = (Player) em.createNamedQuery("verifyUserData").setParameter("nickName", nick).setParameter("password", password).getSingleResult();

            if (player.getEtat() == PlayerState.DISCONNECTED) {
                player.setState(PlayerState.CONNECTED);
                return ConnectivityHandler.CONNECTION_OK;
            } else {
                return ConnectivityHandlerBean.ALREADY_CONNECTED;
            }
        } catch(Exception e) {
            return ConnectivityHandler.BAD_INFO;
        }
    }