History

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

Andrzej Kapolka committed 12 years ago

Commit 3cf47f82 parents dcc926a 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
@@ -4291,9 +4291,11 @@ void Application::nodeKilled(Node* node) { · 4290 unmodified lines
42914291 }
42924292
42934293 // also clean up scene stats for that server
4294+ _voxelSceneStatsLock.lockForWrite();
42944295 if (_voxelServerSceneStats.find(nodeUUID) != _voxelServerSceneStats.end()) {
42954296 _voxelServerSceneStats.erase(nodeUUID);
42964297 }
4298+ _voxelSceneStatsLock.unlock();
42974299 } else if (node->getLinkedData() == _lookatTargetAvatar) {
42984300 _lookatTargetAvatar = NULL;
42994301 }
@@ -4314,27 +4316,13 @@ int Application::parseVoxelStats(unsigned char* messageData, ssize_t messageLeng · 14 unmodified lines
43144316 QUuid nodeUUID = voxelServer->getUUID();
43154317
43164318 // now that we know the node ID, let's add these stats to the stats for that node...
4319+ _voxelSceneStatsLock.lockForWrite();
43174320 if (_voxelServerSceneStats.find(nodeUUID) != _voxelServerSceneStats.end()) {
4318− VoxelSceneStats& oldStats = _voxelServerSceneStats[nodeUUID];
4319−
4320− // this if construct is a little strange because we aren't quite using it yet. But
4321− // we want to keep this logic in here for now because we plan to use it soon to determine
4322− // additional network optimization states and better rate control
4323− if (!oldStats.isMoving() && temp.isMoving()) {
4324− // we think we are starting to move
4325− _voxelServerSceneStats[nodeUUID].unpackFromMessage(messageData, messageLength);
4326− } else if (oldStats.isMoving() && !temp.isMoving()) {
4327− // we think we are done moving
4328− _voxelServerSceneStats[nodeUUID].unpackFromMessage(messageData, messageLength);
4329− } else if (!oldStats.isMoving() && !temp.isMoving()) {
4330− // we think we are still not moving
4331− } else {
4332− // we think we are still moving
4333− }
4334−
4321+ _voxelServerSceneStats[nodeUUID].unpackFromMessage(messageData, messageLength);
43354322 } else {
43364323 _voxelServerSceneStats[nodeUUID] = temp;
43374324 }
4325+ _voxelSceneStatsLock.unlock();
43384326
43394327 VoxelPositionSize rootDetails;
43404328 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