History

don't attempt to go to user without domain AND position

Stephen Birarda committed 13 years ago

Commit 2c181011 parent 081f2da1 file · +10 −9Browse files

Showing the changes to interface/src/DataServerClient.cpp (1 of 1 file). Show all

Unified · Split

interface/src/DataServerClient.cpp+10−9
@@ -148,16 +148,18 @@ void DataServerClient::processSendFromDataServer(unsigned char* packetData, int · 147 unmodified lines
148148 }
149149 }
150150 }
151− } else if (keyList[i] == DataServerKey::Domain) {
152− qDebug() << "Changing domain hostname to" << valueList[i].toLocal8Bit().constData() <<
153− "to go to" << userString << "\n";
154− NodeList::getInstance()->setDomainHostname(valueList[i]);
155− } else if (keyList[i] == DataServerKey::Position) {
156− QStringList coordinateItems = valueList[i].split(',');
151+ } else if (keyList[i] == DataServerKey::Domain && keyList[i + 1] == DataServerKey::Position
152+ && valueList[i] != " " && valueList[i + 1] != " ") {
153+
154+ QStringList coordinateItems = valueList[i + 1].split(',');
157155
158156 if (coordinateItems.size() == 3) {
159− qDebug() << "Changing position to" << valueList[i].toLocal8Bit().constData() <<
160− "to go to" << userString << "\n";
157+
158+ qDebug() << "Changing domain to" << valueList[i].toLocal8Bit().constData() <<
159+ "and position to" << valueList[i + 1].toLocal8Bit().constData() <<
160+ "to go to" << userString << "\n";
161+
162+ NodeList::getInstance()->setDomainHostname(valueList[i]);
161163
162164 glm::vec3 newPosition(coordinateItems[0].toFloat(),
163165 coordinateItems[1].toFloat(),
@@ -165,7 +167,6 @@ void DataServerClient::processSendFromDataServer(unsigned char* packetData, int · 1 unmodified line
165167 Application::getInstance()->getAvatar()->setPosition(newPosition);
166168 }
167169
168−
169170 } else if (keyList[i] == DataServerKey::UUID) {
170171 // this is the user's UUID - set it on the profile
171172 Application::getInstance()->getProfile()->setUUID(valueList[0]);