History

More progress on reading skeletons.

Andrzej Kapolka committed 13 years ago

Commit c8b2ed01 parent 9ba3c379 files · +124 −66Browse files

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

Unified · Split

interface/src/DataServerClient.cpp+20−0
@@ -148,6 +148,26 @@ void DataServerClient::processSendFromDataServer(unsigned char* packetData, int · 147 unmodified lines
148148 }
149149 }
150150 }
151+ } else if (keyList[i] == DataServerKey::SkeletonURL) {
152+
153+ if (userUUID.isNull() || userUUID == Application::getInstance()->getProfile()->getUUID()) {
154+ qDebug("Changing user's skeleton URL to %s\n", valueList[0].toLocal8Bit().constData());
155+ Application::getInstance()->getProfile()->setSkeletonModelURL(QUrl(valueList[0]));
156+ } else {
157+ // skeleton URL for a UUID, find avatar in our list
158+ NodeList* nodeList = NodeList::getInstance();
159+ for (NodeList::iterator node = nodeList->begin(); node != nodeList->end(); node++) {
160+ if (node->getLinkedData() != NULL && node->getType() == NODE_TYPE_AGENT) {
161+ Avatar* avatar = (Avatar *) node->getLinkedData();
162+
163+ if (avatar->getUUID() == userUUID) {
164+ QMetaObject::invokeMethod(&avatar->getBody(),
165+ "setSkeletonModelURL",
166+ Q_ARG(QUrl, QUrl(valueList[0])));
167+ }
168+ }
169+ }
170+ }
151171 } else if (keyList[i] == DataServerKey::Domain && keyList[i + 1] == DataServerKey::Position
152172 && valueList[i] != " " && valueList[i + 1] != " ") {
153173