Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all
Unified · Split
| @@ -4128,7 +4128,7 @@ void Application::nodeKilled(Node* node) { · 4127 unmodified lines | |||
| 4128 | VoxelPositionSize rootDetails; | 4128 | VoxelPositionSize rootDetails; |
| 4129 | voxelDetailsForCode(rootCode, rootDetails); | 4129 | voxelDetailsForCode(rootCode, rootDetails); |
| 4130 | 4130 | ||
| 4131 | printf(">>>>>>>>>>>>>>>> HERE>>>>>>>>> voxel server going away...... v[%f, %f, %f, %f]\n", | 4131 | printf("voxel server going away...... v[%f, %f, %f, %f]\n", |
| 4132 | rootDetails.x, rootDetails.y, rootDetails.z, rootDetails.s); | 4132 | rootDetails.x, rootDetails.y, rootDetails.z, rootDetails.s); |
| 4133 | 4133 | ||
| 4134 | // Add the jurisditionDetails object to the list of "fade outs" | 4134 | // Add the jurisditionDetails object to the list of "fade outs" |
| @@ -4140,10 +4140,11 @@ void Application::nodeKilled(Node* node) { · 5 unmodified lines | |||
| 4140 | _voxelFades.push_back(fade); | 4140 | _voxelFades.push_back(fade); |
| 4141 | } | 4141 | } |
| 4142 | 4142 | ||
| 4143 | // we should remove it... | 4143 | // If the voxel server is going away, remove it from our jurisdiction map so we don't send voxels to a dead server |
| 4144 | _voxelServerJurisdictions.erase(nodeUUID); | 4144 | _voxelServerJurisdictions.erase(nodeUUID); |
| 4145 | } | 4145 | } |
| 4146 | 4146 | ||
| 4147 | // also clean up scene stats for that server | ||
| 4147 | if (_voxelServerSceneStats.find(nodeUUID) != _voxelServerSceneStats.end()) { | 4148 | if (_voxelServerSceneStats.find(nodeUUID) != _voxelServerSceneStats.end()) { |
| 4148 | _voxelServerSceneStats.erase(nodeUUID); | 4149 | _voxelServerSceneStats.erase(nodeUUID); |
| 4149 | } | 4150 | } |
| @@ -4157,8 +4158,8 @@ int Application::parseVoxelStats(unsigned char* messageData, ssize_t messageLeng · 7 unmodified lines | |||
| 4157 | // But, also identify the sender, and keep track of the contained jurisdiction root for this server | 4158 | // But, also identify the sender, and keep track of the contained jurisdiction root for this server |
| 4158 | Node* voxelServer = NodeList::getInstance()->nodeWithAddress(&senderAddress); | 4159 | Node* voxelServer = NodeList::getInstance()->nodeWithAddress(&senderAddress); |
| 4159 | 4160 | ||
| 4160 | // parse the incoming stats data, and stick it into our averaging stats object for now... even though this | 4161 | // parse the incoming stats datas stick it in a temporary object for now, while we |
| 4161 | // means mixing in stats from potentially multiple servers. | 4162 | // determine which server it belongs to |
| 4162 | VoxelSceneStats temp; | 4163 | VoxelSceneStats temp; |
| 4163 | int statsMessageLength = temp.unpackFromMessage(messageData, messageLength); | 4164 | int statsMessageLength = temp.unpackFromMessage(messageData, messageLength); |
| 4164 | 4165 | ||
| @@ -4169,16 +4170,20 @@ int Application::parseVoxelStats(unsigned char* messageData, ssize_t messageLeng · 4 unmodified lines | |||
| 4169 | // now that we know the node ID, let's add these stats to the stats for that node... | 4170 | // now that we know the node ID, let's add these stats to the stats for that node... |
| 4170 | if (_voxelServerSceneStats.find(nodeUUID) != _voxelServerSceneStats.end()) { | 4171 | if (_voxelServerSceneStats.find(nodeUUID) != _voxelServerSceneStats.end()) { |
| 4171 | VoxelSceneStats& oldStats = _voxelServerSceneStats[nodeUUID]; | 4172 | VoxelSceneStats& oldStats = _voxelServerSceneStats[nodeUUID]; |
| 4173 | |||
| 4174 | // this if construct is a little strange because we aren't quite using it yet. But | ||
| 4175 | // we want to keep this logic in here for now because we plan to use it soon to determine | ||
| 4176 | // additional network optimization states and better rate control | ||
| 4172 | if (!oldStats.isMoving() && temp.isMoving()) { | 4177 | if (!oldStats.isMoving() && temp.isMoving()) { |
| 4178 | // we think we are starting to move | ||
| 4173 | _voxelServerSceneStats[nodeUUID].unpackFromMessage(messageData, messageLength); | 4179 | _voxelServerSceneStats[nodeUUID].unpackFromMessage(messageData, messageLength); |
| 4174 | //qDebug() << ">>>>>>>>>> STARTING!!! " << nodeUUID << " <<<<<<<<<<<\n"; | ||
| 4175 | } else if (oldStats.isMoving() && !temp.isMoving()) { | 4180 | } else if (oldStats.isMoving() && !temp.isMoving()) { |
| 4181 | // we think we are done moving | ||
| 4176 | _voxelServerSceneStats[nodeUUID].unpackFromMessage(messageData, messageLength); | 4182 | _voxelServerSceneStats[nodeUUID].unpackFromMessage(messageData, messageLength); |
| 4177 | //qDebug() << ">>>>>>>>>> FINISHED!!! " << nodeUUID << " <<<<<<<<<<<\n"; | ||
| 4178 | } else if (!oldStats.isMoving() && !temp.isMoving()) { | 4183 | } else if (!oldStats.isMoving() && !temp.isMoving()) { |
| 4179 | //qDebug() << ">>>>>>>>>> all still " << nodeUUID << " <<<<<<<<<<<\n"; | 4184 | // we think we are still not moving |
| 4180 | } else { | 4185 | } else { |
| 4181 | //qDebug() << ">>>>>>>>>> still moving... " << nodeUUID << " <<<<<<<<<<<\n"; | 4186 | // we think we are still moving |
| 4182 | } | 4187 | } |
| 4183 | 4188 | ||
| 4184 | } else { | 4189 | } else { |