From 2c181011b3d40df70604e63df5ab2927a51f1e49 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 10 Oct 2013 16:48:26 -0700 Subject: [PATCH] don't attempt to go to user without domain AND position --- interface/src/DataServerClient.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/interface/src/DataServerClient.cpp b/interface/src/DataServerClient.cpp index b8f2c49681..26e297375c 100644 --- a/interface/src/DataServerClient.cpp +++ b/interface/src/DataServerClient.cpp @@ -148,16 +148,18 @@ void DataServerClient::processSendFromDataServer(unsigned char* packetData, int } } } - } else if (keyList[i] == DataServerKey::Domain) { - qDebug() << "Changing domain hostname to" << valueList[i].toLocal8Bit().constData() << - "to go to" << userString << "\n"; - NodeList::getInstance()->setDomainHostname(valueList[i]); - } else if (keyList[i] == DataServerKey::Position) { - QStringList coordinateItems = valueList[i].split(','); + } else if (keyList[i] == DataServerKey::Domain && keyList[i + 1] == DataServerKey::Position + && valueList[i] != " " && valueList[i + 1] != " ") { + + QStringList coordinateItems = valueList[i + 1].split(','); if (coordinateItems.size() == 3) { - qDebug() << "Changing position to" << valueList[i].toLocal8Bit().constData() << - "to go to" << userString << "\n"; + + qDebug() << "Changing domain to" << valueList[i].toLocal8Bit().constData() << + "and position to" << valueList[i + 1].toLocal8Bit().constData() << + "to go to" << userString << "\n"; + + NodeList::getInstance()->setDomainHostname(valueList[i]); glm::vec3 newPosition(coordinateItems[0].toFloat(), coordinateItems[1].toFloat(), @@ -165,7 +167,6 @@ void DataServerClient::processSendFromDataServer(unsigned char* packetData, int Application::getInstance()->getAvatar()->setPosition(newPosition); } - } else if (keyList[i] == DataServerKey::UUID) { // this is the user's UUID - set it on the profile Application::getInstance()->getProfile()->setUUID(valueList[0]);