public Client(IObserver... observer) throws ClassNotFoundException, NoUserInterfaceChosen {
        pfactory = new PacketFactory();
        ConsoleReader cr = ReaderFactory.getReader(pfactory);
        try {
            if (observer.length == 0) {
                LOG.warn("No user interface specified!");
                throw new NoUserInterfaceChosen();
            }
            for (IObserver ob : observer) {
                this.addListener(ob);
                ob.setPacketFactory(pfactory);
            }
            pfactory.waitForReady();
            for (IObserver ob : observer) {
                ob.disableJoins();
            }
            this.setName(pfactory.getPlayername());
            net = pfactory.getGameNetwork();
            gameLoop();
        } catch (IOException e) {
            LOG.warn("Server was not found or left the spacetime.");
            for (IObserver ob : observer) {
                ob.notifyDisconnected();
            }
            System.exit(1);
        } catch (GameNetworkMissingException e) {
            LOG.fatal("Client could not connect to server.");
        } catch (InterruptedException e) {
            LOG.fatal("Interrupted while waiting for successful connection.");
        }
        cr.interrupt();
    }