@Override
	public void onCommand(Network src, Command com) throws IOException {
		switch (com.getType()) {
		case MESSAGE:
			Message msg = (Message) com;
			if (msg.source.isEmpty()) {
				System.out.println("  " + msg.message);
				window.pushToWindow(msg.message);
			} else {
				System.out.println(msg.source + ": " + msg.message);
				window.pushToWindow(msg.source + ": " + msg.message);
			}
			break;
		case PRIVATEMESSAGE:
			PrivateMessage pm = (PrivateMessage) com;
			System.out.printf("  Private message from %s:%n    %s%n", pm.src, pm.msg);
			if (!pm.tar.equals(name)) {
				System.out.println("  Contact an admin. This pm was meant for " + pm.tar + ".");
			}
			break;
		case NETWORKSHUTDOWN:
			System.out.println("  Network connection lost.");
			System.exit(0);
			break;
		default:
			break;
		}
	}