@Override
	public void objectReceived(Object o) {
        try {
		    NetMessage n = NetMessage.parseFrom((byte[])o);
		    System.out.println(n.getType().toString() + " message received");
            switch (n.getType()) {
                case CHAT_MESSAGE:
                    chatWindow.addMessage(n.getChatMessage().getMessage());
                    break;
                case LIST_UPDATE:
                    chatWindow.updateChatPersonList(n.getChatList().getPersonList());
                    break;
			default:
				System.err.println("Unhandled NetMessage in ChatAgent");
				break;
            }
        } catch (InvalidProtocolBufferException e) {
            e.printStackTrace();
        }
	}