Showing the changes to interface/src/Application.cpp (1 of 1 file). Show all
Unified · Split
| @@ -4401,6 +4401,21 @@ void* Application::networkReceive(void* args) { · 4400 unmodified lines | ||
| 4401 | 4401 | case PACKET_TYPE_ENVIRONMENT_DATA: { |
| 4402 | 4402 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), |
| 4403 | 4403 | "Application::networkReceive()... _voxelProcessor.queueReceivedPacket()"); |
| 4404 | + | |
| 4405 | + bool wantExtraDebugging = Menu::getInstance()->isOptionChecked(MenuOption::ExtraDebugging); | |
| 4406 | + if (wantExtraDebugging && app->_incomingPacket[0] == PACKET_TYPE_VOXEL_DATA) { | |
| 4407 | + int numBytesPacketHeader = numBytesForPacketHeader(app->_incomingPacket); | |
| 4408 | + unsigned char* dataAt = app->_incomingPacket + numBytesPacketHeader; | |
| 4409 | + dataAt += sizeof(VOXEL_PACKET_FLAGS); | |
| 4410 | + VOXEL_PACKET_SEQUENCE sequence = (*(VOXEL_PACKET_SEQUENCE*)dataAt); | |
| 4411 | + dataAt += sizeof(VOXEL_PACKET_SEQUENCE); | |
| 4412 | + VOXEL_PACKET_SENT_TIME sentAt = (*(VOXEL_PACKET_SENT_TIME*)dataAt); | |
| 4413 | + dataAt += sizeof(VOXEL_PACKET_SENT_TIME); | |
| 4414 | + VOXEL_PACKET_SENT_TIME arrivedAt = usecTimestampNow(); | |
| 4415 | + int flightTime = arrivedAt - sentAt; | |
| 4416 | + | |
| 4417 | + printf("got PACKET_TYPE_VOXEL_DATA, sequence:%d flightTime:%d\n", sequence, flightTime); | |
| 4418 | + } | |
| 4404 | 4419 | |
| 4405 | 4420 | // add this packet to our list of voxel packets and process them on the voxel processing |
| 4406 | 4421 | app->_voxelProcessor.queueReceivedPacket(senderAddress, app->_incomingPacket, bytesReceived); |