@Override
	public void objectReceived(Object o) {
//		NetObject n = (NetObject) o;
		NetMessage n;
		try {
			n = NetMessage.parseFrom((byte[])o);
			switch (n.getType()) {
			case AUTHENTICATION:
				authenticate(n);
				break;
			case CHAT_MESSAGE:
				chatMessageReceived(n);
				break;
			case NAME_AVAIL:
				checkNameAvailability(n);
				break;
			case NAME_SET:
				setName(n);
				break;
			case JOIN_CHAT:
				joinChat();
				break;
			case LIST_UPDATE:
				chatPersonListUpdate();
				break;
			default:
				System.err.println("Unhandled NetMessage in ClientAgent");
				break;
			}
		} catch (InvalidProtocolBufferException e) {
			e.printStackTrace();
		}
	}