mirror of
https://github.com/overte-org/overte.git
synced 2025-04-26 00:56:17 +02:00
added additional flight time debugging
This commit is contained in:
parent
77636678a8
commit
3a16a4935d
1 changed files with 15 additions and 0 deletions
|
@ -4402,6 +4402,21 @@ void* Application::networkReceive(void* args) {
|
||||||
PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
|
PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
|
||||||
"Application::networkReceive()... _voxelProcessor.queueReceivedPacket()");
|
"Application::networkReceive()... _voxelProcessor.queueReceivedPacket()");
|
||||||
|
|
||||||
|
bool wantExtraDebugging = Menu::getInstance()->isOptionChecked(MenuOption::ExtraDebugging);
|
||||||
|
if (wantExtraDebugging && app->_incomingPacket[0] == PACKET_TYPE_VOXEL_DATA) {
|
||||||
|
int numBytesPacketHeader = numBytesForPacketHeader(app->_incomingPacket);
|
||||||
|
unsigned char* dataAt = app->_incomingPacket + numBytesPacketHeader;
|
||||||
|
dataAt += sizeof(VOXEL_PACKET_FLAGS);
|
||||||
|
VOXEL_PACKET_SEQUENCE sequence = (*(VOXEL_PACKET_SEQUENCE*)dataAt);
|
||||||
|
dataAt += sizeof(VOXEL_PACKET_SEQUENCE);
|
||||||
|
VOXEL_PACKET_SENT_TIME sentAt = (*(VOXEL_PACKET_SENT_TIME*)dataAt);
|
||||||
|
dataAt += sizeof(VOXEL_PACKET_SENT_TIME);
|
||||||
|
VOXEL_PACKET_SENT_TIME arrivedAt = usecTimestampNow();
|
||||||
|
int flightTime = arrivedAt - sentAt;
|
||||||
|
|
||||||
|
printf("got PACKET_TYPE_VOXEL_DATA, sequence:%d flightTime:%d\n", sequence, flightTime);
|
||||||
|
}
|
||||||
|
|
||||||
// add this packet to our list of voxel packets and process them on the voxel processing
|
// add this packet to our list of voxel packets and process them on the voxel processing
|
||||||
app->_voxelProcessor.queueReceivedPacket(senderAddress, app->_incomingPacket, bytesReceived);
|
app->_voxelProcessor.queueReceivedPacket(senderAddress, app->_incomingPacket, bytesReceived);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue