mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 16:22:51 +02:00
Merge pull request #3007 from wangyix/master
Added Developer menu option to disable nack packets.
This commit is contained in:
commit
f3fb39574f
4 changed files with 9 additions and 2 deletions
|
@ -384,7 +384,7 @@ bool OctreeQueryNode::hasNextNackedPacket() const {
|
||||||
const QByteArray* OctreeQueryNode::getNextNackedPacket() {
|
const QByteArray* OctreeQueryNode::getNextNackedPacket() {
|
||||||
if (!_nackedSequenceNumbers.isEmpty()) {
|
if (!_nackedSequenceNumbers.isEmpty()) {
|
||||||
// could return null if packet is not in the history
|
// could return null if packet is not in the history
|
||||||
return _sentPacketHistory.getPacket(_nackedSequenceNumbers.takeFirst());
|
return _sentPacketHistory.getPacket(_nackedSequenceNumbers.dequeue());
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2099,7 +2099,7 @@ void Application::updateMyAvatar(float deltaTime) {
|
||||||
{
|
{
|
||||||
quint64 now = usecTimestampNow();
|
quint64 now = usecTimestampNow();
|
||||||
quint64 sinceLastNack = now - _lastNackTime;
|
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) {
|
if (sinceLastNack > TOO_LONG_SINCE_LAST_NACK) {
|
||||||
_lastNackTime = now;
|
_lastNackTime = now;
|
||||||
sendNack();
|
sendNack();
|
||||||
|
@ -2109,6 +2109,10 @@ void Application::updateMyAvatar(float deltaTime) {
|
||||||
|
|
||||||
void Application::sendNack() {
|
void Application::sendNack() {
|
||||||
|
|
||||||
|
if (Menu::getInstance()->isOptionChecked(MenuOption::DisableNackPackets)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
char packet[MAX_PACKET_SIZE];
|
char packet[MAX_PACKET_SIZE];
|
||||||
NodeList* nodeList = NodeList::getInstance();
|
NodeList* nodeList = NodeList::getInstance();
|
||||||
|
|
||||||
|
|
|
@ -394,6 +394,8 @@ Menu::Menu() :
|
||||||
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::AlignForearmsWithWrists, 0, true);
|
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::AlignForearmsWithWrists, 0, true);
|
||||||
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::AlternateIK, 0, false);
|
addCheckableActionToQMenuAndActionHash(handOptionsMenu, MenuOption::AlternateIK, 0, false);
|
||||||
|
|
||||||
|
addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::DisableNackPackets, 0, false);
|
||||||
|
|
||||||
addDisabledActionAndSeparator(developerMenu, "Testing");
|
addDisabledActionAndSeparator(developerMenu, "Testing");
|
||||||
|
|
||||||
QMenu* timingMenu = developerMenu->addMenu("Timing and Statistics Tools");
|
QMenu* timingMenu = developerMenu->addMenu("Timing and Statistics Tools");
|
||||||
|
|
|
@ -321,6 +321,7 @@ namespace MenuOption {
|
||||||
const QString DecreaseAvatarSize = "Decrease Avatar Size";
|
const QString DecreaseAvatarSize = "Decrease Avatar Size";
|
||||||
const QString DecreaseVoxelSize = "Decrease Voxel Size";
|
const QString DecreaseVoxelSize = "Decrease Voxel Size";
|
||||||
const QString DisableAutoAdjustLOD = "Disable Automatically Adjusting LOD";
|
const QString DisableAutoAdjustLOD = "Disable Automatically Adjusting LOD";
|
||||||
|
const QString DisableNackPackets = "Disable NACK Packets";
|
||||||
const QString DisplayFrustum = "Display Frustum";
|
const QString DisplayFrustum = "Display Frustum";
|
||||||
const QString DisplayHands = "Display Hands";
|
const QString DisplayHands = "Display Hands";
|
||||||
const QString DisplayHandTargets = "Display Hand Targets";
|
const QString DisplayHandTargets = "Display Hand Targets";
|
||||||
|
|
Loading…
Reference in a new issue