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
13241324
13251325 // ask the node list to check in with the domain server
13261326 NodeList::getInstance()->sendDomainServerCheckIn();
1327+
1328+ // send unmatched DataServerClient packets
1329+ DataServerClient::resendUnmatchedPackets();
13271330
13281331 // give the MyAvatar object position, orientation to the Profile so it can propagate to the data-server
13291332 _profile.updatePosition(_myAvatar.getPosition());
@@ -1416,55 +1419,6 @@ void Application::terminate() { · 86 unmodified lines
14161419 }
14171420 }
14181421
1419−static 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−
1447−void 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−
14681422 void Application::checkBandwidthMeterClick() {
14691423 // ... to be called upon button release
14701424
@@ -1868,8 +1822,8 @@ void Application::init() { · 397 unmodified lines
18681822
18691823 if (!_profile.getUsername().isEmpty()) {
18701824 // we have a username for this avatar, ask the data-server for the mesh URL for this avatar
1871− DataServerClient::getClientValueForKey(DataServerKey::FaceMeshURL);
1872− DataServerClient::getClientValueForKey(DataServerKey::SkeletonURL);
1825+ DataServerClient::getValueForKeyAndUserString(DataServerKey::FaceMeshURL, _profile.getUserString(), &_profile);
1826+ DataServerClient::getValueForKeyAndUserString(DataServerKey::SkeletonURL, _profile.getUserString(), &_profile);
18731827 }
18741828
18751829 // 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
25582512 controlledBroadcastToNodes(broadcastString, endOfBroadcastStringWrite - broadcastString,
25592513 nodeTypesOfInterest, sizeof(nodeTypesOfInterest));
25602514
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− }
25662515 // Update _viewFrustum with latest camera and view frustum data...
25672516 // NOTE: we get this from the view frustum, to make it simpler, since the
25682517 // loadViewFrumstum() method will get the correct details from the camera
@@ -3972,13 +3921,16 @@ void Application::attachNewHeadToNode(Node* newNode) { · 1403 unmodified lines
39723921
39733922 void Application::updateWindowTitle(){
39743923 QString title = "";
3924+
39753925 QString buildVersion = " (build " + applicationVersion() + ")";
3926+
39763927 QString username = _profile.getUsername();
39773928 if(!username.isEmpty()){
3978− title += _profile.getUsername();
3929+ title += username;
39793930 title += " @ ";
39803931 }
3981− title += _profile.getLastDomain();
3932+
3933+ title += NodeList::getInstance()->getDomainHostname();
39823934 title += buildVersion;
39833935
39843936 qDebug("Application title set to: %s", title.toStdString().c_str());
@@ -4229,9 +4181,6 @@ void Application::processDatagrams() { · 244 unmodified lines
42294181 bytesReceived);
42304182 getInstance()->_bandwidthMeter.inputStream(BandwidthMeter::AVATARS).updateValue(bytesReceived);
42314183 break;
4232− case PACKET_TYPE_AVATAR_URLS:
4233− processAvatarURLsMessage(_incomingPacket, bytesReceived);
4234− break;
42354184 case PACKET_TYPE_DATA_SERVER_GET:
42364185 case PACKET_TYPE_DATA_SERVER_PUT:
42374186 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