From 50f0c90519c55b947773efc07486ef7a15dac8b6 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 23 Sep 2019 17:22:15 -0700 Subject: [PATCH 01/14] don't forget to cleanup expired mortal entities --- libraries/physics/src/PhysicalEntitySimulation.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/physics/src/PhysicalEntitySimulation.cpp b/libraries/physics/src/PhysicalEntitySimulation.cpp index 43ced16119..df8c3fa32e 100644 --- a/libraries/physics/src/PhysicalEntitySimulation.cpp +++ b/libraries/physics/src/PhysicalEntitySimulation.cpp @@ -75,7 +75,8 @@ void PhysicalEntitySimulation::removeEntityInternal(EntityItemPointer entity) { if (motionState) { removeOwnershipData(motionState); _entitiesToRemoveFromPhysics.insert(entity); - } else if (entity->isDead() && entity->getElement()) { + } + if (entity->isDead() && entity->getElement()) { _deadEntities.insert(entity); } } From 4f11e46b5e9e92d63fcfcd19f54d1353b1115a80 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Tue, 24 Sep 2019 16:39:59 -0700 Subject: [PATCH 02/14] Don't move Connection class to changed address until it's used --- assignment-client/src/avatars/MixerAvatar.cpp | 6 +++--- libraries/networking/src/udt/Connection.cpp | 8 +++----- libraries/networking/src/udt/Connection.h | 1 + libraries/networking/src/udt/Socket.cpp | 6 ++++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/assignment-client/src/avatars/MixerAvatar.cpp b/assignment-client/src/avatars/MixerAvatar.cpp index 97d28fa246..ac633d9388 100644 --- a/assignment-client/src/avatars/MixerAvatar.cpp +++ b/assignment-client/src/avatars/MixerAvatar.cpp @@ -38,7 +38,7 @@ MixerAvatar::MixerAvatar() { _pendingEvent = false; _verifyState = verificationFailed; _needsIdentityUpdate = true; - qCDebug(avatars) << "Dynamic verification TIMED-OUT for " << getDisplayName() << getSessionUUID(); + qCDebug(avatars) << "Dynamic verification TIMED-OUT for" << getDisplayName() << getSessionUUID(); } else { qCDebug(avatars) << "Ignoring timeout of avatar challenge"; } @@ -287,7 +287,7 @@ void MixerAvatar::processCertifyEvents() { << ":" << _dynamicMarketResponse; } } else { - qCDebug(avatars) << "Get owner status failed for " << getDisplayName() << _marketplaceIdFromURL << + qCDebug(avatars) << "Get owner status failed for" << getDisplayName() << _marketplaceIdFromURL << "message:" << responseJson["message"].toString(); _verifyState = error; } @@ -356,7 +356,7 @@ void MixerAvatar::processChallengeResponse(ReceivedMessage& response) { _verifyState = challengeResult ? verificationSucceeded : verificationFailed; _needsIdentityUpdate = true; if (_verifyState == verificationFailed) { - qCDebug(avatars) << "Dynamic verification FAILED for " << getDisplayName() << getSessionUUID(); + qCDebug(avatars) << "Dynamic verification FAILED for" << getDisplayName() << getSessionUUID(); } else { qCDebug(avatars) << "Dynamic verification SUCCEEDED for" << getDisplayName() << getSessionUUID(); } diff --git a/libraries/networking/src/udt/Connection.cpp b/libraries/networking/src/udt/Connection.cpp index 872ee4dd4c..338b95163f 100644 --- a/libraries/networking/src/udt/Connection.cpp +++ b/libraries/networking/src/udt/Connection.cpp @@ -269,7 +269,7 @@ bool Connection::processReceivedSequenceNumber(SequenceNumber sequenceNumber, in bool wasDuplicate = false; if (sequenceNumber > _lastReceivedSequenceNumber) { - // Update largest recieved sequence number + // Update largest received sequence number _lastReceivedSequenceNumber = sequenceNumber; } else { // Otherwise, it could be a resend, try and remove it from the loss list @@ -312,9 +312,7 @@ void Connection::processControl(ControlPacketPointer controlPacket) { // We're already in a state where we've received a handshake ack, so we are likely in a state // where the other end expired our connection. Let's reset. -#ifdef UDT_CONNECTION_DEBUG - qCDebug(networking) << "Got HandshakeRequest from" << _destination << ", stopping SendQueue"; -#endif + qCDebug(networking) << "Got HandshakeRequest from" << _destination << "while active, stopping SendQueue"; _hasReceivedHandshakeACK = false; stopSendQueue(); } @@ -333,7 +331,7 @@ void Connection::processACK(ControlPacketPointer controlPacket) { // validate that this isn't a BS ACK if (ack > getSendQueue().getCurrentSequenceNumber()) { // in UDT they specifically break the connection here - do we want to do anything? - Q_ASSERT_X(false, "Connection::processACK", "ACK recieved higher than largest sent sequence number"); + Q_ASSERT_X(false, "Connection::processACK", "ACK received higher than largest sent sequence number"); return; } diff --git a/libraries/networking/src/udt/Connection.h b/libraries/networking/src/udt/Connection.h index 47edb021c8..00d5beb5ab 100644 --- a/libraries/networking/src/udt/Connection.h +++ b/libraries/networking/src/udt/Connection.h @@ -73,6 +73,7 @@ public: void setMaxBandwidth(int maxBandwidth); void sendHandshakeRequest(); + bool hasReceivedHandshake() const { return _hasReceivedHandshake; } void recordSentUnreliablePackets(int wireSize, int payloadSize); void recordReceivedUnreliablePackets(int wireSize, int payloadSize); diff --git a/libraries/networking/src/udt/Socket.cpp b/libraries/networking/src/udt/Socket.cpp index 20cb30dbd8..5b3e2e1b5b 100644 --- a/libraries/networking/src/udt/Socket.cpp +++ b/libraries/networking/src/udt/Socket.cpp @@ -261,7 +261,7 @@ Connection* Socket::findOrCreateConnection(const HifiSockAddr& sockAddr, bool fi // we did not have a matching connection, time to see if we should make one if (filterCreate && _connectionCreationFilterOperator && !_connectionCreationFilterOperator(sockAddr)) { - // the connection creation filter did not allow us to create a new connection + // the connection creation filter did not allow us to create a new connectionclientHandshakeRequestComplete #ifdef UDT_CONNECTION_DEBUG qCDebug(networking) << "Socket::findOrCreateConnection refusing to create Connection class for" << sockAddr << "due to connection creation filter"; @@ -548,12 +548,14 @@ void Socket::handleRemoteAddressChange(HifiSockAddr previousAddress, HifiSockAdd Lock connectionsLock(_connectionsHashMutex); const auto connectionIter = _connectionsHash.find(previousAddress); - if (connectionIter != _connectionsHash.end()) { + // Don't move classes that are unused so far. + if (connectionIter != _connectionsHash.end() && connectionIter->second->hasReceivedHandshake()) { auto connection = move(connectionIter->second); _connectionsHash.erase(connectionIter); connection->setDestinationAddress(currentAddress); _connectionsHash[currentAddress] = move(connection); connectionsLock.unlock(); + qCDebug(networking) << "Moved Connection class from" << previousAddress << "to" << currentAddress; Lock sequenceNumbersLock(_unreliableSequenceNumbersMutex); const auto sequenceNumbersIter = _unreliableSequenceNumbers.find(previousAddress); From 5067729c5215aa9004523356f98ac2d6e8891286 Mon Sep 17 00:00:00 2001 From: Clement Date: Tue, 24 Sep 2019 16:25:44 -0700 Subject: [PATCH 03/14] Add flag for account settings feature --- interface/src/Application.cpp | 4 ++-- libraries/networking/src/AccountManager.cpp | 13 +++++++++++-- libraries/networking/src/AccountManager.h | 3 ++- tools/ac-client/src/ACClientApp.cpp | 2 +- tools/atp-client/src/ATPClientApp.cpp | 2 +- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index ef3aafef4f..6a320e53ee 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -856,9 +856,9 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { DependencyManager::set(); DependencyManager::set(); #if defined(Q_OS_ANDROID) - DependencyManager::set(); // use the default user agent getter + DependencyManager::set(true); // use the default user agent getter #else - DependencyManager::set(std::bind(&Application::getUserAgent, qApp)); + DependencyManager::set(true, std::bind(&Application::getUserAgent, qApp)); #endif DependencyManager::set(); DependencyManager::set(ScriptEngine::CLIENT_SCRIPT, defaultScriptsOverrideOption); diff --git a/libraries/networking/src/AccountManager.cpp b/libraries/networking/src/AccountManager.cpp index a31d117f59..3de39902b1 100644 --- a/libraries/networking/src/AccountManager.cpp +++ b/libraries/networking/src/AccountManager.cpp @@ -73,9 +73,10 @@ QJsonObject AccountManager::dataObjectFromResponse(QNetworkReply* requestReply) } } -AccountManager::AccountManager(UserAgentGetter userAgentGetter) : +AccountManager::AccountManager(bool accountSettingsEnabled, UserAgentGetter userAgentGetter) : _userAgentGetter(userAgentGetter), - _authURL() + _authURL(), + _accountSettingsEnabled(accountSettingsEnabled) { qRegisterMetaType("OAuthAccessToken"); qRegisterMetaTypeStreamOperators("OAuthAccessToken"); @@ -796,6 +797,10 @@ void AccountManager::requestProfileError(QNetworkReply::NetworkError error) { } void AccountManager::requestAccountSettings() { + if (!_accountSettingsEnabled) { + return; + } + QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance(); QUrl lockerURL = _authURL; @@ -840,6 +845,10 @@ void AccountManager::requestAccountSettingsError(QNetworkReply::NetworkError err } void AccountManager::postAccountSettings() { + if (!_accountSettingsEnabled) { + return; + } + if (_settings.lastChangeTimestamp() <= _lastSuccessfulSyncTimestamp && _lastSuccessfulSyncTimestamp != 0) { // Nothing changed, skipping settings post return; diff --git a/libraries/networking/src/AccountManager.h b/libraries/networking/src/AccountManager.h index f29221d671..8c7789c218 100644 --- a/libraries/networking/src/AccountManager.h +++ b/libraries/networking/src/AccountManager.h @@ -60,7 +60,7 @@ const auto DEFAULT_USER_AGENT_GETTER = []() -> QString { return HIGH_FIDELITY_US class AccountManager : public QObject, public Dependency { Q_OBJECT public: - AccountManager(UserAgentGetter userAgentGetter = DEFAULT_USER_AGENT_GETTER); + AccountManager(bool accountSettingsEnabled = false, UserAgentGetter userAgentGetter = DEFAULT_USER_AGENT_GETTER); QNetworkRequest createRequest(QString path, AccountManagerAuth::Type authType); Q_INVOKABLE void sendRequest(const QString& path, @@ -182,6 +182,7 @@ private: bool _limitedCommerce { false }; QString _configFileURL; + bool _accountSettingsEnabled { false }; AccountSettings _settings; quint64 _currentSyncTimestamp { 0 }; quint64 _lastSuccessfulSyncTimestamp { 0 }; diff --git a/tools/ac-client/src/ACClientApp.cpp b/tools/ac-client/src/ACClientApp.cpp index 6b781a5bea..24805a3348 100644 --- a/tools/ac-client/src/ACClientApp.cpp +++ b/tools/ac-client/src/ACClientApp.cpp @@ -100,7 +100,7 @@ ACClientApp::ACClientApp(int argc, char* argv[]) : DependencyManager::registerInheritance(); - DependencyManager::set([&]{ return QString("Mozilla/5.0 (HighFidelityACClient)"); }); + DependencyManager::set(false, [&]{ return QString("Mozilla/5.0 (HighFidelityACClient)"); }); DependencyManager::set(); DependencyManager::set(NodeType::Agent, listenPort); diff --git a/tools/atp-client/src/ATPClientApp.cpp b/tools/atp-client/src/ATPClientApp.cpp index 8c2fd44adf..b2e7db5c87 100644 --- a/tools/atp-client/src/ATPClientApp.cpp +++ b/tools/atp-client/src/ATPClientApp.cpp @@ -138,7 +138,7 @@ ATPClientApp::ATPClientApp(int argc, char* argv[]) : DependencyManager::registerInheritance(); DependencyManager::set(); - DependencyManager::set([&]{ return QString(HIGH_FIDELITY_ATP_CLIENT_USER_AGENT); }); + DependencyManager::set(false, [&]{ return QString(HIGH_FIDELITY_ATP_CLIENT_USER_AGENT); }); DependencyManager::set(); DependencyManager::set(NodeType::Agent, _listenPort); From 6d7f71199019ec5fb077e08f28bfcea2ca7ea944 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Wed, 25 Sep 2019 09:33:49 -0700 Subject: [PATCH 04/14] Remove typo that somehow got into a comment --- libraries/networking/src/udt/Socket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/networking/src/udt/Socket.cpp b/libraries/networking/src/udt/Socket.cpp index 5b3e2e1b5b..7e1ab02a76 100644 --- a/libraries/networking/src/udt/Socket.cpp +++ b/libraries/networking/src/udt/Socket.cpp @@ -261,7 +261,7 @@ Connection* Socket::findOrCreateConnection(const HifiSockAddr& sockAddr, bool fi // we did not have a matching connection, time to see if we should make one if (filterCreate && _connectionCreationFilterOperator && !_connectionCreationFilterOperator(sockAddr)) { - // the connection creation filter did not allow us to create a new connectionclientHandshakeRequestComplete + // the connection creation filter did not allow us to create a new connection #ifdef UDT_CONNECTION_DEBUG qCDebug(networking) << "Socket::findOrCreateConnection refusing to create Connection class for" << sockAddr << "due to connection creation filter"; From 434c63b7e3db6177b666899dfc864a686ebbf8da Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 25 Sep 2019 14:14:29 -0700 Subject: [PATCH 05/14] BUGZ-1381 - domain server creates blank/undefined group when adding groups --- domain-server/resources/web/js/base-settings.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/domain-server/resources/web/js/base-settings.js b/domain-server/resources/web/js/base-settings.js index 295013878c..d3f5baa2f9 100644 --- a/domain-server/resources/web/js/base-settings.js +++ b/domain-server/resources/web/js/base-settings.js @@ -250,14 +250,14 @@ $(document).ready(function(){ // set focus to the first input in the new row $target.closest('table').find('tr.inputs input:first').focus(); - } + } else { + var tableRows = sibling.parent(); + var tableBody = tableRows.parent(); - var tableRows = sibling.parent(); - var tableBody = tableRows.parent(); - - // if theres no more siblings, we should jump to a new row - if (sibling.next().length == 0 && tableRows.nextAll().length == 1) { - tableBody.find("." + Settings.ADD_ROW_BUTTON_CLASS).click(); + // if theres no more siblings, we should jump to a new row + if (sibling.next().length == 0 && tableRows.nextAll().length == 1) { + tableBody.find("." + Settings.ADD_ROW_BUTTON_CLASS).click(); + } } } From 85c9f4d95ffd28db06da307ce7cd91f05c5aa789 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Thu, 26 Sep 2019 12:10:59 -0700 Subject: [PATCH 06/14] Use the FCDEBUG mechanism to throttle udt::Socket log-spam --- libraries/networking/src/udt/Socket.cpp | 26 ++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/libraries/networking/src/udt/Socket.cpp b/libraries/networking/src/udt/Socket.cpp index 20cb30dbd8..ff64389a25 100644 --- a/libraries/networking/src/udt/Socket.cpp +++ b/libraries/networking/src/udt/Socket.cpp @@ -239,11 +239,21 @@ qint64 Socket::writeDatagram(const QByteArray& datagram, const HifiSockAddr& soc int pending = _udpSocket.bytesToWrite(); if (bytesWritten < 0 || pending) { int wsaError = 0; + static std::atomic previousWsaError = 0; #ifdef WIN32 wsaError = WSAGetLastError(); #endif - qCDebug(networking) << "udt::writeDatagram (" << _udpSocket.state() << sockAddr << ") error - " << wsaError << _udpSocket.error() << "(" << _udpSocket.errorString() << ")" + QString errorString; + QDebug(&errorString) << "udt::writeDatagram (" << _udpSocket.state() << sockAddr << ") error - " + << wsaError << _udpSocket.error() << "(" << _udpSocket.errorString() << ")" << (pending ? "pending bytes:" : "pending:") << pending; + + if (previousWsaError.exchange(wsaError) != wsaError) { + qCDebug(networking).noquote() << errorString; + } else { + HIFI_FCDEBUG(networking(), errorString.toLatin1().constData()); + } + #ifdef DEBUG_EVENT_QUEUE int nodeListQueueSize = ::hifi::qt::getEventQueueSize(thread()); qCDebug(networking) << "Networking queue size - " << nodeListQueueSize << "writing datagram to" << sockAddr; @@ -525,12 +535,22 @@ std::vector Socket::getConnectionSockAddrs() { void Socket::handleSocketError(QAbstractSocket::SocketError socketError) { int wsaError = 0; + static std::atomic previousWsaError = 0; #ifdef WIN32 wsaError = WSAGetLastError(); #endif int pending = _udpSocket.bytesToWrite(); - qCDebug(networking) << "udt::Socket (" << _udpSocket.state() << ") error - " << wsaError << socketError << "(" << _udpSocket.errorString() << ")" - << (pending ? "pending bytes:" : "pending:") << pending; + QString errorString; + QDebug(&errorString) << "udt::Socket (" << _udpSocket.state() << ") error - " << wsaError << socketError << + "(" << _udpSocket.errorString() << ")" << (pending ? "pending bytes:" : "pending:") + << pending; + + if (previousWsaError.exchange(wsaError) != wsaError) { + qCDebug(networking).noquote() << errorString; + } else { + HIFI_FCDEBUG(networking(), errorString.toLatin1().constData()); + } + #ifdef DEBUG_EVENT_QUEUE int nodeListQueueSize = ::hifi::qt::getEventQueueSize(thread()); qCDebug(networking) << "Networking queue size - " << nodeListQueueSize; From 1b064a0ebebbcaf370d314a851528da797429cba Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Thu, 26 Sep 2019 14:29:01 -0700 Subject: [PATCH 07/14] Fix Q key on first person cam. Let camera control flying Y axis --- interface/resources/controllers/keyboardMouse.json | 2 +- interface/src/avatar/MyAvatar.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/interface/resources/controllers/keyboardMouse.json b/interface/resources/controllers/keyboardMouse.json index ff02142891..0e80709f9c 100644 --- a/interface/resources/controllers/keyboardMouse.json +++ b/interface/resources/controllers/keyboardMouse.json @@ -4,7 +4,7 @@ { "from": "Keyboard.A", "when": ["Keyboard.RightMouseButton", "!Keyboard.Control"], "to": "Actions.LATERAL_LEFT" }, { "from": "Keyboard.D", "when": ["Keyboard.RightMouseButton", "!Keyboard.Control"], "to": "Actions.LATERAL_RIGHT" }, { "from": "Keyboard.E", "when": ["!Application.CameraSelfie", "!Application.CameraLookAt", "!Keyboard.Control"], "to": "Actions.LATERAL_RIGHT" }, - { "from": "Keyboard.Q", "when": ["!Application.CameraSelfie"," !Application.CameraLookAt", "!Keyboard.Control"], "to": "Actions.LATERAL_LEFT" }, + { "from": "Keyboard.Q", "when": ["!Application.CameraSelfie", "!Application.CameraLookAt", "!Keyboard.Control"], "to": "Actions.LATERAL_LEFT" }, { "from": "Keyboard.T", "when": "!Keyboard.Control", "to": "Actions.TogglePushToTalk" }, { "comment" : "Mouse turn need to be small continuous increments", diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 6f16e6e1bf..518aa4fe2c 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -2709,7 +2709,11 @@ void MyAvatar::updateMotors() { if (_motionBehaviors & AVATAR_MOTION_ACTION_MOTOR_ENABLED) { if (_characterController.getState() == CharacterController::State::Hover || _characterController.computeCollisionMask() == BULLET_COLLISION_MASK_COLLISIONLESS) { - motorRotation = getMyHead()->getHeadOrientation(); + if (qApp->getCamera().getMode() == CAMERA_MODE_LOOK_AT || qApp->getCamera().getMode() == CAMERA_MODE_SELFIE) { + motorRotation = getLookAtRotation(); + } else { + motorRotation = getMyHead()->getHeadOrientation(); + } } else { // non-hovering = walking: follow camera twist about vertical but not lift // we decompose camera's rotation and store the twist part in motorRotation @@ -3632,8 +3636,7 @@ void MyAvatar::updateOrientation(float deltaTime) { glm::vec3 targetPoint = eyesPosition + glm::normalize(cameraVector); const float LOOKAT_MIX_ALPHA = 0.25f; - - if (getDriveKey(TRANSLATE_Y) == 0.0f) { + if (!isFlying() || !hasDriveInput()) { // Approximate the head's look at vector to the camera look at vector with some delay. float mixAlpha = LOOKAT_MIX_ALPHA * timeScale; if (mixAlpha > 1.0f) { From ea23a82f3338cc6565630091f813cf9ddcfe7c1e Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Thu, 26 Sep 2019 15:14:47 -0700 Subject: [PATCH 08/14] Make mouse pitch less sensitive --- interface/resources/controllers/keyboardMouse.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/resources/controllers/keyboardMouse.json b/interface/resources/controllers/keyboardMouse.json index 0e80709f9c..1f7ea097da 100644 --- a/interface/resources/controllers/keyboardMouse.json +++ b/interface/resources/controllers/keyboardMouse.json @@ -198,7 +198,7 @@ "to": "Actions.DeltaPitch", "filters": [ - { "type": "scale", "scale": 0.3 } + { "type": "scale", "scale": 0.2 } ] }, @@ -207,7 +207,7 @@ "to": "Actions.DeltaPitch", "filters": [ - { "type": "scale", "scale": 0.3 } + { "type": "scale", "scale": 0.2 } ] }, From 97dab24a698195262b988fe9458369f962bac8bc Mon Sep 17 00:00:00 2001 From: Ken Cooke Date: Thu, 26 Sep 2019 15:45:26 -0700 Subject: [PATCH 09/14] Fix Android clang warnings due to unused compiler flags --- cmake/macros/SetupHifiLibrary.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/macros/SetupHifiLibrary.cmake b/cmake/macros/SetupHifiLibrary.cmake index 04687e2c84..108786a651 100644 --- a/cmake/macros/SetupHifiLibrary.cmake +++ b/cmake/macros/SetupHifiLibrary.cmake @@ -20,7 +20,7 @@ macro(SETUP_HIFI_LIBRARY) foreach(SRC ${AVX_SRCS}) if (WIN32) set_source_files_properties(${SRC} PROPERTIES COMPILE_FLAGS /arch:AVX) - elseif (APPLE OR UNIX) + elseif (APPLE OR (UNIX AND NOT ANDROID)) set_source_files_properties(${SRC} PROPERTIES COMPILE_FLAGS -mavx) endif() endforeach() @@ -30,7 +30,7 @@ macro(SETUP_HIFI_LIBRARY) foreach(SRC ${AVX2_SRCS}) if (WIN32) set_source_files_properties(${SRC} PROPERTIES COMPILE_FLAGS /arch:AVX2) - elseif (APPLE OR UNIX) + elseif (APPLE OR (UNIX AND NOT ANDROID)) set_source_files_properties(${SRC} PROPERTIES COMPILE_FLAGS "-mavx2 -mfma") endif() endforeach() @@ -44,7 +44,7 @@ macro(SETUP_HIFI_LIBRARY) if (COMPILER_SUPPORTS_AVX512) set_source_files_properties(${SRC} PROPERTIES COMPILE_FLAGS /arch:AVX512) endif() - elseif (APPLE OR UNIX) + elseif (APPLE OR (UNIX AND NOT ANDROID)) check_cxx_compiler_flag("-mavx512f" COMPILER_SUPPORTS_AVX512) if (COMPILER_SUPPORTS_AVX512) set_source_files_properties(${SRC} PROPERTIES COMPILE_FLAGS -mavx512f) From f17a1c17f300d8deb4c163de5271e3f1d64fd81f Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Thu, 26 Sep 2019 15:46:11 -0700 Subject: [PATCH 10/14] Only print Qt event-queue size on change of error code --- libraries/networking/src/udt/Socket.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/libraries/networking/src/udt/Socket.cpp b/libraries/networking/src/udt/Socket.cpp index ff64389a25..fb33b04838 100644 --- a/libraries/networking/src/udt/Socket.cpp +++ b/libraries/networking/src/udt/Socket.cpp @@ -250,14 +250,13 @@ qint64 Socket::writeDatagram(const QByteArray& datagram, const HifiSockAddr& soc if (previousWsaError.exchange(wsaError) != wsaError) { qCDebug(networking).noquote() << errorString; +#ifdef DEBUG_EVENT_QUEUE + int nodeListQueueSize = ::hifi::qt::getEventQueueSize(thread()); + qCDebug(networking) << "Networking queue size - " << nodeListQueueSize << "writing datagram to" << sockAddr; +#endif // DEBUG_EVENT_QUEUE } else { HIFI_FCDEBUG(networking(), errorString.toLatin1().constData()); } - -#ifdef DEBUG_EVENT_QUEUE - int nodeListQueueSize = ::hifi::qt::getEventQueueSize(thread()); - qCDebug(networking) << "Networking queue size - " << nodeListQueueSize << "writing datagram to" << sockAddr; -#endif // DEBUG_EVENT_QUEUE } return bytesWritten; @@ -547,14 +546,13 @@ void Socket::handleSocketError(QAbstractSocket::SocketError socketError) { if (previousWsaError.exchange(wsaError) != wsaError) { qCDebug(networking).noquote() << errorString; +#ifdef DEBUG_EVENT_QUEUE + int nodeListQueueSize = ::hifi::qt::getEventQueueSize(thread()); + qCDebug(networking) << "Networking queue size - " << nodeListQueueSize; +#endif // DEBUG_EVENT_QUEUE } else { HIFI_FCDEBUG(networking(), errorString.toLatin1().constData()); } - -#ifdef DEBUG_EVENT_QUEUE - int nodeListQueueSize = ::hifi::qt::getEventQueueSize(thread()); - qCDebug(networking) << "Networking queue size - " << nodeListQueueSize; -#endif // DEBUG_EVENT_QUEUE } void Socket::handleStateChanged(QAbstractSocket::SocketState socketState) { From 93a1cbdcf97650739cf85884e4ec0a51d95bc851 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Thu, 26 Sep 2019 16:45:29 -0700 Subject: [PATCH 11/14] Use direct initialization instead of copy initialization for atomics --- libraries/networking/src/udt/Socket.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/networking/src/udt/Socket.cpp b/libraries/networking/src/udt/Socket.cpp index fb33b04838..3e1a56de51 100644 --- a/libraries/networking/src/udt/Socket.cpp +++ b/libraries/networking/src/udt/Socket.cpp @@ -239,7 +239,7 @@ qint64 Socket::writeDatagram(const QByteArray& datagram, const HifiSockAddr& soc int pending = _udpSocket.bytesToWrite(); if (bytesWritten < 0 || pending) { int wsaError = 0; - static std::atomic previousWsaError = 0; + static std::atomic previousWsaError (0); #ifdef WIN32 wsaError = WSAGetLastError(); #endif @@ -534,7 +534,7 @@ std::vector Socket::getConnectionSockAddrs() { void Socket::handleSocketError(QAbstractSocket::SocketError socketError) { int wsaError = 0; - static std::atomic previousWsaError = 0; + static std::atomic previousWsaError(0); #ifdef WIN32 wsaError = WSAGetLastError(); #endif From cd6d9b57c47181bc361c8ceca5ed7f1a2f795b96 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 28 Sep 2019 11:26:38 +1200 Subject: [PATCH 12/14] Fix Blocks script displaying a blank page --- .../resources/qml/hifi/tablet/+webengine/BlocksWebView.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/tablet/+webengine/BlocksWebView.qml b/interface/resources/qml/hifi/tablet/+webengine/BlocksWebView.qml index 050515da37..e600924b42 100644 --- a/interface/resources/qml/hifi/tablet/+webengine/BlocksWebView.qml +++ b/interface/resources/qml/hifi/tablet/+webengine/BlocksWebView.qml @@ -1,6 +1,6 @@ import QtQuick 2.0 import QtWebEngine 1.5 -import "../../controls" as Controls +import "../../../controls" as Controls Controls.TabletWebView { profile: WebEngineProfile { httpUserAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36"} From 07d8013e21893af1bf656eac7812d30f73daa69e Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 28 Sep 2019 11:27:20 +1200 Subject: [PATCH 13/14] Don't display "CLOSE" and "BACK" buttons at top of Blocks screen --- unpublishedScripts/marketplace/blocks/blocksApp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unpublishedScripts/marketplace/blocks/blocksApp.js b/unpublishedScripts/marketplace/blocks/blocksApp.js index 813a77c74a..9c10ba8197 100644 --- a/unpublishedScripts/marketplace/blocks/blocksApp.js +++ b/unpublishedScripts/marketplace/blocks/blocksApp.js @@ -35,7 +35,7 @@ function onClicked() { if (!shown) { - tablet.gotoWebScreen(APP_URL, "", true); + tablet.gotoWebScreen(APP_URL, ""); } else { tablet.gotoHomeScreen(); } From 3d667b4a21ec926f6982aaefe8af8781e579c32b Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 28 Sep 2019 11:27:31 +1200 Subject: [PATCH 14/14] Deprecate tablet.gotoWebScreen()'s loadOtherBase parameter --- libraries/ui/src/ui/TabletScriptingInterface.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/ui/src/ui/TabletScriptingInterface.h b/libraries/ui/src/ui/TabletScriptingInterface.h index bae5eda29e..58596d6d92 100644 --- a/libraries/ui/src/ui/TabletScriptingInterface.h +++ b/libraries/ui/src/ui/TabletScriptingInterface.h @@ -279,6 +279,7 @@ public: * @param {string} [injectedJavaScriptUrl=""] - The URL of JavaScript to inject into the web page. * @param {boolean} [loadOtherBase=false] - If true, the web page or app is displayed in a frame with "back" * and "close" buttons. + *

Deprecated: This parameter is deprecated and will be removed.

*/ Q_INVOKABLE void gotoWebScreen(const QString& url); Q_INVOKABLE void gotoWebScreen(const QString& url, const QString& injectedJavaScriptUrl, bool loadOtherBase = false);