History

Merge branch 'master' of https://github.com/worklist/hifi into sicksense

Andrzej Kapolka committed 12 years ago

Commit 7bc65132 parents fb46a63 cd4ef0810 files · +190 −37Browse files

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

Unified · Split

interface/src/Application.cpp+5−17
@@ -4199,9 +4199,11 @@ void Application::nodeKilled(Node* node) { · 4198 unmodified lines
41994199 }
42004200
42014201 // also clean up scene stats for that server
4202+ _voxelSceneStatsLock.lockForWrite();
42024203 if (_voxelServerSceneStats.find(nodeUUID) != _voxelServerSceneStats.end()) {
42034204 _voxelServerSceneStats.erase(nodeUUID);
42044205 }
4206+ _voxelSceneStatsLock.unlock();
42054207 } else if (node->getLinkedData() == _lookatTargetAvatar) {
42064208 _lookatTargetAvatar = NULL;
42074209 }
@@ -4222,27 +4224,13 @@ int Application::parseVoxelStats(unsigned char* messageData, ssize_t messageLeng · 14 unmodified lines
42224224 QUuid nodeUUID = voxelServer->getUUID();
42234225
42244226 // now that we know the node ID, let's add these stats to the stats for that node...
4227+ _voxelSceneStatsLock.lockForWrite();
42254228 if (_voxelServerSceneStats.find(nodeUUID) != _voxelServerSceneStats.end()) {
4226− VoxelSceneStats& oldStats = _voxelServerSceneStats[nodeUUID];
4227−
4228− // this if construct is a little strange because we aren't quite using it yet. But
4229− // we want to keep this logic in here for now because we plan to use it soon to determine
4230− // additional network optimization states and better rate control
4231− if (!oldStats.isMoving() && temp.isMoving()) {
4232− // we think we are starting to move
4233− _voxelServerSceneStats[nodeUUID].unpackFromMessage(messageData, messageLength);
4234− } else if (oldStats.isMoving() && !temp.isMoving()) {
4235− // we think we are done moving
4236− _voxelServerSceneStats[nodeUUID].unpackFromMessage(messageData, messageLength);
4237− } else if (!oldStats.isMoving() && !temp.isMoving()) {
4238− // we think we are still not moving
4239− } else {
4240− // we think we are still moving
4241− }
4242−
4229+ _voxelServerSceneStats[nodeUUID].unpackFromMessage(messageData, messageLength);
42434230 } else {
42444231 _voxelServerSceneStats[nodeUUID] = temp;
42454232 }
4233+ _voxelSceneStatsLock.unlock();
42464234
42474235 VoxelPositionSize rootDetails;
42484236 voxelDetailsForCode(temp.getJurisdictionRoot(), rootDetails);

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