mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-05 19:36:45 +02:00
Merge pull request #86 from daleglass-overte/fix_build_warnings-2
Fix build warnings, second iteration
This commit is contained in:
commit
e3e476918a
15 changed files with 234 additions and 193 deletions
|
@ -154,7 +154,7 @@ bool MixerAvatar::validateFSTHash(const QString& publicKey) const {
|
|||
}
|
||||
|
||||
QByteArray MixerAvatar::canonicalJson(const QString fstFile) {
|
||||
QStringList fstLines = fstFile.split("\n", QString::SkipEmptyParts);
|
||||
QStringList fstLines = fstFile.split("\n", Qt::SkipEmptyParts);
|
||||
static const QString fstKeywordsReg {
|
||||
"(marketplaceID|itemDescription|itemCategories|itemArtist|itemLicenseUrl|limitedRun|itemName|"
|
||||
"filename|texdir|script|editionNumber|certificateID)"
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include <QTimer>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonDocument>
|
||||
#include <QRandomGenerator>
|
||||
|
||||
#include <EntityTree.h>
|
||||
#include <ResourceCache.h>
|
||||
|
@ -412,8 +413,8 @@ QString EntityServer::serverSubclassStats() {
|
|||
|
||||
// display memory usage stats
|
||||
statsString += "<b>Entity Server Memory Statistics</b>\r\n";
|
||||
statsString += QString().sprintf("EntityTreeElement size... %ld bytes\r\n", sizeof(EntityTreeElement));
|
||||
statsString += QString().sprintf(" EntityItem size... %ld bytes\r\n", sizeof(EntityItem));
|
||||
statsString += QString("EntityTreeElement size... %1 bytes\r\n").arg(sizeof(EntityTreeElement));
|
||||
statsString += QString(" EntityItem size... %1 bytes\r\n").arg(sizeof(EntityItem));
|
||||
statsString += "\r\n\r\n";
|
||||
|
||||
statsString += "<b>Entity Server Sending to Viewer Statistics</b>\r\n";
|
||||
|
@ -475,7 +476,7 @@ void EntityServer::startDynamicDomainVerification() {
|
|||
EntityTreePointer tree = std::static_pointer_cast<EntityTree>(_tree);
|
||||
tree->startDynamicDomainVerificationOnServer((float) _MAXIMUM_DYNAMIC_DOMAIN_VERIFICATION_TIMER_MS / MSECS_PER_SECOND);
|
||||
|
||||
int nextInterval = qrand() % ((_MAXIMUM_DYNAMIC_DOMAIN_VERIFICATION_TIMER_MS + 1) - _MINIMUM_DYNAMIC_DOMAIN_VERIFICATION_TIMER_MS) + _MINIMUM_DYNAMIC_DOMAIN_VERIFICATION_TIMER_MS;
|
||||
int nextInterval = QRandomGenerator::global()->bounded(((_MAXIMUM_DYNAMIC_DOMAIN_VERIFICATION_TIMER_MS + 1) - _MINIMUM_DYNAMIC_DOMAIN_VERIFICATION_TIMER_MS) + _MINIMUM_DYNAMIC_DOMAIN_VERIFICATION_TIMER_MS);
|
||||
qCDebug(entities) << "Restarting Dynamic Domain Verification timer for" << nextInterval / 1000 << "seconds";
|
||||
_dynamicDomainVerificationTimer.start(nextInterval);
|
||||
}
|
||||
|
|
|
@ -403,13 +403,12 @@ bool OctreeServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
|||
statsString += "<b>Current Elements in scene:</b>\r\n";
|
||||
statsString += QString(" Total Elements: %1 nodes\r\n")
|
||||
.arg(locale.toString((uint)nodeCount).rightJustified(16, ' '));
|
||||
statsString += QString().sprintf(" Internal Elements: %s nodes (%5.2f%%)\r\n",
|
||||
locale.toString((uint)internalNodeCount).rightJustified(16,
|
||||
' ').toLocal8Bit().constData(),
|
||||
(double)((internalNodeCount / (float)nodeCount) * AS_PERCENT));
|
||||
statsString += QString().sprintf(" Leaf Elements: %s nodes (%5.2f%%)\r\n",
|
||||
locale.toString((uint)leafNodeCount).rightJustified(16, ' ').toLocal8Bit().constData(),
|
||||
(double)((leafNodeCount / (float)nodeCount) * AS_PERCENT));
|
||||
statsString += QString(" Internal Elements: %1 nodes (%2%)\r\n")
|
||||
.arg(locale.toString((uint)internalNodeCount).rightJustified(16, ' ').toLocal8Bit().constData())
|
||||
.arg((double)((internalNodeCount / (float)nodeCount) * AS_PERCENT), 5, 'f', 2);
|
||||
statsString += QString(" Leaf Elements: %s nodes (%5.2f%)\r\n")
|
||||
.arg(locale.toString((uint)leafNodeCount).rightJustified(16, ' ').toLocal8Bit().constData())
|
||||
.arg((double)((leafNodeCount / (float)nodeCount) * AS_PERCENT), 5, 'f', 2);
|
||||
statsString += "\r\n";
|
||||
statsString += "\r\n";
|
||||
|
||||
|
@ -442,14 +441,16 @@ bool OctreeServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
|||
.arg(locale.toString((uint)howManyThreadsDidCallWriteDatagram(oneSecondAgo)).rightJustified(COLUMN_WIDTH, ' '));
|
||||
|
||||
float averageLoopTime = getAverageLoopTime();
|
||||
statsString += QString().sprintf(" Average packetLoop() time: %7.2f msecs"
|
||||
" samples: %12d \r\n",
|
||||
(double)averageLoopTime, _averageLoopTime.getSampleCount());
|
||||
statsString += QString(" Average packetLoop() time: %1 msecs"
|
||||
" samples: %2\r\n")
|
||||
.arg((double)averageLoopTime, 7, 'f', 2)
|
||||
.arg(_averageLoopTime.getSampleCount(), 12);
|
||||
|
||||
float averageInsideTime = getAverageInsideTime();
|
||||
statsString += QString().sprintf(" Average 'inside' time: %9.2f usecs"
|
||||
" samples: %12d \r\n\r\n",
|
||||
(double)averageInsideTime, _averageInsideTime.getSampleCount());
|
||||
statsString += QString(" Average 'inside' time: %9.2f usecs"
|
||||
" samples: %12d \r\n\r\n")
|
||||
.arg((double)averageInsideTime, 9, 'f', 2)
|
||||
.arg(_averageInsideTime.getSampleCount(), 12);
|
||||
|
||||
|
||||
// Process Wait
|
||||
|
@ -457,162 +458,183 @@ bool OctreeServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
|||
int allWaitTimes = _extraLongProcessWait +_longProcessWait + _shortProcessWait + _noProcessWait;
|
||||
|
||||
float averageProcessWaitTime = getAverageProcessWaitTime();
|
||||
statsString += QString().sprintf(" Average process lock wait time:"
|
||||
" %9.2f usecs samples: %12d \r\n",
|
||||
(double)averageProcessWaitTime, allWaitTimes);
|
||||
statsString += QString(" Average process lock wait time:"
|
||||
" %1 usecs samples: %2 \r\n")
|
||||
.arg((double)averageProcessWaitTime, 9, 'g', 2)
|
||||
.arg(allWaitTimes, 12);
|
||||
|
||||
float zeroVsTotal = (allWaitTimes > 0) ? ((float)_noProcessWait / (float)allWaitTimes) : 0.0f;
|
||||
statsString += QString().sprintf(" No Lock Wait:"
|
||||
" (%6.2f%%) samples: %12d \r\n",
|
||||
(double)(zeroVsTotal * AS_PERCENT), _noProcessWait);
|
||||
statsString += QString(" No Lock Wait:"
|
||||
" (%1%) samples: %2 \r\n")
|
||||
.arg((double)(zeroVsTotal * AS_PERCENT), 6, 'g', 2)
|
||||
.arg(_noProcessWait, 12);
|
||||
|
||||
float shortVsTotal = (allWaitTimes > 0) ? ((float)_shortProcessWait / (float)allWaitTimes) : 0.0f;
|
||||
statsString += QString().sprintf(" Avg process lock short wait time:"
|
||||
" %9.2f usecs (%6.2f%%) samples: %12d \r\n",
|
||||
(double)_averageProcessShortWaitTime.getAverage(),
|
||||
(double)(shortVsTotal * AS_PERCENT), _shortProcessWait);
|
||||
statsString += QString(" Avg process lock short wait time:"
|
||||
" %1 usecs (%2%) samples: %3 \r\n")
|
||||
.arg((double)_averageProcessShortWaitTime.getAverage(), 9, 'f', 2)
|
||||
.arg((double)(shortVsTotal * AS_PERCENT), 6, 'f', 2)
|
||||
.arg(_shortProcessWait, 12);
|
||||
|
||||
float longVsTotal = (allWaitTimes > 0) ? ((float)_longProcessWait / (float)allWaitTimes) : 0.0f;
|
||||
statsString += QString().sprintf(" Avg process lock long wait time:"
|
||||
" %9.2f usecs (%6.2f%%) samples: %12d \r\n",
|
||||
(double)_averageProcessLongWaitTime.getAverage(),
|
||||
(double)(longVsTotal * AS_PERCENT), _longProcessWait);
|
||||
statsString += QString(" Avg process lock long wait time:"
|
||||
" %1 usecs (%2f%) samples: %3 \r\n")
|
||||
.arg(_averageProcessLongWaitTime.getAverage(), 9, 'f', 2)
|
||||
.arg((double)(longVsTotal * AS_PERCENT), 6, 'f', 2)
|
||||
.arg(_longProcessWait, 12);
|
||||
|
||||
float extraLongVsTotal = (allWaitTimes > 0) ? ((float)_extraLongProcessWait / (float)allWaitTimes) : 0.0f;
|
||||
statsString += QString().sprintf("Avg process lock extralong wait time:"
|
||||
" %9.2f usecs (%6.2f%%) samples: %12d \r\n\r\n",
|
||||
(double)_averageProcessExtraLongWaitTime.getAverage(),
|
||||
(double)(extraLongVsTotal * AS_PERCENT), _extraLongProcessWait);
|
||||
statsString += QString("Avg process lock extralong wait time:"
|
||||
" %1 usecs (%2%) samples: %3 \r\n\r\n")
|
||||
.arg((double)_averageProcessExtraLongWaitTime.getAverage(), 9, 'f', 2)
|
||||
.arg((double)(extraLongVsTotal * AS_PERCENT), 6, 'f', 2)
|
||||
.arg(_extraLongProcessWait, 12);
|
||||
}
|
||||
|
||||
// Tree Wait
|
||||
int allWaitTimes = _extraLongTreeWait +_longTreeWait + _shortTreeWait + _noTreeWait;
|
||||
|
||||
float averageTreeWaitTime = getAverageTreeWaitTime();
|
||||
statsString += QString().sprintf(" Average tree lock wait time:"
|
||||
" %9.2f usecs samples: %12d \r\n",
|
||||
(double)averageTreeWaitTime, allWaitTimes);
|
||||
statsString += QString(" Average tree lock wait time:"
|
||||
" %1 usecs samples: %2 \r\n")
|
||||
.arg((double)averageTreeWaitTime, 9, 'f', 2)
|
||||
.arg(allWaitTimes, 12);
|
||||
|
||||
float zeroVsTotal = (allWaitTimes > 0) ? ((float)_noTreeWait / (float)allWaitTimes) : 0.0f;
|
||||
statsString += QString().sprintf(" No Lock Wait:"
|
||||
" (%6.2f%%) samples: %12d \r\n",
|
||||
(double)(zeroVsTotal * AS_PERCENT), _noTreeWait);
|
||||
statsString += QString(" No Lock Wait:"
|
||||
" (%1%) samples: %2 \r\n")
|
||||
.arg((double)(zeroVsTotal * AS_PERCENT), 6, 'f', 2)
|
||||
.arg(_noTreeWait, 12);
|
||||
|
||||
float shortVsTotal = (allWaitTimes > 0) ? ((float)_shortTreeWait / (float)allWaitTimes) : 0.0f;
|
||||
statsString += QString().sprintf(" Avg tree lock short wait time:"
|
||||
" %9.2f usecs (%6.2f%%) samples: %12d \r\n",
|
||||
(double)_averageTreeShortWaitTime.getAverage(),
|
||||
(double)(shortVsTotal * AS_PERCENT), _shortTreeWait);
|
||||
statsString += QString(" Avg tree lock short wait time:"
|
||||
" %1 usecs (%2%) samples: %3 \r\n")
|
||||
.arg((double)_averageTreeShortWaitTime.getAverage(), 9, 'f', 2)
|
||||
.arg((double)(shortVsTotal * AS_PERCENT), 6, 'f', 2)
|
||||
.arg(_shortTreeWait, 12);
|
||||
|
||||
float longVsTotal = (allWaitTimes > 0) ? ((float)_longTreeWait / (float)allWaitTimes) : 0.0f;
|
||||
statsString += QString().sprintf(" Avg tree lock long wait time:"
|
||||
" %9.2f usecs (%6.2f%%) samples: %12d \r\n",
|
||||
(double)_averageTreeLongWaitTime.getAverage(),
|
||||
(double)(longVsTotal * AS_PERCENT), _longTreeWait);
|
||||
statsString += QString(" Avg tree lock long wait time:"
|
||||
" %1 usecs (%2f%) samples: %3 \r\n")
|
||||
.arg((double)_averageTreeLongWaitTime.getAverage(), 9, 'f', 2)
|
||||
.arg((double)(longVsTotal * AS_PERCENT), 6, 'g', 2)
|
||||
.arg(_longTreeWait, 12);
|
||||
|
||||
float extraLongVsTotal = (allWaitTimes > 0) ? ((float)_extraLongTreeWait / (float)allWaitTimes) : 0.0f;
|
||||
statsString += QString().sprintf(" Avg tree lock extra long wait time:"
|
||||
" %9.2f usecs (%6.2f%%) samples: %12d \r\n\r\n",
|
||||
(double)_averageTreeExtraLongWaitTime.getAverage(),
|
||||
(double)(extraLongVsTotal * AS_PERCENT), _extraLongTreeWait);
|
||||
statsString += QString(" Avg tree lock extra long wait time:"
|
||||
" %1 usecs (%2%) samples: %3 \r\n\r\n")
|
||||
.arg((double)_averageTreeExtraLongWaitTime.getAverage(), 9, 'f', 2)
|
||||
.arg((double)(extraLongVsTotal * AS_PERCENT), 6, 'f', 2)
|
||||
.arg(_extraLongTreeWait, 12);
|
||||
|
||||
// traverse
|
||||
float averageTreeTraverseTime = getAverageTreeTraverseTime();
|
||||
statsString += QString().sprintf(" Average tree traverse time: %9.2f usecs\r\n\r\n", (double)averageTreeTraverseTime);
|
||||
statsString += QString(" Average tree traverse time: %1 usecs\r\n\r\n")
|
||||
.arg((double)averageTreeTraverseTime, 9, 'f', 2);
|
||||
|
||||
// encode
|
||||
float averageEncodeTime = getAverageEncodeTime();
|
||||
statsString += QString().sprintf(" Average encode time: %9.2f usecs\r\n", (double)averageEncodeTime);
|
||||
statsString += QString(" Average encode time: %1 usecs\r\n")
|
||||
.arg((double)averageEncodeTime, 9, 'f', 2);
|
||||
|
||||
int allEncodeTimes = _noEncode + _shortEncode + _longEncode + _extraLongEncode;
|
||||
|
||||
float zeroVsTotalEncode = (allEncodeTimes > 0) ? ((float)_noEncode / (float)allEncodeTimes) : 0.0f;
|
||||
statsString += QString().sprintf(" No Encode:"
|
||||
" (%6.2f%%) samples: %12d \r\n",
|
||||
(double)(zeroVsTotalEncode * AS_PERCENT), _noEncode);
|
||||
statsString += QString(" No Encode:"
|
||||
" (%1f%) samples: %2 \r\n")
|
||||
.arg((double)(zeroVsTotalEncode * AS_PERCENT), 6, 'f', 2)
|
||||
.arg(_noEncode, 12);
|
||||
|
||||
float shortVsTotalEncode = (allEncodeTimes > 0) ? ((float)_shortEncode / (float)allEncodeTimes) : 0.0f;
|
||||
statsString += QString().sprintf(" Avg short encode time:"
|
||||
" %9.2f usecs (%6.2f%%) samples: %12d \r\n",
|
||||
(double)_averageShortEncodeTime.getAverage(),
|
||||
(double)(shortVsTotalEncode * AS_PERCENT), _shortEncode);
|
||||
statsString += QString(" Avg short encode time:"
|
||||
" %1 usecs (%2%) samples: %3 \r\n")
|
||||
.arg((double)_averageShortEncodeTime.getAverage(), 9, 'f', 2)
|
||||
.arg((double)(shortVsTotalEncode * AS_PERCENT), 6, 'f', 2)
|
||||
.arg(_shortEncode, 12);
|
||||
|
||||
float longVsTotalEncode = (allEncodeTimes > 0) ? ((float)_longEncode / (float)allEncodeTimes) : 0.0f;
|
||||
statsString += QString().sprintf(" Avg long encode time:"
|
||||
" %9.2f usecs (%6.2f%%) samples: %12d \r\n",
|
||||
(double)_averageLongEncodeTime.getAverage(),
|
||||
(double)(longVsTotalEncode * AS_PERCENT), _longEncode);
|
||||
statsString += QString(" Avg long encode time:"
|
||||
" %1 usecs (%2%) samples: %3 \r\n")
|
||||
.arg((double)_averageLongEncodeTime.getAverage(), 9, 'f', 2)
|
||||
.arg((double)(longVsTotalEncode * AS_PERCENT), 6, 'f', 2)
|
||||
.arg(_longEncode, 12);
|
||||
|
||||
float extraLongVsTotalEncode = (allEncodeTimes > 0) ? ((float)_extraLongEncode / (float)allEncodeTimes) : 0.0f;
|
||||
statsString += QString().sprintf(" Avg extra long encode time:"
|
||||
" %9.2f usecs (%6.2f%%) samples: %12d \r\n\r\n",
|
||||
(double)_averageExtraLongEncodeTime.getAverage(),
|
||||
(double)(extraLongVsTotalEncode * AS_PERCENT), _extraLongEncode);
|
||||
statsString += QString(" Avg extra long encode time:"
|
||||
" %1 usecs (%2%) samples: %3 \r\n\r\n")
|
||||
.arg((double)_averageExtraLongEncodeTime.getAverage(), 9, 'f', 2)
|
||||
.arg((double)(extraLongVsTotalEncode * AS_PERCENT), 6, 'f', 2)
|
||||
.arg(_extraLongEncode, 12);
|
||||
|
||||
|
||||
float averageCompressAndWriteTime = getAverageCompressAndWriteTime();
|
||||
statsString += QString().sprintf(" Average compress and write time: %9.2f usecs\r\n",
|
||||
(double)averageCompressAndWriteTime);
|
||||
statsString += QString(" Average compress and write time: %1 usecs\r\n")
|
||||
.arg((double)averageCompressAndWriteTime, 9, 'f', 2);
|
||||
|
||||
int allCompressTimes = _noCompress + _shortCompress + _longCompress + _extraLongCompress;
|
||||
|
||||
float zeroVsTotalCompress = (allCompressTimes > 0) ? ((float)_noCompress / (float)allCompressTimes) : 0.0f;
|
||||
statsString += QString().sprintf(" No compression:"
|
||||
" (%6.2f%%) samples: %12d \r\n",
|
||||
(double)(zeroVsTotalCompress * AS_PERCENT), _noCompress);
|
||||
statsString += QString(" No compression:"
|
||||
" (%1%) samples: %2 \r\n")
|
||||
.arg((double)(zeroVsTotalCompress * AS_PERCENT), 6, 'f', 2)
|
||||
.arg(_noCompress, 12);
|
||||
|
||||
float shortVsTotalCompress = (allCompressTimes > 0) ? ((float)_shortCompress / (float)allCompressTimes) : 0.0f;
|
||||
statsString += QString().sprintf(" Avg short compress time:"
|
||||
" %9.2f usecs (%6.2f%%) samples: %12d \r\n",
|
||||
(double)_averageShortCompressTime.getAverage(),
|
||||
(double)(shortVsTotalCompress * AS_PERCENT), _shortCompress);
|
||||
statsString += QString(" Avg short compress time:"
|
||||
" %1 usecs (%2%) samples: %3 \r\n")
|
||||
.arg((double)_averageShortCompressTime.getAverage(), 9, 'f', 2)
|
||||
.arg((double)(shortVsTotalCompress * AS_PERCENT), 6, 'f', 2)
|
||||
.arg(_shortCompress, 12);
|
||||
|
||||
float longVsTotalCompress = (allCompressTimes > 0) ? ((float)_longCompress / (float)allCompressTimes) : 0.0f;
|
||||
statsString += QString().sprintf(" Avg long compress time:"
|
||||
" %9.2f usecs (%6.2f%%) samples: %12d \r\n",
|
||||
(double)_averageLongCompressTime.getAverage(),
|
||||
(double)(longVsTotalCompress * AS_PERCENT), _longCompress);
|
||||
statsString += QString(" Avg long compress time:"
|
||||
" %1 usecs (%2%) samples: %3 \r\n")
|
||||
.arg((double)_averageLongCompressTime.getAverage(), 9, 'f', 2)
|
||||
.arg((double)(longVsTotalCompress * AS_PERCENT), 6, 'f', 2)
|
||||
.arg(_longCompress, 12);
|
||||
|
||||
float extraLongVsTotalCompress = (allCompressTimes > 0) ? ((float)_extraLongCompress / (float)allCompressTimes) : 0.0f;
|
||||
statsString += QString().sprintf(" Avg extra long compress time:"
|
||||
" %9.2f usecs (%6.2f%%) samples: %12d \r\n\r\n",
|
||||
(double)_averageExtraLongCompressTime.getAverage(),
|
||||
(double)(extraLongVsTotalCompress * AS_PERCENT), _extraLongCompress);
|
||||
statsString += QString(" Avg extra long compress time:"
|
||||
" %1 usecs (%2%) samples: %3 \r\n\r\n")
|
||||
.arg((double)_averageExtraLongCompressTime.getAverage(), 9, 'f', 2)
|
||||
.arg((double)(extraLongVsTotalCompress * AS_PERCENT), 6, 'f', 2)
|
||||
.arg(_extraLongCompress, 12);
|
||||
|
||||
float averagePacketSendingTime = getAveragePacketSendingTime();
|
||||
statsString += QString().sprintf(" Average packet sending time: %9.2f usecs (includes node lock)\r\n",
|
||||
(double)averagePacketSendingTime);
|
||||
statsString += QString(" Average packet sending time: %1 usecs (includes node lock)\r\n")
|
||||
.arg((double)averagePacketSendingTime, 9, 'f', 2);
|
||||
|
||||
float noVsTotalSend = (_averagePacketSendingTime.getSampleCount() > 0) ?
|
||||
((float)_noSend / (float)_averagePacketSendingTime.getSampleCount()) : 0.0f;
|
||||
statsString += QString().sprintf(" Not sending:"
|
||||
" (%6.2f%%) samples: %12d \r\n",
|
||||
(double)(noVsTotalSend * AS_PERCENT), _noSend);
|
||||
statsString += QString(" Not sending:"
|
||||
" (%1%) samples: %2 \r\n")
|
||||
.arg((double)(noVsTotalSend * AS_PERCENT), 6, 'f', 2)
|
||||
.arg(_noSend, 12);
|
||||
|
||||
float averageNodeWaitTime = getAverageNodeWaitTime();
|
||||
statsString += QString().sprintf(" Average node lock wait time: %9.2f usecs\r\n",
|
||||
(double)averageNodeWaitTime);
|
||||
statsString += QString(" Average node lock wait time: %1 usecs\r\n")
|
||||
.arg((double)averageNodeWaitTime, 9, 'f', 2);
|
||||
|
||||
statsString += QString().sprintf("--------------------------------------------------------------\r\n");
|
||||
statsString += QString("--------------------------------------------------------------\r\n");
|
||||
|
||||
float encodeToInsidePercent = averageInsideTime == 0.0f ? 0.0f : (averageEncodeTime / averageInsideTime) * AS_PERCENT;
|
||||
statsString += QString().sprintf(" encode ratio: %5.2f%%\r\n",
|
||||
(double)encodeToInsidePercent);
|
||||
statsString += QString(" encode ratio: %1%\r\n")
|
||||
.arg((double)encodeToInsidePercent, 5, 'f', 2);
|
||||
|
||||
float waitToInsidePercent = averageInsideTime == 0.0f ? 0.0f
|
||||
: ((averageTreeWaitTime + averageNodeWaitTime) / averageInsideTime) * AS_PERCENT;
|
||||
statsString += QString().sprintf(" waiting ratio: %5.2f%%\r\n",
|
||||
(double)waitToInsidePercent);
|
||||
statsString += QString(" waiting ratio: %1%\r\n")
|
||||
.arg((double)waitToInsidePercent, 5, 'f', 2);
|
||||
|
||||
float compressAndWriteToInsidePercent = averageInsideTime == 0.0f ? 0.0f
|
||||
: (averageCompressAndWriteTime / averageInsideTime) * AS_PERCENT;
|
||||
statsString += QString().sprintf(" compress and write ratio: %5.2f%%\r\n",
|
||||
(double)compressAndWriteToInsidePercent);
|
||||
statsString += QString(" compress and write ratio: %1%\r\n")
|
||||
.arg((double)compressAndWriteToInsidePercent, 5, 'f', 2);
|
||||
|
||||
float sendingToInsidePercent = averageInsideTime == 0.0f ? 0.0f
|
||||
: (averagePacketSendingTime / averageInsideTime) * AS_PERCENT;
|
||||
statsString += QString().sprintf(" sending ratio: %5.2f%%\r\n",
|
||||
(double)sendingToInsidePercent);
|
||||
statsString += QString(" sending ratio: %1f%\r\n")
|
||||
.arg((double)sendingToInsidePercent, 5, 'f', 2);
|
||||
|
||||
|
||||
|
||||
|
@ -630,23 +652,23 @@ bool OctreeServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
|||
|
||||
|
||||
statsString += QString(" Total Wasted Bytes: %1 bytes\r\n")
|
||||
.arg(locale.toString((uint)totalWastedBytes).rightJustified(COLUMN_WIDTH, ' '));
|
||||
statsString += QString().sprintf(" Total OctalCode Bytes: %s bytes (%5.2f%%)\r\n",
|
||||
locale.toString((uint)totalBytesOfOctalCodes).rightJustified(COLUMN_WIDTH, ' ').toLocal8Bit().constData(),
|
||||
(double)((totalBytesOfOctalCodes / (float)totalOutboundBytes) * AS_PERCENT));
|
||||
statsString += QString().sprintf(" Total BitMasks Bytes: %s bytes (%5.2f%%)\r\n",
|
||||
locale.toString((uint)totalBytesOfBitMasks).rightJustified(COLUMN_WIDTH, ' ').toLocal8Bit().constData(),
|
||||
(double)(((float)totalBytesOfBitMasks / (float)totalOutboundBytes) * AS_PERCENT));
|
||||
statsString += QString().sprintf(" Total Color Bytes: %s bytes (%5.2f%%)\r\n",
|
||||
locale.toString((uint)totalBytesOfColor).rightJustified(COLUMN_WIDTH, ' ').toLocal8Bit().constData(),
|
||||
(double)((totalBytesOfColor / (float)totalOutboundBytes) * AS_PERCENT));
|
||||
.arg(locale.toString((uint)totalWastedBytes).rightJustified(COLUMN_WIDTH, ' '));
|
||||
statsString += QString(" Total OctalCode Bytes: %1 bytes (%2%)\r\n")
|
||||
.arg(locale.toString((uint)totalBytesOfOctalCodes).rightJustified(COLUMN_WIDTH, ' ').toLocal8Bit().constData())
|
||||
.arg((double)((totalBytesOfOctalCodes / (float)totalOutboundBytes) * AS_PERCENT), 5, 'f', 2);
|
||||
statsString += QString(" Total BitMasks Bytes: %1 bytes (%2%)\r\n")
|
||||
.arg(locale.toString((uint)totalBytesOfBitMasks).rightJustified(COLUMN_WIDTH, ' ').toLocal8Bit().constData())
|
||||
.arg((double)(((float)totalBytesOfBitMasks / (float)totalOutboundBytes) * AS_PERCENT), 5, 'f', 2);
|
||||
statsString += QString(" Total Color Bytes: %1 bytes (%2%)\r\n")
|
||||
.arg(locale.toString((uint)totalBytesOfColor).rightJustified(COLUMN_WIDTH, ' ').toLocal8Bit().constData())
|
||||
.arg((double)((totalBytesOfColor / (float)totalOutboundBytes) * AS_PERCENT), 5, 'f', 2);
|
||||
|
||||
statsString += "\r\n";
|
||||
statsString += "\r\n";
|
||||
|
||||
// display inbound packet stats
|
||||
statsString += QString().sprintf("<b>%s Edit Statistics... <a href='/resetStats'>[RESET]</a></b>\r\n",
|
||||
getMyServerName());
|
||||
statsString += QString("<b>%1 Edit Statistics... <a href='/resetStats'>[RESET]</a></b>\r\n")
|
||||
.arg(getMyServerName());
|
||||
quint64 currentPacketsInQueue = _octreeInboundPacketProcessor->packetsToProcessCount();
|
||||
float incomingPPS = _octreeInboundPacketProcessor->getIncomingPPS();
|
||||
float processedPPS = _octreeInboundPacketProcessor->getProcessedPPS();
|
||||
|
@ -680,8 +702,8 @@ bool OctreeServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
|||
.arg(locale.toString((uint)totalPacketsProcessed).rightJustified(COLUMN_WIDTH, ' '));
|
||||
statsString += QString(" Total Inbound Elements: %1 elements\r\n")
|
||||
.arg(locale.toString((uint)totalElementsProcessed).rightJustified(COLUMN_WIDTH, ' '));
|
||||
statsString += QString().sprintf(" Average Inbound Elements/Packet: %f elements/packet\r\n",
|
||||
(double)averageElementsPerPacket);
|
||||
statsString += QString(" Average Inbound Elements/Packet: %f elements/packet\r\n")
|
||||
.arg((double)averageElementsPerPacket);
|
||||
statsString += QString(" Average Transit Time/Packet: %1 usecs\r\n")
|
||||
.arg(locale.toString((uint)averageTransitTimePerPacket).rightJustified(COLUMN_WIDTH, ' '));
|
||||
statsString += QString(" Average Process Time/Packet: %1 usecs\r\n")
|
||||
|
@ -741,8 +763,8 @@ bool OctreeServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
|||
.arg(locale.toString((uint)totalPacketsProcessed).rightJustified(COLUMN_WIDTH, ' '));
|
||||
statsString += QString(" Total Inbound Elements: %1 elements\r\n")
|
||||
.arg(locale.toString((uint)totalElementsProcessed).rightJustified(COLUMN_WIDTH, ' '));
|
||||
statsString += QString().sprintf(" Average Inbound Elements/Packet: %f elements/packet\r\n",
|
||||
(double)averageElementsPerPacket);
|
||||
statsString += QString(" Average Inbound Elements/Packet: %f elements/packet\r\n")
|
||||
.arg((double)averageElementsPerPacket);
|
||||
statsString += QString(" Average Transit Time/Packet: %1 usecs\r\n")
|
||||
.arg(locale.toString((uint)averageTransitTimePerPacket).rightJustified(COLUMN_WIDTH, ' '));
|
||||
statsString += QString(" Average Process Time/Packet: %1 usecs\r\n")
|
||||
|
@ -778,7 +800,7 @@ bool OctreeServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
|||
|
||||
// display memory usage stats
|
||||
statsString += "<b>Current Memory Usage Statistics</b>\r\n";
|
||||
statsString += QString().sprintf("\r\nOctreeElement size... %ld bytes\r\n", sizeof(OctreeElement));
|
||||
statsString += QString("\r\nOctreeElement size... %1 bytes\r\n").arg(sizeof(OctreeElement));
|
||||
statsString += "\r\n";
|
||||
|
||||
const char* memoryScaleLabel;
|
||||
|
@ -793,25 +815,29 @@ bool OctreeServer::handleHTTPRequest(HTTPConnection* connection, const QUrl& url
|
|||
memoryScale = GIGABYTES;
|
||||
}
|
||||
|
||||
statsString += QString().sprintf("Element Node Memory Usage: %8.2f %s\r\n",
|
||||
OctreeElement::getOctreeMemoryUsage() / (double)memoryScale, memoryScaleLabel);
|
||||
statsString += QString().sprintf("Octcode Memory Usage: %8.2f %s\r\n",
|
||||
OctreeElement::getOctcodeMemoryUsage() / (double)memoryScale, memoryScaleLabel);
|
||||
statsString += QString().sprintf("External Children Memory Usage: %8.2f %s\r\n",
|
||||
OctreeElement::getExternalChildrenMemoryUsage() / (double)memoryScale,
|
||||
memoryScaleLabel);
|
||||
statsString += QString("Element Node Memory Usage: %1 %2\r\n")
|
||||
.arg(OctreeElement::getOctreeMemoryUsage() / (double)memoryScale, 8, 'f', 2)
|
||||
.arg(memoryScaleLabel);
|
||||
statsString += QString("Octcode Memory Usage: %1 %2\r\n")
|
||||
.arg(OctreeElement::getOctcodeMemoryUsage() / (double)memoryScale, 8, 'f', 2)
|
||||
.arg(memoryScaleLabel);
|
||||
statsString += QString("External Children Memory Usage: %1 %2\r\n")
|
||||
.arg(OctreeElement::getExternalChildrenMemoryUsage() / (double)memoryScale, 8, 'f', 2)
|
||||
.arg(memoryScaleLabel);
|
||||
statsString += " -----------\r\n";
|
||||
statsString += QString().sprintf(" Total: %8.2f %s\r\n",
|
||||
OctreeElement::getTotalMemoryUsage() / (double)memoryScale, memoryScaleLabel);
|
||||
statsString += QString(" Total: %1 %2\r\n")
|
||||
.arg(OctreeElement::getTotalMemoryUsage() / (double)memoryScale, 8, 'f', 2)
|
||||
.arg(memoryScaleLabel);
|
||||
statsString += "\r\n";
|
||||
|
||||
statsString += "OctreeElement Children Population Statistics...\r\n";
|
||||
checkSum = 0;
|
||||
for (int i=0; i <= NUMBER_OF_CHILDREN; i++) {
|
||||
checkSum += OctreeElement::getChildrenCount(i);
|
||||
statsString += QString().sprintf(" Nodes with %d children: %s nodes (%5.2f%%)\r\n", i,
|
||||
locale.toString((uint)OctreeElement::getChildrenCount(i)).rightJustified(16, ' ').toLocal8Bit().constData(),
|
||||
(double)(((float)OctreeElement::getChildrenCount(i) / (float)nodeCount) * AS_PERCENT));
|
||||
statsString += QString(" Nodes with %1 children: %2 nodes (%3%)\r\n")
|
||||
.arg(i)
|
||||
.arg(locale.toString((uint)OctreeElement::getChildrenCount(i)).rightJustified(16, ' ').toLocal8Bit().constData())
|
||||
.arg((double)(((float)OctreeElement::getChildrenCount(i) / (float)nodeCount) * AS_PERCENT), 5, 'f', 2);
|
||||
}
|
||||
statsString += " ----------------------\r\n";
|
||||
statsString += QString(" Total: %1 nodes\r\n")
|
||||
|
@ -1346,7 +1372,7 @@ QString OctreeServer::getUptime() {
|
|||
if (hours > 0 || minutes > 0) {
|
||||
formattedUptime += QString(" ");
|
||||
}
|
||||
formattedUptime += QString().sprintf("%.3f seconds", (double)seconds);
|
||||
formattedUptime += QString("%1 seconds").arg((double)seconds, 0, 'f', 3);
|
||||
}
|
||||
return formattedUptime;
|
||||
}
|
||||
|
@ -1389,7 +1415,7 @@ QString OctreeServer::getFileLoadTime() {
|
|||
if (hours > 0 || minutes > 0) {
|
||||
result += QString(" ");
|
||||
}
|
||||
result += QString().sprintf("%.3f seconds", (double)seconds);
|
||||
result += QString("%1 seconds").arg((double)seconds, 0, 'f', 3);
|
||||
}
|
||||
} else {
|
||||
result = "Not yet loaded...";
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "DomainServer.h"
|
||||
#include "DomainServerNodeData.h"
|
||||
#include "WarningsSuppression.h"
|
||||
|
||||
using SharedAssignmentPointer = QSharedPointer<Assignment>;
|
||||
|
||||
|
@ -123,7 +124,7 @@ void DomainGatekeeper::processConnectRequestPacket(QSharedPointer<ReceivedMessag
|
|||
}
|
||||
}
|
||||
|
||||
node = processAgentConnectRequest(nodeConnection, username, usernameSignature,
|
||||
node = processAgentConnectRequest(nodeConnection, username, usernameSignature,
|
||||
domainUsername, domainTokens.value(0), domainTokens.value(1));
|
||||
}
|
||||
|
||||
|
@ -133,7 +134,7 @@ void DomainGatekeeper::processConnectRequestPacket(QSharedPointer<ReceivedMessag
|
|||
nodeData->setSendingSockAddr(message->getSenderSockAddr());
|
||||
|
||||
// guard against patched agents asking to hear about other agents
|
||||
auto safeInterestSet = nodeConnection.interestList.toSet();
|
||||
auto safeInterestSet = QSet<NodeType_t>(nodeConnection.interestList.begin(), nodeConnection.interestList.end());
|
||||
if (nodeConnection.nodeType == NodeType::Agent) {
|
||||
safeInterestSet.remove(NodeType::Agent);
|
||||
}
|
||||
|
@ -142,11 +143,11 @@ void DomainGatekeeper::processConnectRequestPacket(QSharedPointer<ReceivedMessag
|
|||
nodeData->setPlaceName(nodeConnection.placeName);
|
||||
|
||||
QMetaEnum metaEnum = QMetaEnum::fromType<LimitedNodeList::ConnectReason>();
|
||||
qDebug() << "Allowed connection from node" << uuidStringWithoutCurlyBraces(node->getUUID())
|
||||
<< "on" << message->getSenderSockAddr()
|
||||
<< "with MAC" << nodeConnection.hardwareAddress
|
||||
<< "and machine fingerprint" << nodeConnection.machineFingerprint
|
||||
<< "user" << username
|
||||
qDebug() << "Allowed connection from node" << uuidStringWithoutCurlyBraces(node->getUUID())
|
||||
<< "on" << message->getSenderSockAddr()
|
||||
<< "with MAC" << nodeConnection.hardwareAddress
|
||||
<< "and machine fingerprint" << nodeConnection.machineFingerprint
|
||||
<< "user" << username
|
||||
<< "reason" << QString(metaEnum.valueToKey(nodeConnection.connectReason))
|
||||
<< "previous connection uptime" << nodeConnection.previousConnectionUpTime/USECS_PER_MSEC << "msec"
|
||||
<< "sysinfo" << nodeConnection.SystemInfo;
|
||||
|
@ -163,7 +164,7 @@ void DomainGatekeeper::processConnectRequestPacket(QSharedPointer<ReceivedMessag
|
|||
}
|
||||
|
||||
NodePermissions DomainGatekeeper::setPermissionsForUser(bool isLocalUser, QString verifiedUsername,
|
||||
QString verifiedDomainUserName, const QHostAddress& senderAddress,
|
||||
QString verifiedDomainUserName, const QHostAddress& senderAddress,
|
||||
const QString& hardwareAddress, const QUuid& machineFingerprint) {
|
||||
NodePermissions userPerms;
|
||||
|
||||
|
@ -182,7 +183,7 @@ NodePermissions DomainGatekeeper::setPermissionsForUser(bool isLocalUser, QStrin
|
|||
auto userGroups = _domainGroupMemberships[verifiedDomainUserName];
|
||||
foreach (QString userGroup, userGroups) {
|
||||
// A domain group is signified by a leading special character, "@".
|
||||
// Multiple domain groups may be specified in one domain server setting as a comma- and/or space-separated lists of
|
||||
// Multiple domain groups may be specified in one domain server setting as a comma- and/or space-separated lists of
|
||||
// domain group names. For example, "@silver @Gold, @platinum".
|
||||
auto domainGroups = _server->_settingsManager.getDomainServerGroupNames()
|
||||
.filter(QRegularExpression("^(.*[\\s,])?" + QRegularExpression::escape(userGroup) + "([\\s,].*)?$",
|
||||
|
@ -303,7 +304,7 @@ NodePermissions DomainGatekeeper::setPermissionsForUser(bool isLocalUser, QStrin
|
|||
auto userGroups = _domainGroupMemberships[verifiedDomainUserName];
|
||||
foreach(QString userGroup, userGroups) {
|
||||
// A domain group is signified by a leading special character, "@".
|
||||
// Multiple domain groups may be specified in one domain server setting as a comma- and/or space-separated lists of
|
||||
// Multiple domain groups may be specified in one domain server setting as a comma- and/or space-separated lists of
|
||||
// domain group names. For example, "@silver @Gold, @platinum".
|
||||
auto domainGroups = _server->_settingsManager.getDomainServerBlacklistGroupNames()
|
||||
.filter(QRegularExpression("^(.*[\\s,])?" + QRegularExpression::escape(userGroup) + "([\\s,].*)?$",
|
||||
|
@ -374,7 +375,7 @@ void DomainGatekeeper::updateNodePermissions() {
|
|||
sendingAddress == QHostAddress::LocalHost);
|
||||
}
|
||||
|
||||
userPerms = setPermissionsForUser(isLocalUser, verifiedUsername, verifiedDomainUserName,
|
||||
userPerms = setPermissionsForUser(isLocalUser, verifiedUsername, verifiedDomainUserName,
|
||||
connectingAddr.getAddress(), hardwareAddress, machineFingerprint);
|
||||
}
|
||||
|
||||
|
@ -531,7 +532,7 @@ SharedNodePointer DomainGatekeeper::processAgentConnectRequest(const NodeConnect
|
|||
qDebug() << "Stalling login because we haven't authenticated user yet:" << domainUsername;
|
||||
#endif
|
||||
|
||||
} else if (verifyDomainUserIdentity(domainUsername, domainAccessToken, domainRefreshToken,
|
||||
} else if (verifyDomainUserIdentity(domainUsername, domainAccessToken, domainRefreshToken,
|
||||
nodeConnection.senderSockAddr)) {
|
||||
// User's domain identity is confirmed.
|
||||
verifiedDomainUsername = domainUsername;
|
||||
|
@ -564,7 +565,7 @@ SharedNodePointer DomainGatekeeper::processAgentConnectRequest(const NodeConnect
|
|||
}
|
||||
|
||||
sendConnectionDeniedPacket("You lack the required domain permissions to connect to this domain.",
|
||||
nodeConnection.senderSockAddr, DomainHandler::ConnectionRefusedReason::NotAuthorizedDomain,
|
||||
nodeConnection.senderSockAddr, DomainHandler::ConnectionRefusedReason::NotAuthorizedDomain,
|
||||
domainAuthURL + "|" + domainAuthClientID);
|
||||
} else {
|
||||
sendConnectionDeniedPacket("You lack the required metaverse permissions to connect to this domain.",
|
||||
|
@ -705,6 +706,8 @@ bool DomainGatekeeper::verifyUserSignature(const QString& username,
|
|||
|
||||
const unsigned char* publicKeyData = reinterpret_cast<const unsigned char*>(publicKeyArray.constData());
|
||||
|
||||
OVERTE_IGNORE_DEPRECATED_BEGIN
|
||||
|
||||
// first load up the public key into an RSA struct
|
||||
RSA* rsaPublicKey = d2i_RSA_PUBKEY(NULL, &publicKeyData, publicKeyArray.size());
|
||||
|
||||
|
@ -746,6 +749,8 @@ bool DomainGatekeeper::verifyUserSignature(const QString& username,
|
|||
RSA_free(rsaPublicKey);
|
||||
}
|
||||
|
||||
OVERTE_IGNORE_DEPRECATED_END
|
||||
|
||||
} else {
|
||||
|
||||
// we can't let this user in since we couldn't convert their public key to an RSA key we could use
|
||||
|
@ -766,7 +771,7 @@ bool DomainGatekeeper::verifyUserSignature(const QString& username,
|
|||
}
|
||||
|
||||
|
||||
bool DomainGatekeeper::needToVerifyDomainUserIdentity(const QString& username, const QString& accessToken,
|
||||
bool DomainGatekeeper::needToVerifyDomainUserIdentity(const QString& username, const QString& accessToken,
|
||||
const QString& refreshToken) {
|
||||
return !_verifiedDomainUserIdentities.contains(username)
|
||||
|| _verifiedDomainUserIdentities.value(username) != QPair<QString, QString>(accessToken, refreshToken);
|
||||
|
@ -1034,7 +1039,7 @@ void DomainGatekeeper::getGroupMemberships(const QString& username) {
|
|||
return;
|
||||
}
|
||||
|
||||
QJsonArray groupIDs = QJsonArray::fromStringList(groupIDSet.toList());
|
||||
QJsonArray groupIDs = QJsonArray::fromStringList(groupIDSet.values());
|
||||
json["groups"] = groupIDs;
|
||||
|
||||
// if we've already asked, wait for the answer before asking again
|
||||
|
@ -1298,7 +1303,7 @@ void DomainGatekeeper::requestDomainUserFinished() {
|
|||
|
||||
} else {
|
||||
// Failure.
|
||||
qDebug() << "Error in response for user details -" << httpStatus << requestReply->error()
|
||||
qDebug() << "Error in response for user details -" << httpStatus << requestReply->error()
|
||||
<< "-" << rootObject["error"].toString() << rootObject["error_description"].toString();
|
||||
|
||||
_inFlightDomainUserIdentityRequests.clear();
|
||||
|
|
|
@ -910,7 +910,7 @@ void DomainServer::setUpWebRTCSignalingServer() {
|
|||
auto limitedNodeList = DependencyManager::get<LimitedNodeList>();
|
||||
|
||||
// Route inbound WebRTC signaling messages received from user clients.
|
||||
connect(_webrtcSignalingServer.get(), &WebRTCSignalingServer::messageReceived,
|
||||
connect(_webrtcSignalingServer.get(), &WebRTCSignalingServer::messageReceived,
|
||||
this, &DomainServer::routeWebRTCSignalingMessage);
|
||||
|
||||
// Route domain server signaling messages.
|
||||
|
@ -922,9 +922,9 @@ void DomainServer::setUpWebRTCSignalingServer() {
|
|||
// Forward signaling messages received from assignment clients to user client.
|
||||
PacketReceiver& packetReceiver = limitedNodeList->getPacketReceiver();
|
||||
packetReceiver.registerListener(PacketType::WebRTCSignaling,
|
||||
PacketReceiver::makeUnsourcedListenerReference<DomainServer>(this,
|
||||
PacketReceiver::makeUnsourcedListenerReference<DomainServer>(this,
|
||||
&DomainServer::forwardAssignmentClientSignalingMessageToUserClient));
|
||||
connect(this, &DomainServer::webrtcSignalingMessageForUserClient,
|
||||
connect(this, &DomainServer::webrtcSignalingMessageForUserClient,
|
||||
_webrtcSignalingServer.get(), &WebRTCSignalingServer::sendMessage);
|
||||
}
|
||||
|
||||
|
@ -1247,7 +1247,7 @@ void DomainServer::processListRequestPacket(QSharedPointer<ReceivedMessage> mess
|
|||
}
|
||||
|
||||
// guard against patched agents asking to hear about other agents
|
||||
auto safeInterestSet = nodeRequestData.interestList.toSet();
|
||||
auto safeInterestSet = QSet<NodeType_t>(nodeRequestData.interestList.begin(), nodeRequestData.interestList.end());
|
||||
if (sendingNode->getType() == NodeType::Agent) {
|
||||
safeInterestSet.remove(NodeType::Agent);
|
||||
}
|
||||
|
@ -3460,7 +3460,7 @@ void DomainServer::addStaticAssignmentsToQueue() {
|
|||
auto sharedAssignments = _allAssignments.values();
|
||||
|
||||
// sort the assignments to put the server/mixer assignments first
|
||||
qSort(sharedAssignments.begin(), sharedAssignments.end(), [](SharedAssignmentPointer a, SharedAssignmentPointer b){
|
||||
std::sort(sharedAssignments.begin(), sharedAssignments.end(), [](SharedAssignmentPointer a, SharedAssignmentPointer b){
|
||||
if (a->getType() == b->getType()) {
|
||||
return true;
|
||||
} else if (a->getType() != Assignment::AgentType && b->getType() != Assignment::AgentType) {
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
#include <QtCore/QVariant>
|
||||
|
||||
#include <udt/PacketHeaders.h>
|
||||
#include "WarningsSuppression.h"
|
||||
|
||||
|
||||
DomainServerNodeData::StringPairHash DomainServerNodeData::_overrideHash;
|
||||
|
||||
|
@ -26,9 +28,11 @@ DomainServerNodeData::DomainServerNodeData() {
|
|||
}
|
||||
|
||||
void DomainServerNodeData::updateJSONStats(QByteArray statsByteArray) {
|
||||
OVERTE_IGNORE_DEPRECATED_BEGIN
|
||||
auto document = QJsonDocument::fromBinaryData(statsByteArray);
|
||||
Q_ASSERT(document.isObject());
|
||||
_statsJSONObject = overrideValuesIfNeeded(document.object());
|
||||
OVERTE_IGNORE_DEPRECATED_END
|
||||
}
|
||||
|
||||
QJsonObject DomainServerNodeData::overrideValuesIfNeeded(const QJsonObject& newStats) {
|
||||
|
@ -36,7 +40,7 @@ QJsonObject DomainServerNodeData::overrideValuesIfNeeded(const QJsonObject& newS
|
|||
for (auto it = newStats.constBegin(); it != newStats.constEnd(); ++it) {
|
||||
const auto& key = it.key();
|
||||
const auto& value = it.value();
|
||||
|
||||
|
||||
auto overrideIt = value.isString() ? _overrideHash.find({key, value.toString()}) : _overrideHash.end();
|
||||
if (overrideIt != _overrideHash.end()) {
|
||||
// We have a match, override the value
|
||||
|
|
|
@ -486,7 +486,7 @@ void DomainServerSettingsManager::setupConfigMap(const QString& userConfigFilena
|
|||
QVariant* client_id = _configMap.valueForKeyPath(OAUTH_CLIENT_ID);
|
||||
if (client_id) {
|
||||
QVariant* oauthEnable = _configMap.valueForKeyPath(OAUTH_ENABLE, true);
|
||||
|
||||
|
||||
*oauthEnable = QVariant(true);
|
||||
}
|
||||
|
||||
|
@ -890,9 +890,9 @@ void DomainServerSettingsManager::processNodeKickRequestPacket(QSharedPointer<Re
|
|||
|
||||
bool hasOptionalBanParameters = false;
|
||||
int banParameters;
|
||||
bool banByUsername;
|
||||
bool banByFingerprint;
|
||||
bool banByIP;
|
||||
bool banByUsername = false;
|
||||
bool banByFingerprint = false;
|
||||
bool banByIP = false;
|
||||
// pull optional ban parameters from the packet
|
||||
if (message.data()->getSize() == (NUM_BYTES_RFC4122_UUID + sizeof(int))) {
|
||||
hasOptionalBanParameters = true;
|
||||
|
@ -970,7 +970,7 @@ void DomainServerSettingsManager::processNodeKickRequestPacket(QSharedPointer<Re
|
|||
banByIP = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (banByIP) {
|
||||
auto& kickAddress = matchingNode->getActiveSocket()
|
||||
? matchingNode->getActiveSocket()->getAddress()
|
||||
|
@ -1976,7 +1976,7 @@ QStringList DomainServerSettingsManager::getAllKnownGroupNames() {
|
|||
result += entry.first.first;
|
||||
}
|
||||
|
||||
return result.toList();
|
||||
return result.values();
|
||||
}
|
||||
|
||||
bool DomainServerSettingsManager::setGroupID(const QString& groupName, const QUuid& groupID) {
|
||||
|
@ -2225,7 +2225,7 @@ QList<QUuid> DomainServerSettingsManager::getGroupIDs() {
|
|||
result += _groupPermissions[groupKey]->getGroupID();
|
||||
}
|
||||
}
|
||||
return result.toList();
|
||||
return result.values();
|
||||
}
|
||||
|
||||
QList<QUuid> DomainServerSettingsManager::getBlacklistGroupIDs() {
|
||||
|
@ -2235,7 +2235,7 @@ QList<QUuid> DomainServerSettingsManager::getBlacklistGroupIDs() {
|
|||
result += _groupForbiddens[groupKey]->getGroupID();
|
||||
}
|
||||
}
|
||||
return result.toList();
|
||||
return result.values();
|
||||
}
|
||||
|
||||
QStringList DomainServerSettingsManager::getDomainServerGroupNames() {
|
||||
|
@ -2244,7 +2244,7 @@ QStringList DomainServerSettingsManager::getDomainServerGroupNames() {
|
|||
foreach(NodePermissionsKey groupKey, _groupPermissions.keys()) {
|
||||
result += _groupPermissions[groupKey]->getID();
|
||||
}
|
||||
return result.toList();
|
||||
return result.values();
|
||||
}
|
||||
|
||||
QStringList DomainServerSettingsManager::getDomainServerBlacklistGroupNames() {
|
||||
|
@ -2253,7 +2253,7 @@ QStringList DomainServerSettingsManager::getDomainServerBlacklistGroupNames() {
|
|||
foreach (NodePermissionsKey groupKey, _groupForbiddens.keys()) {
|
||||
result += _groupForbiddens[groupKey]->getID();
|
||||
}
|
||||
return result.toList();
|
||||
return result.values();
|
||||
}
|
||||
|
||||
void DomainServerSettingsManager::debugDumpGroupsState() {
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <MetaverseAPI.h>
|
||||
#include <udt/PacketHeaders.h>
|
||||
#include <SharedUtil.h>
|
||||
#include "WarningsSuppression.h"
|
||||
|
||||
const int CLEAR_INACTIVE_PEERS_INTERVAL_MSECS = 1 * 1000;
|
||||
const int PEER_SILENCE_THRESHOLD_MSECS = 5 * 1000;
|
||||
|
@ -44,7 +45,7 @@ IceServer::IceServer(int argc, char* argv[]) :
|
|||
|
||||
// set processPacket as the verified packet callback for the udt::Socket
|
||||
_serverSocket.setPacketHandler([this](std::unique_ptr<udt::Packet> packet) { processPacket(std::move(packet)); });
|
||||
|
||||
|
||||
// set packetVersionMatch as the verify packet operator for the udt::Socket
|
||||
using std::placeholders::_1;
|
||||
_serverSocket.setPacketFilterOperator(std::bind(&IceServer::packetVersionMatch, this, _1));
|
||||
|
@ -62,7 +63,7 @@ IceServer::IceServer(int argc, char* argv[]) :
|
|||
bool IceServer::packetVersionMatch(const udt::Packet& packet) {
|
||||
PacketType headerType = NLPacket::typeInHeader(packet);
|
||||
PacketVersion headerVersion = NLPacket::versionInHeader(packet);
|
||||
|
||||
|
||||
if (headerVersion == versionForPacketType(headerType)) {
|
||||
return true;
|
||||
} else {
|
||||
|
@ -73,10 +74,10 @@ bool IceServer::packetVersionMatch(const udt::Packet& packet) {
|
|||
void IceServer::processPacket(std::unique_ptr<udt::Packet> packet) {
|
||||
|
||||
auto nlPacket = NLPacket::fromBase(std::move(packet));
|
||||
|
||||
|
||||
// make sure that this packet at least looks like something we can read
|
||||
if (nlPacket->getPayloadSize() >= NLPacket::localHeaderSize(PacketType::ICEServerHeartbeat)) {
|
||||
|
||||
|
||||
if (nlPacket->getType() == PacketType::ICEServerHeartbeat) {
|
||||
SharedNetworkPeer peer = addOrUpdateHeartbeatingPeer(*nlPacket);
|
||||
if (peer) {
|
||||
|
@ -94,31 +95,31 @@ void IceServer::processPacket(std::unique_ptr<udt::Packet> packet) {
|
|||
}
|
||||
} else if (nlPacket->getType() == PacketType::ICEServerQuery) {
|
||||
QDataStream heartbeatStream(nlPacket.get());
|
||||
|
||||
|
||||
// this is a node hoping to connect to a heartbeating peer - do we have the heartbeating peer?
|
||||
QUuid senderUUID;
|
||||
heartbeatStream >> senderUUID;
|
||||
|
||||
|
||||
// pull the public and private sock addrs for this peer
|
||||
SockAddr publicSocket, localSocket;
|
||||
heartbeatStream >> publicSocket >> localSocket;
|
||||
|
||||
|
||||
// check if this node also included a UUID that they would like to connect to
|
||||
QUuid connectRequestID;
|
||||
heartbeatStream >> connectRequestID;
|
||||
|
||||
|
||||
SharedNetworkPeer matchingPeer = _activePeers.value(connectRequestID);
|
||||
|
||||
|
||||
if (matchingPeer) {
|
||||
|
||||
|
||||
qDebug() << "Sending information for peer" << connectRequestID << "to peer" << senderUUID;
|
||||
|
||||
|
||||
// we have the peer they want to connect to - send them pack the information for that peer
|
||||
sendPeerInformationPacket(*matchingPeer, &nlPacket->getSenderSockAddr());
|
||||
|
||||
|
||||
// we also need to send them to the active peer they are hoping to connect to
|
||||
// create a dummy peer object we can pass to sendPeerInformationPacket
|
||||
|
||||
|
||||
NetworkPeer dummyPeer(senderUUID, publicSocket, localSocket);
|
||||
sendPeerInformationPacket(dummyPeer, matchingPeer->getActiveSocket());
|
||||
} else {
|
||||
|
@ -160,7 +161,7 @@ SharedNetworkPeer IceServer::addOrUpdateHeartbeatingPeer(NLPacket& packet) {
|
|||
|
||||
// update our last heard microstamp for this network peer to now
|
||||
matchingPeer->setLastHeardMicrostamp(usecTimestampNow());
|
||||
|
||||
|
||||
return matchingPeer;
|
||||
} else {
|
||||
// not verified, return the empty peer object
|
||||
|
@ -179,6 +180,8 @@ bool IceServer::isVerifiedHeartbeat(const QUuid& domainID, const QByteArray& pla
|
|||
const auto rsaPublicKey = it->second.get();
|
||||
|
||||
if (rsaPublicKey) {
|
||||
OVERTE_IGNORE_DEPRECATED_BEGIN
|
||||
|
||||
auto hashedPlaintext = QCryptographicHash::hash(plaintext, QCryptographicHash::Sha256);
|
||||
int verificationResult = RSA_verify(NID_sha256,
|
||||
reinterpret_cast<const unsigned char*>(hashedPlaintext.constData()),
|
||||
|
@ -187,6 +190,7 @@ bool IceServer::isVerifiedHeartbeat(const QUuid& domainID, const QByteArray& pla
|
|||
signature.size(),
|
||||
rsaPublicKey);
|
||||
|
||||
OVERTE_IGNORE_DEPRECATED_END
|
||||
if (verificationResult == 1) {
|
||||
// this is the only success case - we return true here to indicate that the heartbeat is verified
|
||||
return true;
|
||||
|
@ -262,6 +266,7 @@ void IceServer::publicKeyReplyFinished(QNetworkReply* reply) {
|
|||
// convert the downloaded public key to an RSA struct, if possible
|
||||
const unsigned char* publicKeyData = reinterpret_cast<const unsigned char*>(apiPublicKey.constData());
|
||||
|
||||
OVERTE_IGNORE_DEPRECATED_BEGIN
|
||||
RSA* rsaPublicKey = d2i_RSA_PUBKEY(NULL, &publicKeyData, apiPublicKey.size());
|
||||
|
||||
if (rsaPublicKey) {
|
||||
|
@ -270,6 +275,7 @@ void IceServer::publicKeyReplyFinished(QNetworkReply* reply) {
|
|||
qWarning() << "Could not convert in-memory public key for" << domainID << "to usable RSA public key.";
|
||||
qWarning() << "Public key will be re-requested on next heartbeat.";
|
||||
}
|
||||
OVERTE_IGNORE_DEPRECATED_END
|
||||
|
||||
} else {
|
||||
qWarning() << "There was no public key present in response for domain with ID" << domainID;
|
||||
|
@ -296,7 +302,7 @@ void IceServer::sendPeerInformationPacket(const NetworkPeer& peer, const SockAdd
|
|||
|
||||
// get the byte array for this peer
|
||||
peerPacket->write(peer.toByteArray());
|
||||
|
||||
|
||||
// write the current packet
|
||||
_serverSocket.writePacket(*peerPacket, *destinationSockAddr);
|
||||
}
|
||||
|
|
|
@ -724,8 +724,6 @@ extern InputPluginList getInputPlugins();
|
|||
extern void saveInputPluginSettings(const InputPluginList& plugins);
|
||||
|
||||
bool setupEssentials(int& argc, char** argv, const QCommandLineParser& parser, bool runningMarkerExisted) {
|
||||
const char** constArgv = const_cast<const char**>(argv);
|
||||
|
||||
qInstallMessageHandler(messageHandler);
|
||||
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ int main(int argc, char** argv) {
|
|||
if (!destFolder.exists() && !destFolder.mkpath(".")) {
|
||||
throw std::runtime_error("failed to create output directory");
|
||||
}
|
||||
for (const auto ktxFile : SOURCE_FOLDER.entryInfoList(QStringList() << "*.ktx")) {
|
||||
for (const auto &ktxFile : SOURCE_FOLDER.entryInfoList(QStringList() << "*.ktx")) {
|
||||
processKtxFile(ktxFile);
|
||||
}
|
||||
qDebug() << "Done";
|
||||
|
|
|
@ -43,7 +43,7 @@ void AWSInterface::createWebPageFromResults(const QString& testResults,
|
|||
QStringList parts = testResults.split('/');
|
||||
QString zipFilename = parts[parts.length() - 1];
|
||||
|
||||
QStringList zipFolderNameParts = zipFilename.split(QRegExp("[\\(\\)\\[\\]]"), QString::SkipEmptyParts);
|
||||
QStringList zipFolderNameParts = zipFilename.split(QRegExp("[\\(\\)\\[\\]]"), Qt::SkipEmptyParts);
|
||||
|
||||
if (!QRegularExpression("TestResults--\\d{4}(-\\d\\d){2}_\\d\\d(-\\d\\d){2}").match(zipFolderNameParts[0]).hasMatch() ||
|
||||
!QRegularExpression("\\w").match(zipFolderNameParts[1]).hasMatch() || // build (local, build number or PR number)
|
||||
|
|
|
@ -532,9 +532,9 @@ const std::map<QString, ProfileCategory> propertyToProfileCategory = [](){
|
|||
}();
|
||||
|
||||
TestFilter::TestFilter(const QString& filterString) {
|
||||
auto filterParts = filterString.split(".", QString::SkipEmptyParts);
|
||||
auto filterParts = filterString.split(".", Qt::SkipEmptyParts);
|
||||
for (const auto& filterPart : filterParts) {
|
||||
QList<QString> allowedVariants = filterPart.split(",", QString::SkipEmptyParts);
|
||||
QList<QString> allowedVariants = filterPart.split(",", Qt::SkipEmptyParts);
|
||||
if (allowedVariants.empty()) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -321,13 +321,13 @@ void TestRunnerDesktop::saveExistingHighFidelityAppDataFolder() {
|
|||
dataDirectory = QDir::homePath() + "/Library/Application Support";
|
||||
#endif
|
||||
if (_runLatest->isChecked()) {
|
||||
_appDataFolder = dataDirectory + "/Vircadia";
|
||||
_appDataFolder.setPath(dataDirectory + "/Vircadia");
|
||||
} else {
|
||||
// We are running a PR build
|
||||
_appDataFolder = dataDirectory + "/Vircadia - " + getPRNumberFromURL(_url->text());
|
||||
_appDataFolder.setPath(dataDirectory + "/Vircadia - " + getPRNumberFromURL(_url->text()));
|
||||
}
|
||||
|
||||
_savedAppDataFolder = dataDirectory + "/" + UNIQUE_FOLDER_NAME;
|
||||
_savedAppDataFolder.setPath(dataDirectory + "/" + UNIQUE_FOLDER_NAME);
|
||||
if (QDir(_savedAppDataFolder).exists()) {
|
||||
_savedAppDataFolder.removeRecursively();
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "MaterialBaker.h"
|
||||
|
||||
BakerCLI::BakerCLI(OvenCLIApplication* parent) : QObject(parent) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
void BakerCLI::bakeFile(QUrl inputUrl, const QString& outputPath, const QString& type) {
|
||||
|
@ -43,7 +43,7 @@ void BakerCLI::bakeFile(QUrl inputUrl, const QString& outputPath, const QString&
|
|||
static const QString MATERIAL_EXTENSION { "material" };
|
||||
static const QString SCRIPT_EXTENSION { "js" };
|
||||
|
||||
_outputPath = outputPath;
|
||||
_outputPath.setPath(outputPath);
|
||||
|
||||
// create our appropiate baker
|
||||
if (type == MODEL_EXTENSION || type == FBX_EXTENSION) {
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "VHACDUtil.h"
|
||||
|
||||
#include <unordered_map>
|
||||
#include <algorithm>
|
||||
#include <QVector>
|
||||
|
||||
#include <NumericalConstants.h>
|
||||
|
@ -25,7 +26,7 @@ bool HFMModelLessThan(const HFMMesh& e1, const HFMMesh& e2) {
|
|||
return e1.meshIndex < e2.meshIndex;
|
||||
}
|
||||
void reSortHFMModelMeshes(HFMModel& hfmModel) {
|
||||
qSort(hfmModel.meshes.begin(), hfmModel.meshes.end(), HFMModelLessThan);
|
||||
std::sort(hfmModel.meshes.begin(), hfmModel.meshes.end(), HFMModelLessThan);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue