Merge branch 'protocol' of https://github.com/Atlante45/hifi into atp

This commit is contained in:
Stephen Birarda 2015-07-09 11:36:21 -07:00
commit d3d3b84a20
3 changed files with 16 additions and 14 deletions

View file

@ -240,8 +240,9 @@ int OctreeInboundPacketProcessor::sendNackPackets() {
return 0; return 0;
} }
NLPacketList nackPacketList(_myServer->getMyEditNackType(); NLPacketList nackPacketList(_myServer->getMyEditNackType());
auto nodeList = DependencyManager::get<NodeList>(); auto nodeList = DependencyManager::get<NodeList>();
int packetsSent = 0;
NodeToSenderStatsMapIterator i = _singleSenderStats.begin(); NodeToSenderStatsMapIterator i = _singleSenderStats.begin();
while (i != _singleSenderStats.end()) { while (i != _singleSenderStats.end()) {
@ -275,20 +276,20 @@ int OctreeInboundPacketProcessor::sendNackPackets() {
while (it != missingSequenceNumbers.constEnd()) { while (it != missingSequenceNumbers.constEnd()) {
unsigned short int sequenceNumber = *it; unsigned short int sequenceNumber = *it;
nackPacketList->write(&sequenceNumber, sizeof(sequenceNumber)); nackPacketList.writePrimitive(sequenceNumber);
++it; ++it;
} }
packetsSent = nackPacketList.getNumPackets();
if (packetsSent) {
qDebug() << "NACK Sent back to editor/client... destinationNode=" << nodeUUID;
}
// send the list of nack packets
nodeList->sendPacketList(nackPacketList, destinationNode);
} }
int packetsSent = nackPacketList.getNumPackets();
if (packetsSent) {
qDebug() << "NACK Sent back to editor/client... destinationNode=" << nodeUUID;
}
// send the list of nack packets
nodeList->sendPacketList(nackPacketList, destinationNode);
return packetsSent; return packetsSent;
} }

View file

@ -46,7 +46,8 @@ public:
bool packetIsDuplicate() const; bool packetIsDuplicate() const;
bool shouldSuppressDuplicatePacket(); bool shouldSuppressDuplicatePacket();
unsigned int getAvailable() const { return _octreePacket->bytesAvailable(); }
int getMaxSearchLevel() const { return _maxSearchLevel; } int getMaxSearchLevel() const { return _maxSearchLevel; }
void resetMaxSearchLevel() { _maxSearchLevel = 1; } void resetMaxSearchLevel() { _maxSearchLevel = 1; }
void incrementMaxSearchLevel() { _maxSearchLevel++; } void incrementMaxSearchLevel() { _maxSearchLevel++; }

View file

@ -580,9 +580,9 @@ int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrus
// Here's where we can/should allow the server to send other data... // Here's where we can/should allow the server to send other data...
// send the environment packet // send the environment packet
// TODO: should we turn this into a while loop to better handle sending multiple special packets // TODO: should we turn this into a while loop to better handle sending multiple special packets
if (_myServer->hasSpecialPacketToSend(_node) && !nodeData->isShuttingDown()) { if (_myServer->hasSpecialPacketsToSend(_node) && !nodeData->isShuttingDown()) {
int specialPacketsSent; int specialPacketsSent;
trueBytesSent += _myServer->sendSpecialPacket(_node, nodeData, specialPacketsSent); trueBytesSent += _myServer->sendSpecialPackets(_node, nodeData, specialPacketsSent);
nodeData->resetOctreePacket(); // because nodeData's _sequenceNumber has changed nodeData->resetOctreePacket(); // because nodeData's _sequenceNumber has changed
truePacketsSent += specialPacketsSent; truePacketsSent += specialPacketsSent;
packetsSentThisInterval += specialPacketsSent; packetsSentThisInterval += specialPacketsSent;