public TAFPSClient(String server, boolean undecorated) {
		super("TAFPS");
		try {
			robot = new Robot();
		} catch (AWTException e) {
			e.printStackTrace();
		}
		this.host = server;
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setUndecorated(undecorated);
		if (isUndecorated()) {
			setBackground(new Color(0, 0, 0, 128));
		}
        setSize(new Dimension(640, 480));
        setLocationRelativeTo(null);
        getRootPane().putClientProperty("apple.awt.draggableWindowBackground", false);
        setFocusable(true);
        getContentPane().setLayout(new java.awt.BorderLayout(0, 312 + ((isUndecorated()) ? (56) : (0))));
        infoField.setEditable(false);
        infoField.setBackground(new Color(0, 0, 0, 255));
        infoField.setForeground(new Color(255, 255, 255, 255));
        infoField.setBorder(null);
        infoField.setHorizontalAlignment(JTextField.CENTER);
        outputArea.setEditable(false);
        outputArea.setBackground(new Color(0, 0, 0, 255));
        outputArea.setForeground(new Color(255, 255, 255, 255));
        outputArea.setBorder(null);
        outputArea.setLineWrap(true);
        getContentPane().add(infoField, java.awt.BorderLayout.NORTH);
        getContentPane().add(outputArea, java.awt.BorderLayout.CENTER);
        scroll = new JScrollPane(outputArea,JScrollPane.VERTICAL_SCROLLBAR_NEVER,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
        scroll.setBorder(null);
        getContentPane().add(scroll);
        setVisible(true);
		addMouseMotionListener(this);
		addMouseListener(this);
		addKeyListener(this);
		
		client = new Client();
		client.start();
		Network.register(client);

		client.addListener(new Listener() {
			public void connected (Connection c) {
				Join join = new Join();
				client.sendTCP(join);
			}

			public void received (Connection c, Object object) {
				if (object instanceof InfoMessage) {
					InfoMessage info = (InfoMessage)object;
					infoField.setText(info.message);
					return;
				}
				if (object instanceof DescriptionMessage) {
					DescriptionMessage description = (DescriptionMessage)object;
					appendln(description.message);
					return;
				}
				if (object instanceof Wait) {
					waiting = true;
					try {
						Thread.sleep(1000);
						client.sendUDP(new Resume());
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
					return;
				}
				if (object instanceof Resume) {
					waiting = false;
					return;
				}
				if (object instanceof Death) {
					client.stop();
					infoField.setText("\\ to return to life");
					return;
				}
			}

			public void disconnected (Connection c) {
				appendln("You return to the void.");
			}
		});
		tryReconnect();
	}