History

Merge branch 'master' of https://github.com/highfidelity/hifi into metavoxels

Andrzej Kapolka committed 12 years ago

Commit d473b002 parents 230b666 753a13d36 files · +4719 −394Browse files

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

Unified · Split

interface/src/Application.cpp+10−61
@@ -1324,6 +1324,9 @@ void Application::timer() { · 1323 unmodified lines
1324 1324
1325 // ask the node list to check in with the domain server1325 // ask the node list to check in with the domain server
1326 NodeList::getInstance()->sendDomainServerCheckIn();1326 NodeList::getInstance()->sendDomainServerCheckIn();
1327
1328 // send unmatched DataServerClient packets
1329 DataServerClient::resendUnmatchedPackets();
1327 1330
1328 // give the MyAvatar object position, orientation to the Profile so it can propagate to the data-server1331 // give the MyAvatar object position, orientation to the Profile so it can propagate to the data-server
1329 _profile.updatePosition(_myAvatar.getPosition());1332 _profile.updatePosition(_myAvatar.getPosition());
@@ -1416,55 +1419,6 @@ void Application::terminate() { · 86 unmodified lines
1416 }1419 }
1417}1420}
1418 1421
1419static Avatar* processAvatarMessageHeader(unsigned char*& packetData, size_t& dataBytes) {
1420 // record the packet for stats-tracking
1421 Application::getInstance()->getBandwidthMeter()->inputStream(BandwidthMeter::AVATARS).updateValue(dataBytes);
1422 SharedNodePointer avatarMixerNode = NodeList::getInstance()->soloNodeOfType(NODE_TYPE_AVATAR_MIXER);
1423 if (avatarMixerNode) {
1424 avatarMixerNode->recordBytesReceived(dataBytes);
1425 }
1426
1427 // skip the header
1428 int numBytesPacketHeader = numBytesForPacketHeader(packetData);
1429 packetData += numBytesPacketHeader;
1430 dataBytes -= numBytesPacketHeader;
1431
1432 // read the node id
1433 QUuid nodeUUID = QUuid::fromRfc4122(QByteArray((char*) packetData, NUM_BYTES_RFC4122_UUID));
1434
1435 packetData += NUM_BYTES_RFC4122_UUID;
1436 dataBytes -= NUM_BYTES_RFC4122_UUID;
1437
1438 // make sure the node exists
1439 SharedNodePointer node = NodeList::getInstance()->nodeWithUUID(nodeUUID);
1440 if (!node || !node->getLinkedData()) {
1441 return NULL;
1442 }
1443 Avatar* avatar = static_cast<Avatar*>(node->getLinkedData());
1444 return avatar->isInitialized() ? avatar : NULL;
1445}
1446
1447void Application::processAvatarURLsMessage(unsigned char* packetData, size_t dataBytes) {
1448 Avatar* avatar = processAvatarMessageHeader(packetData, dataBytes);
1449 if (!avatar) {
1450 return;
1451 }
1452 // PER Note: message is no longer processed but used to trigger
1453 // Dataserver lookup - redesign this to instantly ask the
1454 // dataserver on first receipt of other avatar UUID, and also
1455 // don't ask over and over again. Instead use this message to
1456 // Tell the other avatars that your dataserver data has
1457 // changed.
1458
1459 //QDataStream in(QByteArray((char*)packetData, dataBytes));
1460 //QUrl voxelURL;
1461 //in >> voxelURL;
1462
1463 // use this timing to as the data-server for an updated mesh for this avatar (if we have UUID)
1464 DataServerClient::getValuesForKeysAndUUID(QStringList() << DataServerKey::FaceMeshURL << DataServerKey::SkeletonURL,
1465 avatar->getUUID());
1466}
1467
1468void Application::checkBandwidthMeterClick() {1422void Application::checkBandwidthMeterClick() {
1469 // ... to be called upon button release1423 // ... to be called upon button release
1470 1424
@@ -1868,8 +1822,8 @@ void Application::init() { · 397 unmodified lines
1868 1822
1869 if (!_profile.getUsername().isEmpty()) {1823 if (!_profile.getUsername().isEmpty()) {
1870 // we have a username for this avatar, ask the data-server for the mesh URL for this avatar1824 // we have a username for this avatar, ask the data-server for the mesh URL for this avatar
1871 DataServerClient::getClientValueForKey(DataServerKey::FaceMeshURL);1825 DataServerClient::getValueForKeyAndUserString(DataServerKey::FaceMeshURL, _profile.getUserString(), &_profile);
1872 DataServerClient::getClientValueForKey(DataServerKey::SkeletonURL);1826 DataServerClient::getValueForKeyAndUserString(DataServerKey::SkeletonURL, _profile.getUserString(), &_profile);
1873 }1827 }
1874 1828
1875 // Set up VoxelSystem after loading preferences so we can get the desired max voxel count1829 // Set up VoxelSystem after loading preferences so we can get the desired max voxel count
@@ -2558,11 +2512,6 @@ void Application::updateAvatar(float deltaTime) { · 682 unmodified lines
2558 controlledBroadcastToNodes(broadcastString, endOfBroadcastStringWrite - broadcastString,2512 controlledBroadcastToNodes(broadcastString, endOfBroadcastStringWrite - broadcastString,
2559 nodeTypesOfInterest, sizeof(nodeTypesOfInterest));2513 nodeTypesOfInterest, sizeof(nodeTypesOfInterest));
2560 2514
2561 const float AVATAR_URLS_SEND_INTERVAL = 1.0f;
2562 if (shouldDo(AVATAR_URLS_SEND_INTERVAL, deltaTime)) {
2563 QUrl empty;
2564 Avatar::sendAvatarURLsMessage(empty);
2565 }
2566 // Update _viewFrustum with latest camera and view frustum data...2515 // Update _viewFrustum with latest camera and view frustum data...
2567 // NOTE: we get this from the view frustum, to make it simpler, since the2516 // NOTE: we get this from the view frustum, to make it simpler, since the
2568 // loadViewFrumstum() method will get the correct details from the camera2517 // loadViewFrumstum() method will get the correct details from the camera
@@ -3972,13 +3921,16 @@ void Application::attachNewHeadToNode(Node* newNode) { · 1403 unmodified lines
3972 3921
3973void Application::updateWindowTitle(){3922void Application::updateWindowTitle(){
3974 QString title = "";3923 QString title = "";
3924
3975 QString buildVersion = " (build " + applicationVersion() + ")";3925 QString buildVersion = " (build " + applicationVersion() + ")";
3926
3976 QString username = _profile.getUsername();3927 QString username = _profile.getUsername();
3977 if(!username.isEmpty()){3928 if(!username.isEmpty()){
3978 title += _profile.getUsername();3929 title += username;
3979 title += " @ ";3930 title += " @ ";
3980 }3931 }
3981 title += _profile.getLastDomain();3932
3933 title += NodeList::getInstance()->getDomainHostname();
3982 title += buildVersion;3934 title += buildVersion;
3983 3935
3984 qDebug("Application title set to: %s", title.toStdString().c_str());3936 qDebug("Application title set to: %s", title.toStdString().c_str());
@@ -4229,9 +4181,6 @@ void Application::processDatagrams() { · 244 unmodified lines
4229 bytesReceived);4181 bytesReceived);
4230 getInstance()->_bandwidthMeter.inputStream(BandwidthMeter::AVATARS).updateValue(bytesReceived);4182 getInstance()->_bandwidthMeter.inputStream(BandwidthMeter::AVATARS).updateValue(bytesReceived);
4231 break;4183 break;
4232 case PACKET_TYPE_AVATAR_URLS:
4233 processAvatarURLsMessage(_incomingPacket, bytesReceived);
4234 break;
4235 case PACKET_TYPE_DATA_SERVER_GET:4184 case PACKET_TYPE_DATA_SERVER_GET:
4236 case PACKET_TYPE_DATA_SERVER_PUT:4185 case PACKET_TYPE_DATA_SERVER_PUT:
4237 case PACKET_TYPE_DATA_SERVER_SEND:4186 case PACKET_TYPE_DATA_SERVER_SEND:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t