mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-10 20:07:22 +02:00
minor cleanup and constency for packet stats
This commit is contained in:
parent
3226d33830
commit
badbe98097
1 changed files with 15 additions and 14 deletions
|
@ -160,13 +160,13 @@ int OctreeSendThread::handlePacketSend(SharedNodePointer node, OctreeQueryNode*
|
||||||
// copy octree message to back of stats message
|
// copy octree message to back of stats message
|
||||||
statsPacket.write(nodeData->getPacket().getData(), nodeData->getPacket().getDataSize());
|
statsPacket.write(nodeData->getPacket().getData(), nodeData->getPacket().getDataSize());
|
||||||
|
|
||||||
// since a stats message is only included on end of scene, don't consider any of these bytes "wasted", since
|
|
||||||
// there was nothing else to send.
|
|
||||||
int thisWastedBytes = 0;
|
|
||||||
int numBytes = statsPacket.getDataSize();
|
int numBytes = statsPacket.getDataSize();
|
||||||
_totalWastedBytes += thisWastedBytes;
|
|
||||||
_totalBytes += numBytes;
|
_totalBytes += numBytes;
|
||||||
_totalPackets++;
|
_totalPackets++;
|
||||||
|
// since a stats message is only included on end of scene, don't consider any of these bytes "wasted"
|
||||||
|
// there was nothing else to send.
|
||||||
|
int thisWastedBytes = 0;
|
||||||
|
//_totalWastedBytes += 0;
|
||||||
_trueBytesSent += numBytes;
|
_trueBytesSent += numBytes;
|
||||||
numPackets++;
|
numPackets++;
|
||||||
|
|
||||||
|
@ -198,13 +198,13 @@ int OctreeSendThread::handlePacketSend(SharedNodePointer node, OctreeQueryNode*
|
||||||
OctreeServer::didCallWriteDatagram(this);
|
OctreeServer::didCallWriteDatagram(this);
|
||||||
DependencyManager::get<NodeList>()->sendUnreliablePacket(statsPacket, *node);
|
DependencyManager::get<NodeList>()->sendUnreliablePacket(statsPacket, *node);
|
||||||
|
|
||||||
// since a stats message is only included on end of scene, don't consider any of these bytes "wasted", since
|
|
||||||
// there was nothing else to send.
|
|
||||||
int thisWastedBytes = 0;
|
|
||||||
int numBytes = statsPacket.getDataSize();
|
int numBytes = statsPacket.getDataSize();
|
||||||
_totalWastedBytes += thisWastedBytes;
|
|
||||||
_totalBytes += numBytes;
|
_totalBytes += numBytes;
|
||||||
_totalPackets++;
|
_totalPackets++;
|
||||||
|
// since a stats message is only included on end of scene, don't consider any of these bytes "wasted"
|
||||||
|
// there was nothing else to send.
|
||||||
|
int thisWastedBytes = 0;
|
||||||
|
//_totalWastedBytes += 0;
|
||||||
_trueBytesSent += numBytes;
|
_trueBytesSent += numBytes;
|
||||||
numPackets++;
|
numPackets++;
|
||||||
|
|
||||||
|
@ -230,10 +230,11 @@ int OctreeSendThread::handlePacketSend(SharedNodePointer node, OctreeQueryNode*
|
||||||
DependencyManager::get<NodeList>()->sendUnreliablePacket(nodeData->getPacket(), *node);
|
DependencyManager::get<NodeList>()->sendUnreliablePacket(nodeData->getPacket(), *node);
|
||||||
|
|
||||||
numBytes = nodeData->getPacket().getDataSize();
|
numBytes = nodeData->getPacket().getDataSize();
|
||||||
thisWastedBytes = udt::MAX_PACKET_SIZE - numBytes;
|
|
||||||
_totalWastedBytes += thisWastedBytes;
|
|
||||||
_totalBytes += numBytes;
|
_totalBytes += numBytes;
|
||||||
_totalPackets++;
|
_totalPackets++;
|
||||||
|
// since a stats message is only included on end of scene, don't consider any of these bytes "wasted"
|
||||||
|
// there was nothing else to send.
|
||||||
|
//_totalWastedBytes += 0;
|
||||||
_trueBytesSent += numBytes;
|
_trueBytesSent += numBytes;
|
||||||
numPackets++;
|
numPackets++;
|
||||||
|
|
||||||
|
@ -263,11 +264,12 @@ int OctreeSendThread::handlePacketSend(SharedNodePointer node, OctreeQueryNode*
|
||||||
DependencyManager::get<NodeList>()->sendUnreliablePacket(nodeData->getPacket(), *node);
|
DependencyManager::get<NodeList>()->sendUnreliablePacket(nodeData->getPacket(), *node);
|
||||||
|
|
||||||
int numBytes = nodeData->getPacket().getDataSize();
|
int numBytes = nodeData->getPacket().getDataSize();
|
||||||
int thisWastedBytes = udt::MAX_PACKET_SIZE - numBytes;
|
|
||||||
_totalWastedBytes += thisWastedBytes;
|
|
||||||
_totalBytes += numBytes;
|
_totalBytes += numBytes;
|
||||||
_totalPackets++;
|
_totalPackets++;
|
||||||
|
int thisWastedBytes = udt::MAX_PACKET_SIZE - numBytes;
|
||||||
|
_totalWastedBytes += thisWastedBytes;
|
||||||
numPackets++;
|
numPackets++;
|
||||||
|
_trueBytesSent += numBytes;
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
NLPacket& sentPacket = nodeData->getPacket();
|
NLPacket& sentPacket = nodeData->getPacket();
|
||||||
|
@ -285,7 +287,6 @@ int OctreeSendThread::handlePacketSend(SharedNodePointer node, OctreeQueryNode*
|
||||||
" size: " << numBytes << " [" << _totalBytes <<
|
" size: " << numBytes << " [" << _totalBytes <<
|
||||||
"] wasted bytes:" << thisWastedBytes << " [" << _totalWastedBytes << "]";
|
"] wasted bytes:" << thisWastedBytes << " [" << _totalWastedBytes << "]";
|
||||||
}
|
}
|
||||||
_trueBytesSent += numBytes;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -331,8 +332,8 @@ int OctreeSendThread::packetDistributor(SharedNodePointer node, OctreeQueryNode*
|
||||||
&& ((!viewFrustumChanged && nodeData->getViewFrustumJustStoppedChanging()) || nodeData->hasLodChanged()));
|
&& ((!viewFrustumChanged && nodeData->getViewFrustumJustStoppedChanging()) || nodeData->hasLodChanged()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// send any waiting packet
|
|
||||||
if (nodeData->isPacketWaiting()) {
|
if (nodeData->isPacketWaiting()) {
|
||||||
|
// send the waiting packet
|
||||||
_packetsSentThisInterval += handlePacketSend(node, nodeData);
|
_packetsSentThisInterval += handlePacketSend(node, nodeData);
|
||||||
} else {
|
} else {
|
||||||
nodeData->resetOctreePacket();
|
nodeData->resetOctreePacket();
|
||||||
|
|
Loading…
Reference in a new issue