From 2d4da7ba714004415fff784294b5bbb5338dc5af Mon Sep 17 00:00:00 2001 From: Kalila L Date: Mon, 21 Jun 2021 13:22:48 -0400 Subject: [PATCH 01/44] Add disable domain port auto discovery by assignment client option. --- assignment-client/src/AssignmentClient.cpp | 24 ++++++++++++------- assignment-client/src/AssignmentClient.h | 7 +++--- assignment-client/src/AssignmentClientApp.cpp | 19 +++++++++++---- assignment-client/src/AssignmentClientApp.h | 2 ++ .../src/AssignmentClientMonitor.cpp | 12 +++++++--- .../src/AssignmentClientMonitor.h | 6 +++-- libraries/networking/src/NodeList.cpp | 18 +++++++------- libraries/networking/src/NodeList.h | 5 +++- 8 files changed, 62 insertions(+), 31 deletions(-) diff --git a/assignment-client/src/AssignmentClient.cpp b/assignment-client/src/AssignmentClient.cpp index adc7f5e3c5..8e44cdd157 100644 --- a/assignment-client/src/AssignmentClient.cpp +++ b/assignment-client/src/AssignmentClient.cpp @@ -44,7 +44,8 @@ const long long ASSIGNMENT_REQUEST_INTERVAL_MSECS = 1 * 1000; AssignmentClient::AssignmentClient(Assignment::Type requestAssignmentType, QString assignmentPool, quint16 listenPort, QUuid walletUUID, QString assignmentServerHostname, - quint16 assignmentServerPort, quint16 assignmentMonitorPort) : + quint16 assignmentServerPort, quint16 assignmentMonitorPort, + bool disableDomainPortAutoDiscovery) : _assignmentServerHostname(DEFAULT_ASSIGNMENT_SERVER_HOSTNAME) { LogUtils::init(); @@ -89,6 +90,13 @@ AssignmentClient::AssignmentClient(Assignment::Type requestAssignmentType, QStri _assignmentServerSocket.setObjectName("AssignmentServer"); nodeList->setAssignmentServerSocket(_assignmentServerSocket); + if (disableDomainPortAutoDiscovery == true) { + _disableDomainPortAutoDiscovery = disableDomainPortAutoDiscovery; + qCDebug(assignment_client) << "Disabling domain port auto discovery by the assignment client due to parsed command line parameter."; + } + + nodeList->setDomainPortAutoDiscovery(_disableDomainPortAutoDiscovery); + qCDebug(assignment_client) << "Assignment server socket is" << _assignmentServerSocket; // call a timer function every ASSIGNMENT_REQUEST_INTERVAL_MSECS to ask for assignment, if required @@ -164,7 +172,7 @@ void AssignmentClient::setUpStatusToMonitor() { void AssignmentClient::sendStatusPacketToACM() { // tell the assignment client monitor what this assignment client is doing (if anything) auto nodeList = DependencyManager::get(); - + quint8 assignmentType = Assignment::Type::AllTypes; if (_currentAssignment) { @@ -175,7 +183,7 @@ void AssignmentClient::sendStatusPacketToACM() { statusPacket->write(_childAssignmentUUID.toRfc4122()); statusPacket->writePrimitive(assignmentType); - + nodeList->sendPacket(std::move(statusPacket), _assignmentClientMonitorSocket); } @@ -185,7 +193,7 @@ void AssignmentClient::sendAssignmentRequest() { auto nodeList = DependencyManager::get(); - if (_assignmentServerHostname == "localhost") { + if (_assignmentServerHostname == "localhost" && _disableDomainPortAutoDiscovery == false) { // we want to check again for the local domain-server port in case the DS has restarted quint16 localAssignmentServerPort; if (nodeList->getLocalServerPortFromSharedMemory(DOMAIN_SERVER_LOCAL_PORT_SMEM_KEY, localAssignmentServerPort)) { @@ -270,10 +278,10 @@ void AssignmentClient::handleCreateAssignmentPacket(QSharedPointer message) { const HifiSockAddr& senderSockAddr = message->getSenderSockAddr(); - + if (senderSockAddr.getAddress() == QHostAddress::LocalHost || senderSockAddr.getAddress() == QHostAddress::LocalHostIPv6) { - + qCDebug(assignment_client) << "AssignmentClientMonitor at" << senderSockAddr << "requested stop via PacketType::StopNode."; QCoreApplication::quit(); } else { @@ -307,7 +315,7 @@ void AssignmentClient::handleAuthenticationRequest() { void AssignmentClient::assignmentCompleted() { crash::annotations::setShutdownState(true); - + // we expect that to be here the previous assignment has completely cleaned up assert(_currentAssignment.isNull()); @@ -328,6 +336,6 @@ void AssignmentClient::assignmentCompleted() { nodeList->setOwnerType(NodeType::Unassigned); nodeList->reset("Assignment completed"); nodeList->resetNodeInterestSet(); - + _isAssigned = false; } diff --git a/assignment-client/src/AssignmentClient.h b/assignment-client/src/AssignmentClient.h index 28464bc222..d40f0964d1 100644 --- a/assignment-client/src/AssignmentClient.h +++ b/assignment-client/src/AssignmentClient.h @@ -23,9 +23,9 @@ class AssignmentClient : public QObject { Q_OBJECT public: AssignmentClient(Assignment::Type requestAssignmentType, QString assignmentPool, - quint16 listenPort, - QUuid walletUUID, QString assignmentServerHostname, quint16 assignmentServerPort, - quint16 assignmentMonitorPort); + quint16 listenPort, QUuid walletUUID, QString assignmentServerHostname, + quint16 assignmentServerPort, quint16 assignmentMonitorPort, + bool disableDomainPortAutoDiscovery); ~AssignmentClient(); private slots: @@ -53,6 +53,7 @@ private: QTimer _requestTimer; // timer for requesting and assignment QTimer _statsTimerACM; // timer for sending stats to assignment client monitor QUuid _childAssignmentUUID = QUuid::createUuid(); + bool _disableDomainPortAutoDiscovery { false }; protected: HifiSockAddr _assignmentClientMonitorSocket; diff --git a/assignment-client/src/AssignmentClientApp.cpp b/assignment-client/src/AssignmentClientApp.cpp index 1dd050fcb9..49674f5728 100644 --- a/assignment-client/src/AssignmentClientApp.cpp +++ b/assignment-client/src/AssignmentClientApp.cpp @@ -4,6 +4,7 @@ // // Created by Seth Alves on 2/19/15. // Copyright 2015 High Fidelity, Inc. +// Copyright 2021 Vircadia contributors. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html @@ -44,7 +45,7 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) : // parse command-line QCommandLineParser parser; - parser.setApplicationDescription("High Fidelity Assignment Client"); + parser.setApplicationDescription("Vircadia Assignment Client"); const QCommandLineOption helpOption = parser.addHelpOption(); const QCommandLineOption versionOption = parser.addVersionOption(); @@ -54,8 +55,8 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) : type = static_cast(static_cast(type) + 1)) { typeDescription.append(QStringLiteral("\n%1 | %2").arg(QString::number(type), Assignment::typeToString(type))); } - const QCommandLineOption clientTypeOption(ASSIGNMENT_TYPE_OVERRIDE_OPTION, typeDescription, "type"); + const QCommandLineOption clientTypeOption(ASSIGNMENT_TYPE_OVERRIDE_OPTION, typeDescription, "type"); parser.addOption(clientTypeOption); const QCommandLineOption poolOption(ASSIGNMENT_POOL_OPTION, "set assignment pool", "pool-name"); @@ -99,6 +100,9 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) : const QCommandLineOption logDirectoryOption(ASSIGNMENT_LOG_DIRECTORY, "directory to store logs", "log-directory"); parser.addOption(logDirectoryOption); + const QCommandLineOption disableDomainPortAutoDiscoveryOption(ASSIGNMENT_DISABLE_DOMAIN_AUTO_PORT_DISCOVERY, "disable automatic discovery of the domain server port"); + parser.addOption(disableDomainPortAutoDiscoveryOption); + const QCommandLineOption parentPIDOption(PARENT_PID_OPTION, "PID of the parent process", "parent-pid"); parser.addOption(parentPIDOption); @@ -151,11 +155,14 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) : } QString logDirectory; - if (parser.isSet(logDirectoryOption)) { logDirectory = parser.value(logDirectoryOption); } + bool disableDomainPortAutoDiscovery = false; + if (parser.isSet(disableDomainPortAutoDiscoveryOption)) { + disableDomainPortAutoDiscovery = true; + } Assignment::Type requestAssignmentType = Assignment::AllTypes; if (argumentVariantMap.contains(ASSIGNMENT_TYPE_OVERRIDE_OPTION)) { @@ -250,13 +257,15 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) : AssignmentClientMonitor* monitor = new AssignmentClientMonitor(numForks, minForks, maxForks, requestAssignmentType, assignmentPool, listenPort, childMinListenPort, walletUUID, assignmentServerHostname, - assignmentServerPort, httpStatusPort, logDirectory); + assignmentServerPort, httpStatusPort, logDirectory, + disableDomainPortAutoDiscovery); monitor->setParent(this); connect(this, &QCoreApplication::aboutToQuit, monitor, &AssignmentClientMonitor::aboutToQuit); } else { AssignmentClient* client = new AssignmentClient(requestAssignmentType, assignmentPool, listenPort, walletUUID, assignmentServerHostname, - assignmentServerPort, monitorPort); + assignmentServerPort, monitorPort, + disableDomainPortAutoDiscovery); client->setParent(this); connect(this, &QCoreApplication::aboutToQuit, client, &AssignmentClient::aboutToQuit); } diff --git a/assignment-client/src/AssignmentClientApp.h b/assignment-client/src/AssignmentClientApp.h index 1b50922980..e48e05f4f0 100644 --- a/assignment-client/src/AssignmentClientApp.h +++ b/assignment-client/src/AssignmentClientApp.h @@ -4,6 +4,7 @@ // // Created by Seth Alves on 2/19/15. // Copyright 2015 High Fidelity, Inc. +// Copyright 2021 Vircadia contributors. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html @@ -28,6 +29,7 @@ const QString ASSIGNMENT_MAX_FORKS_OPTION = "max"; const QString ASSIGNMENT_CLIENT_MONITOR_PORT_OPTION = "monitor-port"; const QString ASSIGNMENT_HTTP_STATUS_PORT = "http-status-port"; const QString ASSIGNMENT_LOG_DIRECTORY = "log-directory"; +const QString ASSIGNMENT_DISABLE_DOMAIN_AUTO_PORT_DISCOVERY = "disable-domain-port-auto-discovery"; class AssignmentClientApp : public QCoreApplication { Q_OBJECT diff --git a/assignment-client/src/AssignmentClientMonitor.cpp b/assignment-client/src/AssignmentClientMonitor.cpp index 68c0dfc9fd..811a731707 100644 --- a/assignment-client/src/AssignmentClientMonitor.cpp +++ b/assignment-client/src/AssignmentClientMonitor.cpp @@ -4,6 +4,7 @@ // // Created by Stephen Birarda on 1/10/2014. // Copyright 2014 High Fidelity, Inc. +// Copyright 2021 Vircadia contributors. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html @@ -41,7 +42,8 @@ AssignmentClientMonitor::AssignmentClientMonitor(const unsigned int numAssignmen const unsigned int maxAssignmentClientForks, Assignment::Type requestAssignmentType, QString assignmentPool, quint16 listenPort, quint16 childMinListenPort, QUuid walletUUID, QString assignmentServerHostname, - quint16 assignmentServerPort, quint16 httpStatusServerPort, QString logDirectory) : + quint16 assignmentServerPort, quint16 httpStatusServerPort, QString logDirectory, + bool disableDomainPortAutoDiscovery) : _httpManager(QHostAddress::LocalHost, httpStatusServerPort, "", this), _numAssignmentClientForks(numAssignmentClientForks), _minAssignmentClientForks(minAssignmentClientForks), @@ -51,7 +53,8 @@ AssignmentClientMonitor::AssignmentClientMonitor(const unsigned int numAssignmen _walletUUID(walletUUID), _assignmentServerHostname(assignmentServerHostname), _assignmentServerPort(assignmentServerPort), - _childMinListenPort(childMinListenPort) + _childMinListenPort(childMinListenPort), + _disableDomainPortAutoDiscovery(disableDomainPortAutoDiscovery) { qDebug() << "_requestAssignmentType =" << _requestAssignmentType; @@ -198,6 +201,9 @@ void AssignmentClientMonitor::spawnChildClient() { _childArguments.append("--" + ASSIGNMENT_TYPE_OVERRIDE_OPTION); _childArguments.append(QString::number(_requestAssignmentType)); } + if (_disableDomainPortAutoDiscovery != false) { + _childArguments.append("--" + ASSIGNMENT_DISABLE_DOMAIN_AUTO_PORT_DISCOVERY); + } if (listenPort) { _childArguments.append("-" + ASSIGNMENT_CLIENT_LISTEN_PORT_OPTION); @@ -266,7 +272,7 @@ void AssignmentClientMonitor::spawnChildClient() { stderrPath = stderrPathTemp; stderrFilename = stderrFilenameTemp; } - + qDebug() << "Child stdout being written to: " << stdoutFilename; qDebug() << "Child stderr being written to: " << stderrFilename; } diff --git a/assignment-client/src/AssignmentClientMonitor.h b/assignment-client/src/AssignmentClientMonitor.h index f5355476b7..20d4a6767b 100644 --- a/assignment-client/src/AssignmentClientMonitor.h +++ b/assignment-client/src/AssignmentClientMonitor.h @@ -4,6 +4,7 @@ // // Created by Stephen Birarda on 1/10/2014. // Copyright 2014 High Fidelity, Inc. +// Copyright 2021 Vircadia contributors. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html @@ -27,7 +28,7 @@ extern const char* NUM_FORKS_PARAMETER; struct ACProcess { - QProcess* process; // looks like a dangling pointer, but is parented by the AssignmentClientMonitor + QProcess* process; // looks like a dangling pointer, but is parented by the AssignmentClientMonitor QString logStdoutPath; QString logStderrPath; }; @@ -39,7 +40,7 @@ public: const unsigned int maxAssignmentClientForks, Assignment::Type requestAssignmentType, QString assignmentPool, quint16 listenPort, quint16 childMinListenPort, QUuid walletUUID, QString assignmentServerHostname, quint16 assignmentServerPort, quint16 httpStatusServerPort, - QString logDirectory); + QString logDirectory, bool disableDomainPortAutoDiscovery); ~AssignmentClientMonitor(); void stopChildProcesses(); @@ -80,6 +81,7 @@ private: QSet _childListenPorts; bool _wantsChildFileLogging { false }; + bool _disableDomainPortAutoDiscovery { false }; }; #endif // hifi_AssignmentClientMonitor_h diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index a975302699..cf443367a4 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -377,7 +377,7 @@ void NodeList::sendDomainServerCheckIn() { // if so we need to make sure we have an up-to-date local port in case it restarted if (domainSockAddr.getAddress() == QHostAddress::LocalHost - || hostname == "localhost") { + || hostname == "localhost" && _domainPortAutoDiscovery == true) { quint16 domainPort = DEFAULT_DOMAIN_SERVER_PORT; getLocalServerPortFromSharedMemory(DOMAIN_SERVER_LOCAL_PORT_SMEM_KEY, domainPort); @@ -534,7 +534,7 @@ void NodeList::sendDomainServerCheckIn() { sendPacket(std::move(packetCopy), domainSockAddr); } sendPacket(std::move(domainPacket), domainSockAddr); - + } } @@ -661,7 +661,7 @@ void NodeList::handleICEConnectionToDomainServer() { _domainHandler.getICEClientID(), _domainHandler.getPendingDomainID()); } -} +} void NodeList::pingPunchForDomainServer() { // make sure if we're here that we actually still need to ping the domain-server @@ -713,7 +713,7 @@ void NodeList::processDomainServerConnectionTokenPacket(QSharedPointer message) { - // parse header information + // parse header information QDataStream packetStream(message->getMessage()); // grab the domain's ID from the beginning of the packet @@ -794,7 +794,7 @@ void NodeList::processDomainServerList(QSharedPointer message) if (_domainHandler.isConnected() && _domainHandler.getUUID() != domainUUID) { // Received packet from different domain. - qWarning() << "IGNORING DomainList packet from" << domainUUID << "while connected to" + qWarning() << "IGNORING DomainList packet from" << domainUUID << "while connected to" << _domainHandler.getUUID() << ": sent " << pingLagTime << " msec ago."; qWarning(networking) << "DomainList request lag (interface->ds): " << domainServerRequestLag << "msec"; qWarning(networking) << "DomainList server processing time: " << domainServerCheckinProcessingTime << "usec"; @@ -821,9 +821,9 @@ void NodeList::processDomainServerList(QSharedPointer message) setSessionLocalID(newLocalID); setSessionUUID(newUUID); - // FIXME: Remove this call to requestDomainSettings() and reinstate the one in DomainHandler::setIsConnected(), in version + // FIXME: Remove this call to requestDomainSettings() and reinstate the one in DomainHandler::setIsConnected(), in version // 2021.2.0. (New protocol version implies a domain server upgrade.) - if (!_domainHandler.isConnected() + if (!_domainHandler.isConnected() && _domainHandler.getScheme() == URL_SCHEME_HIFI && !_domainHandler.getHostname().isEmpty()) { // We're about to connect but we need the domain settings (in particular, the node permissions) in order to adjust the // canRezAvatarEntities permission above before using the permissions in determining whether or not to connect without @@ -831,7 +831,7 @@ void NodeList::processDomainServerList(QSharedPointer message) _domainHandler.requestDomainSettings(); } - // Don't continue login to the domain if have avatar entities and don't have permissions to rez them, unless user has OKed + // Don't continue login to the domain if have avatar entities and don't have permissions to rez them, unless user has OKed // continuing login. if (!newPermissions.can(NodePermissions::Permission::canRezAvatarEntities) && (!adjustedPermissions || !_domainHandler.canConnectWithoutAvatarEntities())) { @@ -920,7 +920,7 @@ void NodeList::pingPunchForInactiveNode(const SharedNodePointer& node) { if (node->getConnectionAttempts() > 0 && node->getConnectionAttempts() % NUM_DEBUG_CONNECTION_ATTEMPTS == 0) { qCDebug(networking) << "No response to UDP hole punch pings for node" << node->getUUID() << "in last 2 s."; } - + auto nodeID = node->getUUID(); // send the ping packet to the local and public sockets for this node diff --git a/libraries/networking/src/NodeList.h b/libraries/networking/src/NodeList.h index 59b3815fba..685b998269 100644 --- a/libraries/networking/src/NodeList.h +++ b/libraries/networking/src/NodeList.h @@ -70,6 +70,8 @@ public: void setAssignmentServerSocket(const HifiSockAddr& serverSocket) { _assignmentServerSocket = serverSocket; } void sendAssignment(Assignment& assignment); + void setDomainPortAutoDiscovery(bool enabled = true) { _domainPortAutoDiscovery = enabled; }; + void setIsShuttingDown(bool isShuttingDown) { _isShuttingDown = isShuttingDown; } void ignoreNodesInRadius(bool enabled = true); @@ -105,7 +107,7 @@ public: public slots: void reset(QString reason, bool skipDomainHandlerReset = false); void resetFromDomainHandler() { reset("Reset from Domain Handler", true); } - + void sendDomainServerCheckIn(); void handleDSPathQuery(const QString& newPath); @@ -180,6 +182,7 @@ private: bool _requestsDomainListData { false }; bool _sendDomainServerCheckInEnabled { true }; + bool _domainPortAutoDiscovery { true }; mutable QReadWriteLock _ignoredSetLock; tbb::concurrent_unordered_set _ignoredNodeIDs; From d1cf862e45db1a955a46b62353c9b3b5a1715755 Mon Sep 17 00:00:00 2001 From: Kalila <69767640+digisomni@users.noreply.github.com> Date: Fri, 25 Jun 2021 01:45:31 -0400 Subject: [PATCH 02/44] Update vircadia-assignment-client.service --- pkg-scripts/vircadia-assignment-client.service | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg-scripts/vircadia-assignment-client.service b/pkg-scripts/vircadia-assignment-client.service index 9c86e4e874..c53fa5ddc7 100644 --- a/pkg-scripts/vircadia-assignment-client.service +++ b/pkg-scripts/vircadia-assignment-client.service @@ -1,5 +1,5 @@ [Unit] -Description=Assignment client service for Vircadia server +Description=Assignment client service for the Vircadia Server After=network.target PartOf=vircadia-server.target @@ -12,7 +12,7 @@ User=vircadia Group=vircadia #LimitCORE=infinity #ExecStart=/opt/vircadia/assignment-client -n 6 -ExecStart=/opt/vircadia/assignment-client --min 6 --max 20 +ExecStart=/opt/vircadia/assignment-client --min 6 --max 20 --disable-domain-port-auto-discovery [Install] WantedBy=multi-user.target From 42a4e3b186ee7b0a52fd6b8931144049380721b4 Mon Sep 17 00:00:00 2001 From: Kalila <69767640+digisomni@users.noreply.github.com> Date: Fri, 25 Jun 2021 01:45:49 -0400 Subject: [PATCH 03/44] Update vircadia-assignment-client@.service --- pkg-scripts/vircadia-assignment-client@.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg-scripts/vircadia-assignment-client@.service b/pkg-scripts/vircadia-assignment-client@.service index 4684947426..ec8158b6db 100644 --- a/pkg-scripts/vircadia-assignment-client@.service +++ b/pkg-scripts/vircadia-assignment-client@.service @@ -14,7 +14,7 @@ User=vircadia Group=vircadia #LimitCORE=infinity #ExecStart=/opt/vircadia/assignment-client -n 6 -ExecStart=/opt/vircadia/assignment-client --min 6 --max 20 --server-port $HIFI_DOMAIN_SERVER_PORT +ExecStart=/opt/vircadia/assignment-client --min 6 --max 20 --server-port $HIFI_DOMAIN_SERVER_PORT --disable-domain-port-auto-discovery [Install] WantedBy=multi-user.target From a217f80ee3415433529811d2c92cac054eec85a2 Mon Sep 17 00:00:00 2001 From: Kalila <69767640+digisomni@users.noreply.github.com> Date: Sun, 27 Jun 2021 04:14:21 -0400 Subject: [PATCH 04/44] Update NodeList.cpp --- libraries/networking/src/NodeList.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index cf443367a4..41900d6130 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -376,8 +376,8 @@ void NodeList::sendDomainServerCheckIn() { // is this our localhost domain-server? // if so we need to make sure we have an up-to-date local port in case it restarted - if (domainSockAddr.getAddress() == QHostAddress::LocalHost - || hostname == "localhost" && _domainPortAutoDiscovery == true) { + if ((domainSockAddr.getAddress() == QHostAddress::LocalHost || hostname == "localhost") + && _domainPortAutoDiscovery == true) { quint16 domainPort = DEFAULT_DOMAIN_SERVER_PORT; getLocalServerPortFromSharedMemory(DOMAIN_SERVER_LOCAL_PORT_SMEM_KEY, domainPort); From 88b9b7468e3b8dc89f504dcc69b7ee9de2359174 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Sun, 27 Jun 2021 04:31:14 -0400 Subject: [PATCH 05/44] CR. --- assignment-client/src/AssignmentClient.cpp | 2 +- libraries/networking/src/NodeList.cpp | 2 +- libraries/networking/src/NodeList.h | 4 ++-- pkg-scripts/vircadia-assignment-client.service | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/assignment-client/src/AssignmentClient.cpp b/assignment-client/src/AssignmentClient.cpp index 8e44cdd157..29125fee6f 100644 --- a/assignment-client/src/AssignmentClient.cpp +++ b/assignment-client/src/AssignmentClient.cpp @@ -95,7 +95,7 @@ AssignmentClient::AssignmentClient(Assignment::Type requestAssignmentType, QStri qCDebug(assignment_client) << "Disabling domain port auto discovery by the assignment client due to parsed command line parameter."; } - nodeList->setDomainPortAutoDiscovery(_disableDomainPortAutoDiscovery); + nodeList->disableDomainPortAutoDiscovery(_disableDomainPortAutoDiscovery); qCDebug(assignment_client) << "Assignment server socket is" << _assignmentServerSocket; diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index 41900d6130..3d28457633 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -377,7 +377,7 @@ void NodeList::sendDomainServerCheckIn() { // if so we need to make sure we have an up-to-date local port in case it restarted if ((domainSockAddr.getAddress() == QHostAddress::LocalHost || hostname == "localhost") - && _domainPortAutoDiscovery == true) { + && _domainPortAutoDiscovery == false) { quint16 domainPort = DEFAULT_DOMAIN_SERVER_PORT; getLocalServerPortFromSharedMemory(DOMAIN_SERVER_LOCAL_PORT_SMEM_KEY, domainPort); diff --git a/libraries/networking/src/NodeList.h b/libraries/networking/src/NodeList.h index 685b998269..9c47abbd9f 100644 --- a/libraries/networking/src/NodeList.h +++ b/libraries/networking/src/NodeList.h @@ -70,7 +70,7 @@ public: void setAssignmentServerSocket(const HifiSockAddr& serverSocket) { _assignmentServerSocket = serverSocket; } void sendAssignment(Assignment& assignment); - void setDomainPortAutoDiscovery(bool enabled = true) { _domainPortAutoDiscovery = enabled; }; + void disableDomainPortAutoDiscovery(bool disabled = false) { _domainPortAutoDiscovery = disabled; }; void setIsShuttingDown(bool isShuttingDown) { _isShuttingDown = isShuttingDown; } @@ -182,7 +182,7 @@ private: bool _requestsDomainListData { false }; bool _sendDomainServerCheckInEnabled { true }; - bool _domainPortAutoDiscovery { true }; + bool _domainPortAutoDiscovery { false }; mutable QReadWriteLock _ignoredSetLock; tbb::concurrent_unordered_set _ignoredNodeIDs; diff --git a/pkg-scripts/vircadia-assignment-client.service b/pkg-scripts/vircadia-assignment-client.service index c53fa5ddc7..d8b64be416 100644 --- a/pkg-scripts/vircadia-assignment-client.service +++ b/pkg-scripts/vircadia-assignment-client.service @@ -12,7 +12,7 @@ User=vircadia Group=vircadia #LimitCORE=infinity #ExecStart=/opt/vircadia/assignment-client -n 6 -ExecStart=/opt/vircadia/assignment-client --min 6 --max 20 --disable-domain-port-auto-discovery +ExecStart=/opt/vircadia/assignment-client --min 6 --max 20 [Install] WantedBy=multi-user.target From 8df362ef1f1ecb6a8a52145eff4ac47dbaa50164 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Sat, 10 Jul 2021 18:05:28 -0400 Subject: [PATCH 06/44] Add "Talk" link to "Help" menu. --- interface/src/Menu.cpp | 6 +++--- libraries/networking/src/NetworkingConstants.h | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 3a320cc628..47c0ee2966 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -827,10 +827,10 @@ Menu::Menu() { }); // Help > Vircadia Forum - /* action = addActionToQMenuAndActionHash(helpMenu, "Online Forums"); + action = addActionToQMenuAndActionHash(helpMenu, "Talk"); connect(action, &QAction::triggered, qApp, [] { - QDesktopServices::openUrl(NetworkingConstants::HELP_FORUM_URL)); - }); */ + QDesktopServices::openUrl(NetworkingConstants::TALK_DIRECTORY_URL)); + }); // Help > Scripting Reference action = addActionToQMenuAndActionHash(helpMenu, "Online Script Reference"); diff --git a/libraries/networking/src/NetworkingConstants.h b/libraries/networking/src/NetworkingConstants.h index d5ad90a6f4..5ea13064a0 100644 --- a/libraries/networking/src/NetworkingConstants.h +++ b/libraries/networking/src/NetworkingConstants.h @@ -71,10 +71,11 @@ namespace NetworkingConstants { const unsigned short STUN_SERVER_DEFAULT_PORT = 19302; #endif - const QUrl HELP_DOCS_URL { "https://docs.vircadia.dev" }; - const QUrl HELP_FORUM_URL { "https://forums.vircadia.dev" }; + const QUrl HELP_DOCS_URL{ "https://docs.vircadia.com" }; + const QUrl HELP_FORUM_URL{ "https://forum.vircadia.com" }; + const QUrl TALK_DIRECTORY_URL{ "https://vircadia.com/#talk" }; const QUrl HELP_SCRIPTING_REFERENCE_URL{ "https://apidocs.vircadia.dev/" }; - const QUrl HELP_RELEASE_NOTES_URL{ "https://docs.vircadia.dev/release-notes.html" }; + const QUrl HELP_RELEASE_NOTES_URL{ "https://docs.vircadia.com/release-notes.html" }; const QUrl HELP_BUG_REPORT_URL{ "https://github.com/vircadia/vircadia/issues" }; const QString DEFAULT_VIRCADIA_ADDRESS = "file:///~/serverless/tutorial.json"; From 3f20f6ec6691a0b6fad8e4cdfa5a9d047bd80fc3 Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Tue, 29 Dec 2020 01:15:07 +0100 Subject: [PATCH 07/44] Generate all files in the build dir, don't touch source dir This makes it so that RCC files and jsdoc are both generated into the build directory. --- hifi_qt.py | 2 +- interface/CMakeLists.txt | 12 ++++++------ tools/jsdoc/CMakeLists.txt | 4 +++- tools/jsdoc/plugins/hifiJSONExport.js | 18 ++++++++++++++++-- tools/nitpick/CMakeLists.txt | 2 +- 5 files changed, 27 insertions(+), 11 deletions(-) diff --git a/hifi_qt.py b/hifi_qt.py index 078f80c38d..f832d5f940 100644 --- a/hifi_qt.py +++ b/hifi_qt.py @@ -196,7 +196,7 @@ endif() print("https://github.com/vircadia/vircadia/tree/master/tools/qt-builder") print("") print("Alternatively, you can try building against the system Qt by setting the VIRCADIA_USE_SYSTEM_QT environment variable.") - print("You'll need to install the development packages, and to have Qt 5.15.0 or newer. ") + print("You'll need to install the development packages, and to have Qt 5.15.0 or later.") def writeConfig(self): print("Writing cmake config to {}".format(self.configFilePath)) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index a2a29ed4ba..8ada51561f 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -22,11 +22,11 @@ set(CUSTOM_INTERFACE_QRC_PATHS "") find_npm() if (BUILD_TOOLS AND NPM_EXECUTABLE) - add_custom_qrc_path(CUSTOM_INTERFACE_QRC_PATHS "${CMAKE_SOURCE_DIR}/tools/jsdoc/out/hifiJSDoc.json" "auto-complete/hifiJSDoc.json") + add_custom_qrc_path(CUSTOM_INTERFACE_QRC_PATHS "${CMAKE_BINARY_DIR}/tools/jsdoc/out/hifiJSDoc.json" "auto-complete/hifiJSDoc.json") endif () set(RESOURCES_QRC ${CMAKE_CURRENT_BINARY_DIR}/resources.qrc) -set(RESOURCES_RCC ${CMAKE_CURRENT_SOURCE_DIR}/compiledResources/resources.rcc) +set(RESOURCES_RCC ${CMAKE_CURRENT_BINARY_DIR}/resources.rcc) generate_qrc(OUTPUT ${RESOURCES_QRC} PATH ${CMAKE_CURRENT_SOURCE_DIR}/resources CUSTOM_PATHS ${CUSTOM_INTERFACE_QRC_PATHS} GLOBS *) if (ANDROID) @@ -345,7 +345,7 @@ if (APPLE) "${RESOURCES_DEV_DIR}/scripts" # copy JSDoc files beside the executable COMMAND "${CMAKE_COMMAND}" -E copy_directory - "${CMAKE_SOURCE_DIR}/tools/jsdoc/out" + "${CMAKE_CURRENT_BINARY_DIR}/tools/jsdoc" "${RESOURCES_DEV_DIR}/jsdoc" # copy the resources files beside the executable COMMAND "${CMAKE_COMMAND}" -E copy_if_different @@ -408,9 +408,9 @@ else() "${PROJECT_SOURCE_DIR}/resources/serverless/redirect.json" "${RESOURCES_DEV_DIR}/serverless/redirect.json" # copy JSDoc files beside the executable - COMMAND "${CMAKE_COMMAND}" -E copy_directory - "${CMAKE_SOURCE_DIR}/tools/jsdoc/out" - "${INTERFACE_EXEC_DIR}/jsdoc" +# COMMAND "${CMAKE_COMMAND}" -E copy_directory +# "${CMAKE_CURRENT_BINARY_DIR}/tools/jsdoc/out" +# "${INTERFACE_EXEC_DIR}/jsdoc" ) # link target to external libraries diff --git a/tools/jsdoc/CMakeLists.txt b/tools/jsdoc/CMakeLists.txt index 1c4333983f..3c8245f0d9 100644 --- a/tools/jsdoc/CMakeLists.txt +++ b/tools/jsdoc/CMakeLists.txt @@ -5,9 +5,11 @@ add_custom_target(${TARGET_NAME}) find_npm() set(JSDOC_WORKING_DIR ${CMAKE_SOURCE_DIR}/tools/jsdoc) +set(JSDOC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}) + file(TO_NATIVE_PATH ${JSDOC_WORKING_DIR}/node_modules/.bin/jsdoc JSDOC_PATH) file(TO_NATIVE_PATH ${JSDOC_WORKING_DIR}/config.json JSDOC_CONFIG_PATH) -file(TO_NATIVE_PATH ${JSDOC_WORKING_DIR}/out OUTPUT_DIR) +file(TO_NATIVE_PATH ${JSDOC_OUTPUT_DIR}/out OUTPUT_DIR) file(TO_NATIVE_PATH ${JSDOC_WORKING_DIR}/root.js NATIVE_JSDOC_WORKING_DIR) add_custom_command(TARGET ${TARGET_NAME} diff --git a/tools/jsdoc/plugins/hifiJSONExport.js b/tools/jsdoc/plugins/hifiJSONExport.js index e609b30ad5..057aaecda3 100644 --- a/tools/jsdoc/plugins/hifiJSONExport.js +++ b/tools/jsdoc/plugins/hifiJSONExport.js @@ -1,8 +1,22 @@ exports.handlers = { processingComplete: function(e) { const pathTools = require('path'); - var outputFolder = pathTools.join(__dirname, '../out'); + var outputFolder; var doclets = e.doclets.map(doclet => Object.assign({}, doclet)); + + var argv = process.argv; + for(var i=0; i Date: Sun, 27 Jun 2021 16:35:32 +0200 Subject: [PATCH 08/44] Don't copy RCC, it's generated where it's needed --- interface/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 8ada51561f..31fab35df1 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -387,9 +387,6 @@ else() # copy the resources files beside the executable add_custom_command(TARGET ${TARGET_NAME} POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E copy_if_different - "${RESOURCES_RCC}" - "${INTERFACE_EXEC_DIR}" # FIXME, the edit script code loads HTML from the scripts folder # which in turn relies on CSS that refers to the fonts. In theory # we should be able to modify the CSS to reference the QRC path to From 7546be2e8a4a2662436461385333575fdcbd8b32 Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Sun, 27 Jun 2021 16:35:54 +0200 Subject: [PATCH 09/44] Use qt5_add_binary_resources instead of custom command. Also move find_package for Qt to the top, so that it finds the rcc binary before it's needed --- interface/CMakeLists.txt | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 31fab35df1..8d15ccc22e 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -21,6 +21,14 @@ set(CUSTOM_INTERFACE_QRC_PATHS "") find_npm() +find_package( + Qt5 COMPONENTS + Gui Widgets Multimedia Network Qml Quick Script Svg + ${PLATFORM_QT_COMPONENTS} + WebChannel WebSockets +) + + if (BUILD_TOOLS AND NPM_EXECUTABLE) add_custom_qrc_path(CUSTOM_INTERFACE_QRC_PATHS "${CMAKE_BINARY_DIR}/tools/jsdoc/out/hifiJSDoc.json" "auto-complete/hifiJSDoc.json") endif () @@ -31,23 +39,12 @@ generate_qrc(OUTPUT ${RESOURCES_QRC} PATH ${CMAKE_CURRENT_SOURCE_DIR}/resources if (ANDROID) # on Android, don't compress the rcc binary - add_custom_command( - OUTPUT ${RESOURCES_RCC} - DEPENDS ${RESOURCES_QRC} ${GENERATE_QRC_DEPENDS} - COMMAND "${RCC_BINARY}" - ARGS ${RESOURCES_QRC} -no-compress -binary -o ${RESOURCES_RCC} - ) + qt5_add_binary_resources(resources "${RESOURCES_QRC}" DESTINATION "${RESOURCES_RCC}" OPTIONS -no-compress) else () - add_custom_command( - OUTPUT ${RESOURCES_RCC} - DEPENDS ${RESOURCES_QRC} ${GENERATE_QRC_DEPENDS} - COMMAND "${RCC_BINARY}" - ARGS ${RESOURCES_QRC} -binary -o ${RESOURCES_RCC} - ) + qt5_add_binary_resources(resources "${RESOURCES_QRC}" DESTINATION "${RESOURCES_RCC}") endif() list(APPEND GENERATE_QRC_DEPENDS ${RESOURCES_RCC}) -add_custom_target(resources ALL DEPENDS ${GENERATE_QRC_DEPENDS}) # set a default root dir for each of our optional externals if it was not passed set(OPTIONAL_EXTERNALS "LeapMotion") @@ -96,13 +93,6 @@ else () list(REMOVE_ITEM INTERFACE_SRCS ${SPEECHRECOGNIZER_CPP}) endif () -find_package( - Qt5 COMPONENTS - Gui Widgets Multimedia Network Qml Quick Script Svg - ${PLATFORM_QT_COMPONENTS} - WebChannel WebSockets -) - # grab the ui files in resources/ui file (GLOB_RECURSE QT_UI_FILES ui/*.ui) source_group("UI Files" FILES ${QT_UI_FILES}) From 70895df49e801e8eb11e6f03aecc5424fa1aa55d Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Sun, 27 Jun 2021 17:02:42 +0200 Subject: [PATCH 10/44] Generate nitpick resources with qt5_add_binary_resources Also, it appears there was a bug where nitpick depended on interface's resources rather than its own. --- tools/nitpick/CMakeLists.txt | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tools/nitpick/CMakeLists.txt b/tools/nitpick/CMakeLists.txt index 19fe319e76..fa87a1c69c 100644 --- a/tools/nitpick/CMakeLists.txt +++ b/tools/nitpick/CMakeLists.txt @@ -4,24 +4,19 @@ project(${TARGET_NAME}) set(CUSTOM_NITPICK_QRC_PATHS "") find_npm() +find_package(Qt5 COMPONENTS Widgets) set(RESOURCES_QRC ${CMAKE_CURRENT_BINARY_DIR}/resources.qrc) set(RESOURCES_RCC ${CMAKE_CURRENT_BINARY_DIR}/resources.rcc) generate_qrc(OUTPUT ${RESOURCES_QRC} PATH ${CMAKE_CURRENT_SOURCE_DIR}/resources CUSTOM_PATHS ${CUSTOM_NITPICK_QRC_PATHS} GLOBS *) -add_custom_command( - OUTPUT ${RESOURCES_RCC} - DEPENDS ${RESOURCES_QRC} ${GENERATE_QRC_DEPENDS} - COMMAND "${RCC_BINARY}" - ARGS ${RESOURCES_QRC} -binary -o ${RESOURCES_RCC} -) +qt5_add_binary_resources(nitpick_resources "${RESOURCES_QRC}" DESTINATION "${RESOURCES_RCC}" OPTIONS -no-compress) # grab the implementation and header files from src dirs file(GLOB_RECURSE NITPICK_SRCS "src/*.cpp" "src/*.h") GroupSources("src") list(APPEND NITPICK_SRCS ${RESOURCES_RCC}) -find_package(Qt5 COMPONENTS Widgets) # grab the ui files in ui file (GLOB_RECURSE QT_UI_FILES ui/*.ui) @@ -83,9 +78,7 @@ else () add_executable(${TARGET_NAME} ${NITPICK_SRCS} ${QM}) endif () -if (NOT UNIX) - add_dependencies(${TARGET_NAME} resources) -endif() +add_dependencies(${TARGET_NAME} nitpick_resources) # disable /OPT:REF and /OPT:ICF for the Debug builds # This will prevent the following linker warnings From 60164dbf081b16739d98e51fe24e86cfcc93ecaf Mon Sep 17 00:00:00 2001 From: daleglass <51060919+daleglass@users.noreply.github.com> Date: Thu, 1 Jul 2021 18:56:11 +0200 Subject: [PATCH 11/44] Whitespace review fixes Co-authored-by: David Rowe --- tools/jsdoc/plugins/hifiJSONExport.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/jsdoc/plugins/hifiJSONExport.js b/tools/jsdoc/plugins/hifiJSONExport.js index 057aaecda3..148f83268b 100644 --- a/tools/jsdoc/plugins/hifiJSONExport.js +++ b/tools/jsdoc/plugins/hifiJSONExport.js @@ -5,7 +5,7 @@ exports.handlers = { var doclets = e.doclets.map(doclet => Object.assign({}, doclet)); var argv = process.argv; - for(var i=0; i Date: Fri, 2 Jul 2021 01:54:36 +0200 Subject: [PATCH 12/44] Fix copying jsdoc to interface Take the jsdoc from tools/jsdoc and copy it to interface. A subtle issue was found: It turns out that for cmake it matters what gets parsed first, especially if you rely on setting a variable in one project and reading it in another. This can result in things like builds that fail the first time, then work after re-running cmake. Generation of jsdoc and screenshare were moved above interface, because they're a dependency of it. --- CMakeLists.txt | 14 +++++++------- interface/CMakeLists.txt | 8 ++++---- tools/jsdoc/CMakeLists.txt | 2 ++ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index facc1c999f..9031183d85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -337,6 +337,13 @@ if (BUILD_GPU_FRAME_PLAYER_ONLY) add_subdirectory(tools/gpu-frame-player) else() +if (SCREENSHARE) + add_subdirectory(screenshare) +endif() + +# BUILD_TOOLS option will be handled inside the tools's CMakeLists.txt because 'scribe' tool is required for build anyway +add_subdirectory(tools) + # add subdirectories for all targets if (BUILD_SERVER) add_subdirectory(assignment-client) @@ -363,13 +370,6 @@ if (BUILD_CLIENT OR BUILD_SERVER) add_subdirectory(server-console) endif() -if (SCREENSHARE) - add_subdirectory(screenshare) -endif() - -# BUILD_TOOLS option will be handled inside the tools's CMakeLists.txt because 'scribe' tool is required for build anyway -add_subdirectory(tools) - endif() if (BUILD_TESTS) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 8d15ccc22e..8067e800a5 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -335,7 +335,7 @@ if (APPLE) "${RESOURCES_DEV_DIR}/scripts" # copy JSDoc files beside the executable COMMAND "${CMAKE_COMMAND}" -E copy_directory - "${CMAKE_CURRENT_BINARY_DIR}/tools/jsdoc" + "${JSDOC_OUTPUT_PATH}" "${RESOURCES_DEV_DIR}/jsdoc" # copy the resources files beside the executable COMMAND "${CMAKE_COMMAND}" -E copy_if_different @@ -395,9 +395,9 @@ else() "${PROJECT_SOURCE_DIR}/resources/serverless/redirect.json" "${RESOURCES_DEV_DIR}/serverless/redirect.json" # copy JSDoc files beside the executable -# COMMAND "${CMAKE_COMMAND}" -E copy_directory -# "${CMAKE_CURRENT_BINARY_DIR}/tools/jsdoc/out" -# "${INTERFACE_EXEC_DIR}/jsdoc" + COMMAND "${CMAKE_COMMAND}" -E copy_directory + "${JSDOC_OUTPUT_PATH}" + "${INTERFACE_EXEC_DIR}/jsdoc" ) # link target to external libraries diff --git a/tools/jsdoc/CMakeLists.txt b/tools/jsdoc/CMakeLists.txt index 3c8245f0d9..5a062b7ee9 100644 --- a/tools/jsdoc/CMakeLists.txt +++ b/tools/jsdoc/CMakeLists.txt @@ -12,6 +12,8 @@ file(TO_NATIVE_PATH ${JSDOC_WORKING_DIR}/config.json JSDOC_CONFIG_PATH) file(TO_NATIVE_PATH ${JSDOC_OUTPUT_DIR}/out OUTPUT_DIR) file(TO_NATIVE_PATH ${JSDOC_WORKING_DIR}/root.js NATIVE_JSDOC_WORKING_DIR) +set(JSDOC_OUTPUT_PATH ${OUTPUT_DIR} CACHE INTERNAL "${PROJECT_NAME}: JSDoc output directory") + add_custom_command(TARGET ${TARGET_NAME} COMMAND ${NPM_EXECUTABLE} --no-progress install && ${JSDOC_PATH} ${NATIVE_JSDOC_WORKING_DIR} -c ${JSDOC_CONFIG_PATH} -d ${OUTPUT_DIR} WORKING_DIRECTORY ${JSDOC_WORKING_DIR} From 6a62dc10e6fd7f9452cd0306e79f3733c678ee01 Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Sat, 3 Jul 2021 18:26:56 +0200 Subject: [PATCH 13/44] Fix resources and jsdoc dependencies --- interface/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 8067e800a5..b0b4ae0c5c 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -30,6 +30,7 @@ find_package( if (BUILD_TOOLS AND NPM_EXECUTABLE) + set(JSDOC_ENABLED 1) add_custom_qrc_path(CUSTOM_INTERFACE_QRC_PATHS "${CMAKE_BINARY_DIR}/tools/jsdoc/out/hifiJSDoc.json" "auto-complete/hifiJSDoc.json") endif () @@ -44,6 +45,10 @@ else () qt5_add_binary_resources(resources "${RESOURCES_QRC}" DESTINATION "${RESOURCES_RCC}") endif() +if (JSDOC_ENABLED) + add_dependencies(resources jsdoc) +endif() + list(APPEND GENERATE_QRC_DEPENDS ${RESOURCES_RCC}) # set a default root dir for each of our optional externals if it was not passed @@ -187,7 +192,7 @@ if (BUILD_TOOLS AND NPM_EXECUTABLE) add_dependencies(resources jsdoc) endif() -if (WIN32 OR APPLE) +if (NOT ANDROID) add_dependencies(${TARGET_NAME} resources) endif() From 96ad5e971b6940142ba5c040d1c905fd8cdba4b1 Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Sun, 11 Jul 2021 19:22:20 +0200 Subject: [PATCH 14/44] Remove redundant cmake code --- interface/CMakeLists.txt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index b0b4ae0c5c..804fd1ce85 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -186,12 +186,6 @@ else () add_executable(${TARGET_NAME} ${INTERFACE_SRCS} ${QM}) endif () - -if (BUILD_TOOLS AND NPM_EXECUTABLE) - # require JSDoc to be build before interface is deployed - add_dependencies(resources jsdoc) -endif() - if (NOT ANDROID) add_dependencies(${TARGET_NAME} resources) endif() From cf75200231df54f91be33803b38d30a5264085b0 Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Sun, 11 Jul 2021 19:22:56 +0200 Subject: [PATCH 15/44] Have cmake be verbose about whether NPM has been detected --- tools/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 5de2f6fdf8..ce1e8c4d71 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,9 +1,13 @@ # add the tool directories +message(STATUS "Checking for npm") find_npm() if (NPM_EXECUTABLE) - add_subdirectory(jsdoc) - set_target_properties(jsdoc PROPERTIES FOLDER "Tools") + message(STATUS "Checking for npm - found ${NPM_EXECUTABLE}, will build jsdoc") + add_subdirectory(jsdoc) + set_target_properties(jsdoc PROPERTIES FOLDER "Tools") +else() + message(NOTICE "Checking for npm - not found, jsdoc won't be genereated. Tab completion in the js console won't work!") endif() function(check_test name) From 276a0506bf6958e2dea575b6fc8274706ffdb34c Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Sun, 11 Jul 2021 19:26:34 +0200 Subject: [PATCH 16/44] Fix building interface without npm --- interface/CMakeLists.txt | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 804fd1ce85..10489eb57b 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -19,8 +19,6 @@ endfunction() set(CUSTOM_INTERFACE_QRC_PATHS "") -find_npm() - find_package( Qt5 COMPONENTS Gui Widgets Multimedia Network Qml Quick Script Svg @@ -29,8 +27,8 @@ find_package( ) -if (BUILD_TOOLS AND NPM_EXECUTABLE) - set(JSDOC_ENABLED 1) +if (BUILD_TOOLS AND JSDOC_ENABLED) + message(STATUS "JSDoc enabled, depending on jsdoc") add_custom_qrc_path(CUSTOM_INTERFACE_QRC_PATHS "${CMAKE_BINARY_DIR}/tools/jsdoc/out/hifiJSDoc.json" "auto-complete/hifiJSDoc.json") endif () @@ -45,7 +43,7 @@ else () qt5_add_binary_resources(resources "${RESOURCES_QRC}" DESTINATION "${RESOURCES_RCC}") endif() -if (JSDOC_ENABLED) +if (BUILD_TOOLS AND JSDOC_ENABLED) add_dependencies(resources jsdoc) endif() @@ -332,10 +330,6 @@ if (APPLE) COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_SOURCE_DIR}/scripts" "${RESOURCES_DEV_DIR}/scripts" - # copy JSDoc files beside the executable - COMMAND "${CMAKE_COMMAND}" -E copy_directory - "${JSDOC_OUTPUT_PATH}" - "${RESOURCES_DEV_DIR}/jsdoc" # copy the resources files beside the executable COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${RESOURCES_RCC}" @@ -367,6 +361,13 @@ if (APPLE) ) endif() + if (JSDOC_ENABLED) + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + # copy JSDoc files beside the executable + COMMAND "${CMAKE_COMMAND}" -E copy_directory + "${JSDOC_OUTPUT_PATH}" + "${RESOURCES_DEV_DIR}/jsdoc") + endif() # call the fixup_interface macro to add required bundling commands for installation fixup_interface() @@ -393,11 +394,15 @@ else() COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${PROJECT_SOURCE_DIR}/resources/serverless/redirect.json" "${RESOURCES_DEV_DIR}/serverless/redirect.json" + ) + + if (JSDOC_ENABLED) + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD # copy JSDoc files beside the executable COMMAND "${CMAKE_COMMAND}" -E copy_directory "${JSDOC_OUTPUT_PATH}" - "${INTERFACE_EXEC_DIR}/jsdoc" - ) + "${INTERFACE_EXEC_DIR}/jsdoc") + endif() # link target to external libraries if (WIN32) From f62c964fdc1948b4927af4597ba53a00d5b31144 Mon Sep 17 00:00:00 2001 From: Kalila <69767640+digisomni@users.noreply.github.com> Date: Thu, 15 Jul 2021 22:16:32 -0400 Subject: [PATCH 17/44] Typo, remove double definitions of constants. --- libraries/networking/src/NetworkingConstants.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/libraries/networking/src/NetworkingConstants.h b/libraries/networking/src/NetworkingConstants.h index bebeab4eb1..b19f6f2ce4 100644 --- a/libraries/networking/src/NetworkingConstants.h +++ b/libraries/networking/src/NetworkingConstants.h @@ -75,8 +75,6 @@ namespace NetworkingConstants { const QUrl HELP_DOCS_URL{ "https://docs.vircadia.com" }; const QUrl HELP_FORUM_URL{ "https://forum.vircadia.com" }; - const QUrl HELP_DOCS_URL { "https://docs.vircadia.com" }; - const QUrl HELP_FORUM_URL { "https://forum.vircadia.com" }; const QUrl HELP_SCRIPTING_REFERENCE_URL{ "https://apidocs.vircadia.dev/" }; const QUrl HELP_RELEASE_NOTES_URL{ "https://docs.vircadia.com/release-notes.html" }; const QUrl HELP_BUG_REPORT_URL{ "https://github.com/vircadia/vircadia/issues" }; From 241c54919d82e3381174c23cbca009c7a056fab1 Mon Sep 17 00:00:00 2001 From: Kalila <69767640+digisomni@users.noreply.github.com> Date: Thu, 15 Jul 2021 22:19:58 -0400 Subject: [PATCH 18/44] Apply suggestions from code review Co-authored-by: David Rowe --- assignment-client/src/AssignmentClient.cpp | 2 +- assignment-client/src/AssignmentClientMonitor.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assignment-client/src/AssignmentClient.cpp b/assignment-client/src/AssignmentClient.cpp index 29125fee6f..3eb3c83b83 100644 --- a/assignment-client/src/AssignmentClient.cpp +++ b/assignment-client/src/AssignmentClient.cpp @@ -193,7 +193,7 @@ void AssignmentClient::sendAssignmentRequest() { auto nodeList = DependencyManager::get(); - if (_assignmentServerHostname == "localhost" && _disableDomainPortAutoDiscovery == false) { + if (_assignmentServerHostname == "localhost" && !_disableDomainPortAutoDiscovery) { // we want to check again for the local domain-server port in case the DS has restarted quint16 localAssignmentServerPort; if (nodeList->getLocalServerPortFromSharedMemory(DOMAIN_SERVER_LOCAL_PORT_SMEM_KEY, localAssignmentServerPort)) { diff --git a/assignment-client/src/AssignmentClientMonitor.cpp b/assignment-client/src/AssignmentClientMonitor.cpp index 811a731707..43d788f5d1 100644 --- a/assignment-client/src/AssignmentClientMonitor.cpp +++ b/assignment-client/src/AssignmentClientMonitor.cpp @@ -201,7 +201,7 @@ void AssignmentClientMonitor::spawnChildClient() { _childArguments.append("--" + ASSIGNMENT_TYPE_OVERRIDE_OPTION); _childArguments.append(QString::number(_requestAssignmentType)); } - if (_disableDomainPortAutoDiscovery != false) { + if (_disableDomainPortAutoDiscovery) { _childArguments.append("--" + ASSIGNMENT_DISABLE_DOMAIN_AUTO_PORT_DISCOVERY); } From f795418fd7c7b115244e52622d83f95e4fd5ab36 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Fri, 16 Jul 2021 04:23:21 -0400 Subject: [PATCH 19/44] Update supporter info for README.md. --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b84849b205..a4067e30ab 100644 --- a/README.md +++ b/README.md @@ -73,8 +73,16 @@ Vircadia consists of many projects and codebases with its unifying structure's g There are many contributors to Vircadia. Code writers, reviewers, testers, documentation writers, modelers, and general supporters of the project are all integral to its development and success towards its goals. Find out how you can [contribute](CONTRIBUTING.md)! -### [Supporters](https://github.com/sponsors/digisomni/) +### Support -| [Karol Suprynowicz - 74hc595](https://github.com/ksuprynowicz) | +You can support the Vircadia project financially through [GitHub Sponsors](https://github.com/sponsors/digisomni/). + +You can also support individual active contributors by visiting each repository, this is the main Vircadia repository's [list of active contributors](https://vircadia.com/contributors-redirector/?redirect=vircadia/vircadia). Click on a contributor's profile to see if they accept donations! + +Keep in mind that Vircadia consists of multiple smaller projects that might have different active contributors. This is a [a non-exhaustive list](https://github.com/vircadia). + +#### Supporters of the Vircadia Project + +| [Karol Suprynowicz - 74hc595](https://github.com/ksuprynowicz) | | --- | -|

[![ksuprynowicz](https://avatars.githubusercontent.com/u/11568651?s=64&v=4)](https://github.com/ksuprynowicz)

+|

[![ksuprynowicz](https://avatars.githubusercontent.com/u/11568651?s=64&v=4)](https://github.com/ksuprynowicz)

\ No newline at end of file From 11e1e0c201f75b530de52558f17c6c6bbf894d08 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Fri, 16 Jul 2021 04:33:59 -0400 Subject: [PATCH 20/44] Update image for supporter: ksuprynowicz. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a4067e30ab..c1cd8323e9 100644 --- a/README.md +++ b/README.md @@ -85,4 +85,4 @@ Keep in mind that Vircadia consists of multiple smaller projects that might have | [Karol Suprynowicz - 74hc595](https://github.com/ksuprynowicz) | | --- | -|

[![ksuprynowicz](https://avatars.githubusercontent.com/u/11568651?s=64&v=4)](https://github.com/ksuprynowicz)

\ No newline at end of file +|

[ksuprynowicz](https://github.com/ksuprynowicz)

\ No newline at end of file From 32c3725b5d455918e5243bcafe1b56356319d794 Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Sat, 17 Jul 2021 19:34:26 +0200 Subject: [PATCH 21/44] Define _USE_MATH_DEFINES everywhere that uses math constants On Win32, things are failing to build with messages like: RenderableEntityItem.cpp(674,51): error C2065: 'M_PI': undeclared identifier This is because as per Microsoft documentation, _USE_MATH_DEFINES is needed to obtain constants like M_PI: https://docs.microsoft.com/en-us/cpp/c-runtime-library/math-constants?view=msvc-160 It seems this worked previously due to some quirk of CMake, but stopped working after some reordering. This change makes this definition explicit where it is needed. --- libraries/animation/CMakeLists.txt | 4 ++++ libraries/entities-renderer/CMakeLists.txt | 3 +++ libraries/entities/CMakeLists.txt | 4 ++++ libraries/image/CMakeLists.txt | 4 ++++ libraries/render-utils/CMakeLists.txt | 3 +++ libraries/shared/CMakeLists.txt | 1 + 6 files changed, 19 insertions(+) diff --git a/libraries/animation/CMakeLists.txt b/libraries/animation/CMakeLists.txt index d962d9e222..2e811969ec 100644 --- a/libraries/animation/CMakeLists.txt +++ b/libraries/animation/CMakeLists.txt @@ -7,3 +7,7 @@ include_hifi_library_headers(hfm) include_hifi_library_headers(image) target_nsight() + +if (WIN32) + add_compile_definitions(_USE_MATH_DEFINES) +endif() diff --git a/libraries/entities-renderer/CMakeLists.txt b/libraries/entities-renderer/CMakeLists.txt index 5f40c8d5fe..67f34f4831 100644 --- a/libraries/entities-renderer/CMakeLists.txt +++ b/libraries/entities-renderer/CMakeLists.txt @@ -19,3 +19,6 @@ include_hifi_library_headers(graphics-scripting) # for Forward.h target_bullet() target_polyvox() +if (WIN32) + add_compile_definitions(_USE_MATH_DEFINES) +endif() diff --git a/libraries/entities/CMakeLists.txt b/libraries/entities/CMakeLists.txt index bddd4b5e67..b6ed62c15a 100644 --- a/libraries/entities/CMakeLists.txt +++ b/libraries/entities/CMakeLists.txt @@ -9,3 +9,7 @@ include_hifi_library_headers(ktx) include_hifi_library_headers(material-networking) include_hifi_library_headers(procedural) link_hifi_libraries(shared shaders networking octree avatars graphics model-networking) + +if (WIN32) + add_compile_definitions(_USE_MATH_DEFINES) +endif() diff --git a/libraries/image/CMakeLists.txt b/libraries/image/CMakeLists.txt index 62f48f66e2..8c72bc7e72 100644 --- a/libraries/image/CMakeLists.txt +++ b/libraries/image/CMakeLists.txt @@ -11,3 +11,7 @@ if (UNIX AND NOT APPLE) find_package(Threads REQUIRED) target_link_libraries(image Threads::Threads) endif() + +if (WIN32) + add_compile_definitions(_USE_MATH_DEFINES) +endif() diff --git a/libraries/render-utils/CMakeLists.txt b/libraries/render-utils/CMakeLists.txt index 4c444bcd15..904e7ea94c 100644 --- a/libraries/render-utils/CMakeLists.txt +++ b/libraries/render-utils/CMakeLists.txt @@ -16,3 +16,6 @@ if (NOT ANDROID) target_nsight() endif () +if (WIN32) + add_compile_definitions(_USE_MATH_DEFINES) +endif() diff --git a/libraries/shared/CMakeLists.txt b/libraries/shared/CMakeLists.txt index 57904be586..59fb4d81ab 100644 --- a/libraries/shared/CMakeLists.txt +++ b/libraries/shared/CMakeLists.txt @@ -7,6 +7,7 @@ setup_hifi_library(Gui Network Script) if (WIN32) target_link_libraries(${TARGET_NAME} Wbemuuid.lib) + add_compile_definitions(_USE_MATH_DEFINES) endif() if (ANDROID) From 030cdbf34876790eec7659a5eaf25faf2336c470 Mon Sep 17 00:00:00 2001 From: Kalila <69767640+digisomni@users.noreply.github.com> Date: Fri, 23 Jul 2021 20:43:33 -0400 Subject: [PATCH 22/44] Update Menu.cpp --- interface/src/Menu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 47c0ee2966..857316a4b7 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -827,9 +827,9 @@ Menu::Menu() { }); // Help > Vircadia Forum - action = addActionToQMenuAndActionHash(helpMenu, "Talk"); + action = addActionToQMenuAndActionHash(helpMenu, "Community Support"); connect(action, &QAction::triggered, qApp, [] { - QDesktopServices::openUrl(NetworkingConstants::TALK_DIRECTORY_URL)); + QDesktopServices::openUrl(NetworkingConstants::HELP_COMMUNITY_URL)); }); // Help > Scripting Reference From 10e8d9f6d8b6d4a2ad2d2907afd9c08804970ab5 Mon Sep 17 00:00:00 2001 From: Kalila <69767640+digisomni@users.noreply.github.com> Date: Fri, 23 Jul 2021 20:44:24 -0400 Subject: [PATCH 23/44] Update NetworkingConstants.h --- libraries/networking/src/NetworkingConstants.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libraries/networking/src/NetworkingConstants.h b/libraries/networking/src/NetworkingConstants.h index b19f6f2ce4..35180e5829 100644 --- a/libraries/networking/src/NetworkingConstants.h +++ b/libraries/networking/src/NetworkingConstants.h @@ -71,8 +71,7 @@ namespace NetworkingConstants { const unsigned short STUN_SERVER_DEFAULT_PORT = 19302; #endif - const QUrl TALK_DIRECTORY_URL{ "https://vircadia.com/#talk" }; - + const QUrl HELP_COMMUNITY_URL{ "https://vircadia.com/#community" }; const QUrl HELP_DOCS_URL{ "https://docs.vircadia.com" }; const QUrl HELP_FORUM_URL{ "https://forum.vircadia.com" }; const QUrl HELP_SCRIPTING_REFERENCE_URL{ "https://apidocs.vircadia.dev/" }; From 4b6d1e47e25f0ca2eeea62bb95552d8301b16a1e Mon Sep 17 00:00:00 2001 From: Kalila <69767640+digisomni@users.noreply.github.com> Date: Mon, 26 Jul 2021 01:10:55 +0200 Subject: [PATCH 24/44] Fix syntax error in Menu.cpp. --- interface/src/Menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 857316a4b7..760a7b1127 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -829,7 +829,7 @@ Menu::Menu() { // Help > Vircadia Forum action = addActionToQMenuAndActionHash(helpMenu, "Community Support"); connect(action, &QAction::triggered, qApp, [] { - QDesktopServices::openUrl(NetworkingConstants::HELP_COMMUNITY_URL)); + QDesktopServices::openUrl(NetworkingConstants::HELP_COMMUNITY_URL); }); // Help > Scripting Reference From 8d19d0826812a62eca7f145a6987a32fdb81aa03 Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Fri, 6 Aug 2021 18:44:53 +0200 Subject: [PATCH 25/44] Fix QDir::operator= is deprecated --- interface/src/Application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 759a96388d..3c26587d1e 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1965,7 +1965,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo } QString scriptsSwitch = QString("--").append(SCRIPTS_SWITCH); - _defaultScriptsLocation = getCmdOption(argc, constArgv, scriptsSwitch.toStdString().c_str()); + _defaultScriptsLocation.setPath(getCmdOption(argc, constArgv, scriptsSwitch.toStdString().c_str())); // Make sure we don't time out during slow operations at startup updateHeartbeat(); From 24b2cdfcd26526f46a0ac6755131abef85854160 Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Fri, 6 Aug 2021 20:16:10 +0200 Subject: [PATCH 26/44] Fix QString::SplitBehavior deprecation, replace with Qt:: --- interface/src/Application.cpp | 10 +++++----- libraries/entities/src/EntityTree.cpp | 2 +- libraries/networking/src/AssetResourceRequest.cpp | 2 +- libraries/render-utils/src/Model.cpp | 2 +- libraries/script-engine/src/ScriptEngine.cpp | 6 +++--- libraries/shared/src/shared/FileUtils.cpp | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 759a96388d..349e1db18f 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3264,12 +3264,12 @@ void Application::initializeUi() { auto newValidator = [=](const QUrl& url) -> bool { QString whitelistPrefix = "[WHITELIST ENTITY SCRIPTS]"; QList safeURLS = { "" }; - safeURLS += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), QString::SkipEmptyParts); + safeURLS += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), Qt::SkipEmptyParts); // PULL SAFEURLS FROM INTERFACE.JSON Settings QVariant raw = Setting::Handle("private/settingsSafeURLS").get(); - QStringList settingsSafeURLS = raw.toString().trimmed().split(QRegExp("\\s*[,\r\n]+\\s*"), QString::SkipEmptyParts); + QStringList settingsSafeURLS = raw.toString().trimmed().split(QRegExp("\\s*[,\r\n]+\\s*"), Qt::SkipEmptyParts); safeURLS += settingsSafeURLS; // END PULL SAFEURLS FROM INTERFACE.JSON Settings @@ -8846,19 +8846,19 @@ void Application::initPlugins(const QStringList& arguments) { parser.parse(arguments); if (parser.isSet(display)) { - auto preferredDisplays = parser.value(display).split(',', QString::SkipEmptyParts); + auto preferredDisplays = parser.value(display).split(',', Qt::SkipEmptyParts); qInfo() << "Setting prefered display plugins:" << preferredDisplays; PluginManager::getInstance()->setPreferredDisplayPlugins(preferredDisplays); } if (parser.isSet(disableDisplays)) { - auto disabledDisplays = parser.value(disableDisplays).split(',', QString::SkipEmptyParts); + auto disabledDisplays = parser.value(disableDisplays).split(',', Qt::SkipEmptyParts); qInfo() << "Disabling following display plugins:" << disabledDisplays; PluginManager::getInstance()->disableDisplays(disabledDisplays); } if (parser.isSet(disableInputs)) { - auto disabledInputs = parser.value(disableInputs).split(',', QString::SkipEmptyParts); + auto disabledInputs = parser.value(disableInputs).split(',', Qt::SkipEmptyParts); qInfo() << "Disabling following input plugins:" << disabledInputs; PluginManager::getInstance()->disableInputs(disabledInputs); } diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index 63d8842a91..1c544f24f0 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -68,7 +68,7 @@ EntityTree::~EntityTree() { } void EntityTree::setEntityScriptSourceWhitelist(const QString& entityScriptSourceWhitelist) { - _entityScriptSourceWhitelist = entityScriptSourceWhitelist.split(',', QString::SkipEmptyParts); + _entityScriptSourceWhitelist = entityScriptSourceWhitelist.split(',', Qt::SkipEmptyParts); } diff --git a/libraries/networking/src/AssetResourceRequest.cpp b/libraries/networking/src/AssetResourceRequest.cpp index 423e4f3521..5419424f46 100644 --- a/libraries/networking/src/AssetResourceRequest.cpp +++ b/libraries/networking/src/AssetResourceRequest.cpp @@ -59,7 +59,7 @@ void AssetResourceRequest::doSend() { // We'll either have a hash or an ATP path to a file (that maps to a hash) if (urlIsAssetHash(_url)) { // We've detected that this is a hash - simply use AssetClient to request that asset - auto parts = _url.path().split(".", QString::SkipEmptyParts); + auto parts = _url.path().split(".", Qt::SkipEmptyParts); auto hash = parts.length() > 0 ? parts[0] : ""; requestHash(hash); diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index dd3bcd0587..1178ca3ab1 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -1624,7 +1624,7 @@ std::set Model::getMeshIDsFromMaterialID(QString parentMaterialNam }; if (parentMaterialName.length() > 2 && parentMaterialName.startsWith("[") && parentMaterialName.endsWith("]")) { - QStringList list = parentMaterialName.split(",", QString::SkipEmptyParts); + QStringList list = parentMaterialName.split(",", Qt::SkipEmptyParts); for (int i = 0; i < list.length(); i++) { auto& target = list[i]; if (i == 0) { diff --git a/libraries/script-engine/src/ScriptEngine.cpp b/libraries/script-engine/src/ScriptEngine.cpp index 6627f75ae6..c1578265e3 100644 --- a/libraries/script-engine/src/ScriptEngine.cpp +++ b/libraries/script-engine/src/ScriptEngine.cpp @@ -187,7 +187,7 @@ void inputControllerFromScriptValue(const QScriptValue &object, controller::Inpu // // Extract the url portion of a url that has been encoded with encodeEntityIdIntoEntityUrl(...) QString extractUrlFromEntityUrl(const QString& url) { - auto parts = url.split(' ', QString::SkipEmptyParts); + auto parts = url.split(' ', Qt::SkipEmptyParts); if (parts.length() > 0) { return parts[0]; } else { @@ -2386,7 +2386,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co bool passList = false; // assume unsafe QString whitelistPrefix = "[WHITELIST ENTITY SCRIPTS]"; QList safeURLPrefixes = { "file:///", "atp:", "cache:" }; - safeURLPrefixes += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), QString::SkipEmptyParts); + safeURLPrefixes += qEnvironmentVariable("EXTRA_WHITELIST").trimmed().split(QRegExp("\\s*,\\s*"), Qt::SkipEmptyParts); // Entity Script Whitelist toggle check. Setting::Handle whitelistEnabled {"private/whitelistEnabled", false }; @@ -2397,7 +2397,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co // Pull SAFEURLS from the Interface.JSON settings. QVariant raw = Setting::Handle("private/settingsSafeURLS").get(); - QStringList settingsSafeURLS = raw.toString().trimmed().split(QRegExp("\\s*[,\r\n]+\\s*"), QString::SkipEmptyParts); + QStringList settingsSafeURLS = raw.toString().trimmed().split(QRegExp("\\s*[,\r\n]+\\s*"), Qt::SkipEmptyParts); safeURLPrefixes += settingsSafeURLS; // END Pull SAFEURLS from the Interface.JSON settings. diff --git a/libraries/shared/src/shared/FileUtils.cpp b/libraries/shared/src/shared/FileUtils.cpp index 164af091de..52c0ee01f9 100644 --- a/libraries/shared/src/shared/FileUtils.cpp +++ b/libraries/shared/src/shared/FileUtils.cpp @@ -68,7 +68,7 @@ QString FileUtils::readFile(const QString& filename) { } QStringList FileUtils::readLines(const QString& filename, QString::SplitBehavior splitBehavior) { - return readFile(filename).split(QRegularExpression("[\\r\\n]"), QString::SkipEmptyParts); + return readFile(filename).split(QRegularExpression("[\\r\\n]"), Qt::SkipEmptyParts); } void FileUtils::locateFile(const QString& filePath) { From 24ab523acc1175ec1164a847ed7ddfc816f477ac Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Fri, 6 Aug 2021 23:26:02 +0200 Subject: [PATCH 27/44] Replace deprecated QAbstractsocket::error with QAbstractSocket::errorOccurred --- libraries/networking/src/LimitedNodeList.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libraries/networking/src/LimitedNodeList.cpp b/libraries/networking/src/LimitedNodeList.cpp index 65e391d467..d45aca2f89 100644 --- a/libraries/networking/src/LimitedNodeList.cpp +++ b/libraries/networking/src/LimitedNodeList.cpp @@ -1224,8 +1224,7 @@ void LimitedNodeList::updateLocalSocket() { QTcpSocket* localIPTestSocket = new QTcpSocket; connect(localIPTestSocket, &QTcpSocket::connected, this, &LimitedNodeList::connectedForLocalSocketTest); - connect(localIPTestSocket, static_cast(&QTcpSocket::error), - this, &LimitedNodeList::errorTestingLocalSocket); + connect(localIPTestSocket, &QTcpSocket::errorOccurred, this, &LimitedNodeList::errorTestingLocalSocket); // attempt to connect to our reliable host localIPTestSocket->connectToHost(RELIABLE_LOCAL_IP_CHECK_HOST, RELIABLE_LOCAL_IP_CHECK_PORT); From eb146fa434f3f0259051ad100576ceeeec5a3453 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Aug 2021 08:34:58 +0000 Subject: [PATCH 28/44] Bump path-parse from 1.0.6 to 1.0.7 in /screenshare Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7. - [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] --- screenshare/package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/screenshare/package-lock.json b/screenshare/package-lock.json index 6bb34b21a5..16a9828357 100644 --- a/screenshare/package-lock.json +++ b/screenshare/package-lock.json @@ -1014,9 +1014,9 @@ "dev": true }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "pend": { From ae9f2aa1ee6724f855744b399fc4f684a2c81208 Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Thu, 12 Aug 2021 22:53:24 +0200 Subject: [PATCH 29/44] Update slots to the new syntax, use QAbstractSocket::errorOccurred --- libraries/embedded-webserver/src/HTTPConnection.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/embedded-webserver/src/HTTPConnection.cpp b/libraries/embedded-webserver/src/HTTPConnection.cpp index 4c00ba676c..5932c7ed56 100644 --- a/libraries/embedded-webserver/src/HTTPConnection.cpp +++ b/libraries/embedded-webserver/src/HTTPConnection.cpp @@ -124,9 +124,9 @@ HTTPConnection::HTTPConnection(QTcpSocket* socket, HTTPManager* parentManager) : _socket->setParent(this); // connect initial slots - connect(socket, SIGNAL(readyRead()), SLOT(readRequest())); - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(deleteLater())); - connect(socket, SIGNAL(disconnected()), SLOT(deleteLater())); + connect(socket, &QAbstractSocket::readyRead, this, &HTTPConnection::readRequest); + connect(socket, &QAbstractSocket::errorOccurred, this, &HTTPConnection::deleteLater); + connect(socket, &QAbstractSocket::disconnected, this, &HTTPConnection::deleteLater); } HTTPConnection::~HTTPConnection() { From 8a8093e529e9653cf7817c18caa1531190bd64be Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Thu, 12 Aug 2021 23:49:44 +0200 Subject: [PATCH 30/44] Log the location of the primary resources file Also emit the full path to the file in the exception --- interface/src/Application.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 349e1db18f..a078cb265a 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -805,11 +805,13 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { { const QString resourcesBinaryFile = PathUtils::getRccPath(); + qCInfo(interfaceapp) << "Loading primary resources from" << resourcesBinaryFile; + if (!QFile::exists(resourcesBinaryFile)) { - throw std::runtime_error("Unable to find primary resources"); + throw std::runtime_error(QString("Unable to find primary resources from '%1'").arg(resourcesBinaryFile).toStdString()); } if (!QResource::registerResource(resourcesBinaryFile)) { - throw std::runtime_error("Unable to load primary resources"); + throw std::runtime_error(QString("Unable to load primary resources from '%1'").arg(resourcesBinaryFile).toStdString()); } } From 019e012f2ef6dcfca16425eb6b824dea1eb586cb Mon Sep 17 00:00:00 2001 From: Kalila <69767640+digisomni@users.noreply.github.com> Date: Thu, 12 Aug 2021 23:01:13 -0400 Subject: [PATCH 31/44] Apply suggestions from code review Co-authored-by: Heather Anderson --- assignment-client/src/AssignmentClient.cpp | 2 +- libraries/networking/src/NodeList.cpp | 2 +- libraries/networking/src/NodeList.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assignment-client/src/AssignmentClient.cpp b/assignment-client/src/AssignmentClient.cpp index 1f18709a91..d8dac8ef36 100644 --- a/assignment-client/src/AssignmentClient.cpp +++ b/assignment-client/src/AssignmentClient.cpp @@ -91,7 +91,7 @@ AssignmentClient::AssignmentClient(Assignment::Type requestAssignmentType, QStri _assignmentServerSocket.setObjectName("AssignmentServer"); nodeList->setAssignmentServerSocket(_assignmentServerSocket); - if (disableDomainPortAutoDiscovery == true) { + if (disableDomainPortAutoDiscovery) { _disableDomainPortAutoDiscovery = disableDomainPortAutoDiscovery; qCDebug(assignment_client) << "Disabling domain port auto discovery by the assignment client due to parsed command line parameter."; } diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index 1e07e14803..5f066b3eb3 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -377,7 +377,7 @@ void NodeList::sendDomainServerCheckIn() { // if so we need to make sure we have an up-to-date local port in case it restarted if ((domainSockAddr.getAddress() == QHostAddress::LocalHost || hostname == "localhost") - && _domainPortAutoDiscovery == false) { + && _domainPortAutoDiscovery) { quint16 domainPort = DEFAULT_DOMAIN_SERVER_PORT; getLocalServerPortFromSharedMemory(DOMAIN_SERVER_LOCAL_PORT_SMEM_KEY, domainPort); diff --git a/libraries/networking/src/NodeList.h b/libraries/networking/src/NodeList.h index 1c01d384cc..fa6781c4bd 100644 --- a/libraries/networking/src/NodeList.h +++ b/libraries/networking/src/NodeList.h @@ -71,7 +71,7 @@ public: void setAssignmentServerSocket(const SockAddr& serverSocket) { _assignmentServerSocket = serverSocket; } void sendAssignment(Assignment& assignment); - void disableDomainPortAutoDiscovery(bool disabled = false) { _domainPortAutoDiscovery = disabled; }; + void disableDomainPortAutoDiscovery(bool disabled = false) { _domainPortAutoDiscovery = !disabled; }; void setIsShuttingDown(bool isShuttingDown) { _isShuttingDown = isShuttingDown; } @@ -183,7 +183,7 @@ private: bool _requestsDomainListData { false }; bool _sendDomainServerCheckInEnabled { true }; - bool _domainPortAutoDiscovery { false }; + bool _domainPortAutoDiscovery { true }; mutable QReadWriteLock _ignoredSetLock; tbb::concurrent_unordered_set _ignoredNodeIDs; From e4cb87ba5d91091e6722808de6f0e541ff13a943 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Thu, 12 Aug 2021 23:02:39 -0400 Subject: [PATCH 32/44] CR. --- pkg-scripts/vircadia-assignment-client.service | 2 +- pkg-scripts/vircadia-assignment-client@.service | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg-scripts/vircadia-assignment-client.service b/pkg-scripts/vircadia-assignment-client.service index d8b64be416..be5b450519 100644 --- a/pkg-scripts/vircadia-assignment-client.service +++ b/pkg-scripts/vircadia-assignment-client.service @@ -1,5 +1,5 @@ [Unit] -Description=Assignment client service for the Vircadia Server +Description=Assignment client service for the Vircadia server After=network.target PartOf=vircadia-server.target diff --git a/pkg-scripts/vircadia-assignment-client@.service b/pkg-scripts/vircadia-assignment-client@.service index ec8158b6db..4595bbf9f7 100644 --- a/pkg-scripts/vircadia-assignment-client@.service +++ b/pkg-scripts/vircadia-assignment-client@.service @@ -1,5 +1,5 @@ [Unit] -Description=Assignment client service for Vircadia server +Description=Assignment client service for the Vircadia server After=network.target PartOf=vircadia-server@%i.target From 76010bf650f36e83f943a91289b3666becf4fe78 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Fri, 13 Aug 2021 10:29:16 -0400 Subject: [PATCH 33/44] Update help text for disable domain server port auto discovery option. --- assignment-client/src/AssignmentClientApp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assignment-client/src/AssignmentClientApp.cpp b/assignment-client/src/AssignmentClientApp.cpp index 49674f5728..41d0de7f9a 100644 --- a/assignment-client/src/AssignmentClientApp.cpp +++ b/assignment-client/src/AssignmentClientApp.cpp @@ -100,7 +100,8 @@ AssignmentClientApp::AssignmentClientApp(int argc, char* argv[]) : const QCommandLineOption logDirectoryOption(ASSIGNMENT_LOG_DIRECTORY, "directory to store logs", "log-directory"); parser.addOption(logDirectoryOption); - const QCommandLineOption disableDomainPortAutoDiscoveryOption(ASSIGNMENT_DISABLE_DOMAIN_AUTO_PORT_DISCOVERY, "disable automatic discovery of the domain server port"); + const QCommandLineOption disableDomainPortAutoDiscoveryOption(ASSIGNMENT_DISABLE_DOMAIN_AUTO_PORT_DISCOVERY, + "assignment clients automatically search for the domain server on the local machine, if networking is being managed, then disable automatic discovery of the domain server port"); parser.addOption(disableDomainPortAutoDiscoveryOption); const QCommandLineOption parentPIDOption(PARENT_PID_OPTION, "PID of the parent process", "parent-pid"); From 1122156d3a09afadcf2f3d50914d6d1a2d7db1bf Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sun, 15 Aug 2021 22:07:00 -0400 Subject: [PATCH 34/44] Add secondary red class button Add secondary red class button for "Set Rotation to Zero" button --- scripts/system/html/css/edit-style.css | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scripts/system/html/css/edit-style.css b/scripts/system/html/css/edit-style.css index 5aea382d63..d912cd5d4c 100644 --- a/scripts/system/html/css/edit-style.css +++ b/scripts/system/html/css/edit-style.css @@ -479,7 +479,22 @@ input[type=button].secondary, button.hifi-edit-button.secondary { background: linear-gradient(#343434 20%, #000 100%); cursor: pointer; } - +input[type=button].secondary_red, button.hifi-edit-button.secondary_red { + font-family: Raleway-Bold; + font-size: 10px; + text-transform: uppercase; + vertical-align: top; + height: 18px; + min-width: 60px; + padding: 0 14px; + margin-right: 6px; + border-radius: 4px; + border: none; + color: #fff; + background-color: #94132e; + background: linear-gradient(#d42043 20%, #94132e 100%); + cursor: pointer; +} input[type=button]:enabled:hover, button.hifi-edit-button:enabled:hover { background: linear-gradient(#000, #000); border: none; From 0d39eea2a671f867437247d82be883a319aa8537 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sun, 15 Aug 2021 22:08:46 -0400 Subject: [PATCH 35/44] Add "Set Rotation to Zero" Add a "Set Rotation to Zero" button in properties tab (Spatial section) of the create app. --- scripts/system/create/edit.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scripts/system/create/edit.js b/scripts/system/create/edit.js index 614bd5fd59..727f8ca28d 100644 --- a/scripts/system/create/edit.js +++ b/scripts/system/create/edit.js @@ -2656,6 +2656,24 @@ var PropertiesTool = function (opts) { } else { audioFeedback.rejection(); } + } else if (data.action === "setRotationToZero") { + if (selectionManager.selections.length === 1 && SelectionManager.hasUnlockedSelection()) { + selectionManager.saveProperties(); + var parentState = getParentState(selectionManager.selections[0]); + if ((parentState === "PARENT_CHILDREN" || parentState === "CHILDREN") && selectionDisplay.getSpaceMode() === "local" ) { + Entities.editEntity(selectionManager.selections[0], { + localRotation: Quat.IDENTITY + }); + } else { + Entities.editEntity(selectionManager.selections[0], { + rotation: Quat.IDENTITY + }); + } + pushCommandForSelections(); + selectionManager._update(false, this); + } else { + audioFeedback.rejection(); + } } } else if (data.type === "propertiesPageReady") { updateSelections(true); From 494740f819eabfcddb28c04e05d73e75d2071574 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Sun, 15 Aug 2021 22:09:27 -0400 Subject: [PATCH 36/44] Add a "Set Rotation to Zero" button Add a "Set Rotation to Zero" button in properties tab (Spatial section) of the create app. --- .../html/js/entityProperties.js | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/scripts/system/create/entityProperties/html/js/entityProperties.js b/scripts/system/create/entityProperties/html/js/entityProperties.js index 65e14d7203..82015c6350 100644 --- a/scripts/system/create/entityProperties/html/js/entityProperties.js +++ b/scripts/system/create/entityProperties/html/js/entityProperties.js @@ -1383,7 +1383,8 @@ const GROUPS = [ { type: "buttons", buttons: [ { id: "copyRotation", label: "Copy Rotation", className: "secondary", onClick: copyRotationProperty }, - { id: "pasteRotation", label: "Paste Rotation", className: "secondary", onClick: pasteRotationProperty } ], + { id: "pasteRotation", label: "Paste Rotation", className: "secondary", onClick: pasteRotationProperty }, + { id: "setRotationToZero", label: "Set Rotation to Zero", className: "secondary_red", onClick: setRotationToZeroProperty }], propertyID: "copyPasteRotation" }, { @@ -1874,10 +1875,16 @@ function setCopyPastePositionAndRotationAvailability (selectionLength, islocked) if (selectionLength > 0 && !islocked) { $('#property-copyPastePosition-button-pastePosition').attr('disabled', false); - $('#property-copyPasteRotation-button-pasteRotation').attr('disabled', false); + $('#property-copyPasteRotation-button-pasteRotation').attr('disabled', false); + if (selectionLength === 1) { + $('#property-copyPasteRotation-button-setRotationToZero').attr('disabled', false); + } else { + $('#property-copyPasteRotation-button-setRotationToZero').attr('disabled', true); + } } else { $('#property-copyPastePosition-button-pastePosition').attr('disabled', true); - $('#property-copyPasteRotation-button-pasteRotation').attr('disabled', true); + $('#property-copyPasteRotation-button-pasteRotation').attr('disabled', true); + $('#property-copyPasteRotation-button-setRotationToZero').attr('disabled', true); } } @@ -3273,7 +3280,12 @@ function pasteRotationProperty() { action: "pasteRotation" })); } - +function setRotationToZeroProperty() { + EventBridge.emitWebEvent(JSON.stringify({ + type: "action", + action: "setRotationToZero" + })); +} /** * USER DATA FUNCTIONS */ From b61d978b0a5e17db785ed871a2643cd6408d4ef5 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Tue, 17 Aug 2021 21:48:12 -0400 Subject: [PATCH 37/44] Change the label for "Reset Rotation" Change the label for "Reset Rotation" --- .../system/create/entityProperties/html/js/entityProperties.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system/create/entityProperties/html/js/entityProperties.js b/scripts/system/create/entityProperties/html/js/entityProperties.js index 82015c6350..ff538af016 100644 --- a/scripts/system/create/entityProperties/html/js/entityProperties.js +++ b/scripts/system/create/entityProperties/html/js/entityProperties.js @@ -1384,7 +1384,7 @@ const GROUPS = [ type: "buttons", buttons: [ { id: "copyRotation", label: "Copy Rotation", className: "secondary", onClick: copyRotationProperty }, { id: "pasteRotation", label: "Paste Rotation", className: "secondary", onClick: pasteRotationProperty }, - { id: "setRotationToZero", label: "Set Rotation to Zero", className: "secondary_red", onClick: setRotationToZeroProperty }], + { id: "setRotationToZero", label: "Reset Rotation", className: "secondary_red", onClick: setRotationToZeroProperty }], propertyID: "copyPasteRotation" }, { From 0cf71bd3e13e70ee8c9dda6ca9557e8115cf1338 Mon Sep 17 00:00:00 2001 From: SilverfishVR <53531160+SilverfishVR@users.noreply.github.com> Date: Wed, 18 Aug 2021 22:19:10 +0200 Subject: [PATCH 38/44] make HUD bubble/shield button optional Adds an menu item in "Settings" to toggle the HUD shield/bubble button on or off. Shield button remains available in the tablet or toolbar, it is called "HUD shield button" but suggestions are welcome fixes https://github.com/vircadia/vircadia/issues/1210 --- scripts/system/bubble.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scripts/system/bubble.js b/scripts/system/bubble.js index eca3b3dcd4..0c019f4e4b 100644 --- a/scripts/system/bubble.js +++ b/scripts/system/bubble.js @@ -46,6 +46,27 @@ }); } + //create a menu item in "Setings" to toggle the bubble/shield HUD button + var menuItemName = "HUD shield button"; + Menu.addMenuItem({ + menuName: "Settings", + menuItemName: menuItemName, + isCheckable: true, + isChecked: AvatarInputs.showBubbleTools + }); + Menu.menuItemEvent.connect(onToggleHudShieldButton); + AvatarInputs.showBubbleToolsChanged.connect(showBubbleToolsChanged); + + function onToggleHudShieldButton(menuItem) { + if (menuItem == menuItemName) { + AvatarInputs.setShowBubbleTools(Menu.isOptionChecked(menuItem)) + }; + } + + function showBubbleToolsChanged(show) { + Menu.setIsOptionChecked(menuItemName, show); + } + // Make the bubble overlay visible, set its position, and play the sound function createOverlays() { var nowTimestamp = Date.now(); @@ -191,6 +212,9 @@ // Cleanup the tablet button and overlays when script is stopped Script.scriptEnding.connect(function () { + Menu.menuItemEvent.disconnect(onToggleHudShieldButton); + AvatarInputs.showBubbleToolsChanged.disconnect(showBubbleToolsChanged); + Menu.removeMenuItem("Settings", menuItemName); button.clicked.disconnect(Users.toggleIgnoreRadius); if (tablet) { tablet.removeButton(button); From 481125f97857f78147c5a9024f2e5b143f649ce7 Mon Sep 17 00:00:00 2001 From: Martin Allerton Date: Wed, 18 Aug 2021 23:54:23 +0100 Subject: [PATCH 39/44] Explore app metaverse api updates Blended the metaverse api places data in to the list with the beacon data. Also lightened the icons at the top as they were a little lost. --- scripts/communityScripts/explore/explore.html | 138 +++++++++++++----- .../libraries/axios/axios.min.js | 3 + 2 files changed, 103 insertions(+), 38 deletions(-) create mode 100644 scripts/communityScripts/libraries/axios/axios.min.js diff --git a/scripts/communityScripts/explore/explore.html b/scripts/communityScripts/explore/explore.html index c147dba134..747e969daa 100644 --- a/scripts/communityScripts/explore/explore.html +++ b/scripts/communityScripts/explore/explore.html @@ -13,8 +13,18 @@ #component-templates { display: none; } + + .thumbnailItem .d-flex { + background: rgba(0, 0, 0, 0.2); + backdrop-filter: blur(5px); + text-shadow: 1px 1px 2px black, 0 0 25px black, 0 0 5px black; + } + + .thumbnailItemHover .d-flex { + background: rgba(100, 100, 100, 0.2); + } - +
@@ -22,7 +32,7 @@ @@ -30,7 +40,7 @@ mdi-close - Add Location + Add Location Beacon Save @@ -101,30 +111,28 @@ @@ -230,7 +238,7 @@ Go Home @@ -238,7 +246,7 @@ Go Back @@ -246,14 +254,14 @@ Go Forward + mdi-map-marker-plus + -->
@@ -286,22 +294,76 @@ +