diff --git a/assignment-client/src/octree/OctreeQueryNode.cpp b/assignment-client/src/octree/OctreeQueryNode.cpp index 372f15a76b..3531c3f9cb 100644 --- a/assignment-client/src/octree/OctreeQueryNode.cpp +++ b/assignment-client/src/octree/OctreeQueryNode.cpp @@ -384,7 +384,7 @@ bool OctreeQueryNode::hasNextNackedPacket() const { const QByteArray* OctreeQueryNode::getNextNackedPacket() { if (!_nackedSequenceNumbers.isEmpty()) { // could return null if packet is not in the history - return _sentPacketHistory.getPacket(_nackedSequenceNumbers.takeFirst()); + return _sentPacketHistory.getPacket(_nackedSequenceNumbers.dequeue()); } return NULL; } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 574df09ee2..3cfec3190e 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2099,7 +2099,7 @@ void Application::updateMyAvatar(float deltaTime) { { quint64 now = usecTimestampNow(); quint64 sinceLastNack = now - _lastNackTime; - const quint64 TOO_LONG_SINCE_LAST_NACK = 250 * MSECS_PER_SECOND; + const quint64 TOO_LONG_SINCE_LAST_NACK = 1 * USECS_PER_SECOND; if (sinceLastNack > TOO_LONG_SINCE_LAST_NACK) { _lastNackTime = now; sendNack(); @@ -2109,6 +2109,10 @@ void Application::updateMyAvatar(float deltaTime) { void Application::sendNack() { + if (Menu::getInstance()->isOptionChecked(MenuOption::DisableNackPackets)) { + return; + } + char packet[MAX_PACKET_SIZE]; NodeList* nodeList = NodeList::getInstance(); diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 0713b28f3d..f791d20588 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -394,6 +394,8 @@ Menu::Menu() : addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::AlignForearmsWithWrists, 0, true); addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::AlternateIK, 0, false); + addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::DisableNackPackets, 0, false); + addDisabledActionAndSeparator(developerMenu, "Testing"); QMenu* timingMenu = developerMenu->addMenu("Timing and Statistics Tools"); diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 0ee9450af5..69015a938b 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -321,6 +321,7 @@ namespace MenuOption { const QString DecreaseAvatarSize = "Decrease Avatar Size"; const QString DecreaseVoxelSize = "Decrease Voxel Size"; const QString DisableAutoAdjustLOD = "Disable Automatically Adjusting LOD"; + const QString DisableNackPackets = "Disable NACK Packets"; const QString DisplayFrustum = "Display Frustum"; const QString DisplayHands = "Display Hands"; const QString DisplayHandTargets = "Display Hand Targets";