From 454a1cc6c928d7c4f62b29129271dad26fac4673 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 22 Jan 2014 17:33:17 -0800 Subject: [PATCH] only set UUID when not null, properly send UUID from data-server --- data-server/src/DataServer.cpp | 6 +++--- interface/src/avatar/Profile.cpp | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/data-server/src/DataServer.cpp b/data-server/src/DataServer.cpp index 2916403c97..4362c8ace0 100644 --- a/data-server/src/DataServer.cpp +++ b/data-server/src/DataServer.cpp @@ -137,10 +137,10 @@ void DataServer::readPendingDatagrams() { packetData[0] = PACKET_TYPE_DATA_SERVER_SEND; - const char MULTI_KEY_VALUE_SEPARATOR = '|'; - if (strcmp((char*) packetData + readBytes, "uuid") != 0) { + const char MULTI_KEY_VALUE_SEPARATOR = '|'; + // the user has sent one or more keys - make the associated requests for (int j = 0; j < numKeys; j++) { @@ -184,7 +184,7 @@ void DataServer::readPendingDatagrams() { } else { // user is asking for a UUID matching username, copy the UUID we found QString uuidString = uuidStringWithoutCurlyBraces(parsedUUID); - memcpy(packetData + numSendPacketBytes, uuidString.constData(), uuidString.size() + sizeof('\0')); + memcpy(packetData + numSendPacketBytes, qPrintable(uuidString), uuidString.size() + sizeof('\0')); numSendPacketBytes += uuidString.size() + sizeof('\0'); } diff --git a/interface/src/avatar/Profile.cpp b/interface/src/avatar/Profile.cpp index 2ea29b2cca..5a2e87e394 100644 --- a/interface/src/avatar/Profile.cpp +++ b/interface/src/avatar/Profile.cpp @@ -48,8 +48,10 @@ QString Profile::getUserString() const { void Profile::setUUID(const QUuid& uuid) { _uuid = uuid; - // when the UUID is changed we need set it appropriately on the NodeList instance - NodeList::getInstance()->setOwnerUUID(uuid); + if (!_uuid.isNull()) { + // when the UUID is changed we need set it appropriately on the NodeList instance + NodeList::getInstance()->setOwnerUUID(uuid); + } } void Profile::setFaceModelURL(const QUrl& faceModelURL) {