Merge pull request #1635 from birarda/packet-sender

fix null UUIDs
This commit is contained in:
ZappoMan 2014-01-22 17:35:57 -08:00
commit 84bddf2383
2 changed files with 7 additions and 5 deletions

View file

@ -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');
}

View file

@ -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) {