Showing the changes to interface/src/Application.cpp (1 of 7 files). Show all
Unified · Split
| @@ -4318,6 +4318,24 @@ void Application::nodeKilled(Node* node) { · 4317 unmodified lines | |||
| 4318 | } | 4318 | } |
| 4319 | } | 4319 | } |
| 4320 | 4320 | ||
| 4321 | void Application::trackIncomingVoxelPacket(unsigned char* messageData, ssize_t messageLength, | ||
| 4322 | sockaddr senderAddress, bool wasStatsPacket) { | ||
| 4323 | |||
| 4324 | // Attempt to identify the sender from it's address. | ||
| 4325 | Node* voxelServer = NodeList::getInstance()->nodeWithAddress(&senderAddress); | ||
| 4326 | if (voxelServer) { | ||
| 4327 | QUuid nodeUUID = voxelServer->getUUID(); | ||
| 4328 | |||
| 4329 | // now that we know the node ID, let's add these stats to the stats for that node... | ||
| 4330 | _voxelSceneStatsLock.lockForWrite(); | ||
| 4331 | if (_voxelServerSceneStats.find(nodeUUID) != _voxelServerSceneStats.end()) { | ||
| 4332 | VoxelSceneStats& stats = _voxelServerSceneStats[nodeUUID]; | ||
| 4333 | stats.trackIncomingVoxelPacket(messageData, messageLength, wasStatsPacket); | ||
| 4334 | } | ||
| 4335 | _voxelSceneStatsLock.unlock(); | ||
| 4336 | } | ||
| 4337 | } | ||
| 4338 | |||
| 4321 | int Application::parseVoxelStats(unsigned char* messageData, ssize_t messageLength, sockaddr senderAddress) { | 4339 | int Application::parseVoxelStats(unsigned char* messageData, ssize_t messageLength, sockaddr senderAddress) { |
| 4322 | 4340 | ||
| 4323 | // But, also identify the sender, and keep track of the contained jurisdiction root for this server | 4341 | // But, also identify the sender, and keep track of the contained jurisdiction root for this server |