From 3198cb1460810053bf82faddee6a61d236e49959 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sun, 18 Oct 2020 14:44:33 +1300 Subject: [PATCH 01/16] Rename installer build guide --- INSTALL.md => INSTALLER.md | 0 README.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename INSTALL.md => INSTALLER.md (100%) diff --git a/INSTALL.md b/INSTALLER.md similarity index 100% rename from INSTALL.md rename to INSTALLER.md diff --git a/README.md b/README.md index baf333d81f..54de3f881a 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Vircadia is a 3D social software project seeking to incrementally bring about a ### How to generate an Installer -[For Windows](https://github.com/kasenvr/project-athena/blob/master/INSTALL.md) +[For Windows](https://github.com/kasenvr/project-athena/blob/master/INSTALLER.md) [For Linux - AppImage - Vircadia Builder](https://github.com/kasenvr/vircadia-builder/blob/master/README.md#building-appimages) From 5f283e45b5d605897620110e408d8212ab4de53f Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sun, 18 Oct 2020 15:55:59 +1300 Subject: [PATCH 02/16] Fix use of the BYPASS_SIGNING flag --- cmake/macros/SetPackagingParameters.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 1e05cad109..c9cf91bd3d 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -25,6 +25,7 @@ macro(SET_PACKAGING_PARAMETERS) set_from_env(RELEASE_NUMBER RELEASE_NUMBER "") set_from_env(STABLE_BUILD STABLE_BUILD 0) set_from_env(INITIAL_STARTUP_LOCATION INITIAL_STARTUP_LOCATION "") + set_from_env(BYPASS_SIGNING BYPASS_SIGNING 0) message(STATUS "The RELEASE_TYPE variable is: ${RELEASE_TYPE}") From c33fb5df84e52f3f4abeeba3afb2f226a635163c Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sun, 18 Oct 2020 16:35:17 +1300 Subject: [PATCH 03/16] Fix cmake warning when bypassing signing --- cmake/macros/OptionalWinExecutableSigning.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/OptionalWinExecutableSigning.cmake b/cmake/macros/OptionalWinExecutableSigning.cmake index cbefdaea8f..8f9fde672c 100644 --- a/cmake/macros/OptionalWinExecutableSigning.cmake +++ b/cmake/macros/OptionalWinExecutableSigning.cmake @@ -10,7 +10,7 @@ # macro(optional_win_executable_signing) - if (WIN32 AND PRODUCTION_BUILD) + if (WIN32 AND PRODUCTION_BUILD AND NOT BYPASS_SIGNING) if (DEFINED ENV{HF_PFX_FILE}) if (DEFINED ENV{HF_PFX_PASSPHRASE}) message(STATUS "Executable for ${TARGET_NAME} will be signed with SignTool.") From 857bf7decc58a9e1ab01ecdd3290f80457f46bec Mon Sep 17 00:00:00 2001 From: David Rowe Date: Mon, 19 Oct 2020 09:53:59 +1300 Subject: [PATCH 04/16] Don't show "Console" options in Interface-only installer --- cmake/templates/NSIS.template.in | 111 ++++++++++++++++++++++--------- 1 file changed, 79 insertions(+), 32 deletions(-) diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index 013eb98f84..04c839f58d 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -837,16 +837,24 @@ Function PostInstallOptionsPage !insertmacro SetInstallOption $DesktopClientCheckbox @CLIENT_DESKTOP_SHORTCUT_REG_KEY@ ${BST_CHECKED} ${EndIf} + ; FIXME: Re-enable or permanently remove system tray "Console" for Interface-only installs. + ;${If} @SERVER_COMPONENT_CONDITIONAL@ + ; ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @SANDBOX_HF_SHORTCUT_NAME@" + ;${Else} + ; ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @CONSOLE_HF_SHORTCUT_NAME@" + ;${EndIf} + ;Pop $DesktopConsoleCheckbox + ;IntOp $CurrentOffset $CurrentOffset + 15 + ; + ;; set the checkbox state depending on what is present in the registry + ;!insertmacro SetInstallOption $DesktopConsoleCheckbox @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ ${BST_UNCHECKED} ${If} @SERVER_COMPONENT_CONDITIONAL@ ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @SANDBOX_HF_SHORTCUT_NAME@" - ${Else} - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @CONSOLE_HF_SHORTCUT_NAME@" + Pop $DesktopConsoleCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $DesktopConsoleCheckbox @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ ${BST_UNCHECKED} ${EndIf} - - Pop $DesktopConsoleCheckbox - IntOp $CurrentOffset $CurrentOffset + 15 - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $DesktopConsoleCheckbox @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ ${BST_UNCHECKED} ${If} @CLIENT_COMPONENT_CONDITIONAL@ ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @INTERFACE_HF_SHORTCUT_NAME@ after install" @@ -861,31 +869,54 @@ Function PostInstallOptionsPage ${EndIf} ${EndIf} + ; FIXME: Re-enable or permanently remove system tray "Console" for Interface-only installs. + ;${If} @SERVER_COMPONENT_CONDITIONAL@ + ; ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @SANDBOX_HF_SHORTCUT_NAME@ after install" + ;${Else} + ; ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ after install" + ;${EndIf} + ;Pop $LaunchConsoleNowCheckbox + ; + ;; set the checkbox state depending on what is present in the registry + ;!insertmacro SetInstallOption $LaunchConsoleNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_UNCHECKED} + ;${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE + ;${IfNot} $substringResult == "" + ; ${NSD_SetState} $LaunchConsoleNowCheckbox ${BST_UNCHECKED} + ;${EndIf} + ;IntOp $CurrentOffset $CurrentOffset + 15 ${If} @SERVER_COMPONENT_CONDITIONAL@ ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @SANDBOX_HF_SHORTCUT_NAME@ after install" - ${Else} - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ after install" - ${EndIf} - Pop $LaunchConsoleNowCheckbox - - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $LaunchConsoleNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_UNCHECKED} - ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE - ${IfNot} $substringResult == "" + Pop $LaunchConsoleNowCheckbox + + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $LaunchConsoleNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_UNCHECKED} + ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE + ${IfNot} $substringResult == "" ${NSD_SetState} $LaunchConsoleNowCheckbox ${BST_UNCHECKED} + ${EndIf} + IntOp $CurrentOffset $CurrentOffset + 15 ${EndIf} - IntOp $CurrentOffset $CurrentOffset + 30 - - ${If} @SERVER_COMPONENT_CONDITIONAL@ - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @SANDBOX_HF_SHORTCUT_NAME@ on startup" - ${Else} - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ on startup" - ${EndIf} - Pop $ConsoleStartupCheckbox IntOp $CurrentOffset $CurrentOffset + 15 - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $ConsoleStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_UNCHECKED} + ; FIXME: Re-enable or permanently remove system tray "Console" for Interface-only installs. + ;${If} @SERVER_COMPONENT_CONDITIONAL@ + ; ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @SANDBOX_HF_SHORTCUT_NAME@ on startup" + ;${Else} + ; ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ on startup" + ;${EndIf} + ;Pop $ConsoleStartupCheckbox + ;IntOp $CurrentOffset $CurrentOffset + 15 + ; + ;; set the checkbox state depending on what is present in the registry + ;!insertmacro SetInstallOption $ConsoleStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_UNCHECKED} + ${If} @SERVER_COMPONENT_CONDITIONAL@ + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @SANDBOX_HF_SHORTCUT_NAME@ on startup" + Pop $ConsoleStartupCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 + + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $ConsoleStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_UNCHECKED} + ${EndIf} ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Perform a clean install (Delete older settings and content)" Pop $CleanInstallCheckbox @@ -957,13 +988,29 @@ FunctionEnd Function ReadPostInstallOptions - ; check if the user asked for a desktop shortcut to console - ${NSD_GetState} $DesktopConsoleCheckbox $DesktopConsoleState - ${LogText} "Option: Start Desktop Console: $DesktopConsoleState" + ; FIXME: Re-enable or permanently remove system tray "Console" for Interface-only installs. + ;; check if the user asked for a desktop shortcut to console + ;${NSD_GetState} $DesktopConsoleCheckbox $DesktopConsoleState + ;${LogText} "Option: Start Desktop Console: $DesktopConsoleState" + ${If} @SERVER_COMPONENT_CONDITIONAL@ + ; check if the user asked for a desktop shortcut to console + ${NSD_GetState} $DesktopConsoleCheckbox $DesktopConsoleState + ${LogText} "Option: Start Desktop Console: $DesktopConsoleState" + ${Else} + StrCpy $DesktopConsoleState ${BST_UNCHECKED} + ${EndIf} - ; check if the user asked to have console launched every startup - ${NSD_GetState} $ConsoleStartupCheckbox $ConsoleStartupState - ${LogText} "Option: Start Desktop Console On Startup: $ConsoleStartupState" + ; FIXME: Re-enable or permanently remove system tray "Console" for Interface-only installs. + ;; check if the user asked to have console launched every startup + ;${NSD_GetState} $ConsoleStartupCheckbox $ConsoleStartupState + ;${LogText} "Option: Start Desktop Console On Startup: $ConsoleStartupState" + ${If} @SERVER_COMPONENT_CONDITIONAL@ + ; check if the user asked to have console launched every startup + ${NSD_GetState} $ConsoleStartupCheckbox $ConsoleStartupState + ${LogText} "Option: Start Desktop Console On Startup: $ConsoleStartupState" + ${Else} + StrCpy $ConsoleStartupState ${BST_UNCHECKED} + ${EndIf} ${If} @SERVER_COMPONENT_CONDITIONAL@ ${LogText} "Option: Install Server" From f523416f75761725d9a06762ede134f4b82d99e9 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Mon, 26 Oct 2020 10:09:25 +1300 Subject: [PATCH 05/16] Don't create "Console" Start Menu item --- cmake/templates/NSIS.template.in | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index 04c839f58d..91f5519a33 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -1355,10 +1355,13 @@ Section "-Core installation" ${Else} ; handling for interface only console shortcut Delete "$SMPROGRAMS\$STARTMENU_FOLDER\@SANDBOX_HF_SHORTCUT_NAME@.lnk" - CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" \ - "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" - ; Set appUserModelId - ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" + + ; FIXME: Re-enable or permanently remove system tray "Console" for Interface-only installs. + ;CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" \ + ; "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" + ;; Set appUserModelId + ;ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" + ${EndIf} CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\@UNINSTALLER_NAME@" From cfc7309c96f9ac3867a77145673853163c600258 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Fri, 20 Nov 2020 03:19:19 -0500 Subject: [PATCH 06/16] Send address and port with each metaverse heartbeat. --- .../resources/describe-settings.json | 17 +++++++++ domain-server/resources/web/js/shared.js | 7 ++-- domain-server/src/DomainServer.cpp | 36 ++++++++++++++++--- domain-server/src/DomainServer.h | 4 +-- 4 files changed, 54 insertions(+), 10 deletions(-) diff --git a/domain-server/resources/describe-settings.json b/domain-server/resources/describe-settings.json index 42b15adefe..2cef93ad53 100644 --- a/domain-server/resources/describe-settings.json +++ b/domain-server/resources/describe-settings.json @@ -2013,6 +2013,23 @@ } ] }, + { + "name": "domain_server", + "label": "Setup Domain Server", + "restart": false, + "hidden": true, + "settings": [ + { + "name": "network_address", + "default": "" + }, + { + "name": "port", + "type": "int", + "default": 0 + } + ] + }, { "name": "installed_content", "label": "Installed Content", diff --git a/domain-server/resources/web/js/shared.js b/domain-server/resources/web/js/shared.js index bffd512890..542771c60e 100644 --- a/domain-server/resources/web/js/shared.js +++ b/domain-server/resources/web/js/shared.js @@ -129,9 +129,10 @@ function getCurrentDomainIDType() { return DOMAIN_ID_TYPE_UNKNOWN; } if (DomainInfo !== null) { - if (DomainInfo.name !== undefined) { - return DOMAIN_ID_TYPE_TEMP; - } + // Disabled because detecting as temp domain... and we're not even using temp domains right now. + // if (DomainInfo.name !== undefined) { + // return DOMAIN_ID_TYPE_TEMP; + // } return DOMAIN_ID_TYPE_FULL; } return DOMAIN_ID_TYPE_UNKNOWN; diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index f26dc4ac27..80458e7ad0 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1507,10 +1507,23 @@ QJsonObject jsonForDomainSocketUpdate(const HifiSockAddr& socket) { const QString DOMAIN_UPDATE_AUTOMATIC_NETWORKING_KEY = "automatic_networking"; void DomainServer::performIPAddressUpdate(const HifiSockAddr& newPublicSockAddr) { - sendHeartbeatToMetaverse(newPublicSockAddr.getAddress().toString()); + static const QString PUBLIC_SOCKET_ADDRESS_KEY = "network_address"; + static const QString PUBLIC_SOCKET_PORT_KEY = "port"; + const QString& publicSocketAddress = newPublicSockAddr.getAddress().toString(); + const int publicSocketPort = newPublicSockAddr.getPort(); + + sendHeartbeatToMetaverse(publicSocketAddress, publicSocketPort); + + QString newSettingsJSON = QString("{\"domain_server\": { \"%1\": \"%2\", \"%3\": %4}}") + .arg(PUBLIC_SOCKET_ADDRESS_KEY) + .arg(publicSocketAddress) + .arg(PUBLIC_SOCKET_PORT_KEY) + .arg(publicSocketPort); + auto settingsDocument = QJsonDocument::fromJson(newSettingsJSON.toUtf8()); + _settingsManager.recurseJSONObjectAndOverwriteSettings(settingsDocument.object(), DomainSettings); } -void DomainServer::sendHeartbeatToMetaverse(const QString& networkAddress) { +void DomainServer::sendHeartbeatToMetaverse(const QString& networkAddress, const int port) { // Setup the domain object to send to the data server QJsonObject domainObject; @@ -1520,10 +1533,23 @@ void DomainServer::sendHeartbeatToMetaverse(const QString& networkAddress) { static const QString PROTOCOL_VERSION_KEY = "protocol"; domainObject[PROTOCOL_VERSION_KEY] = protocolVersionsSignatureBase64(); - // add networking + static const QString PUBLIC_SOCKET_ADDRESS_KEY = "network_address"; + static const QString PUBLIC_SOCKET_PORT_KEY = "port"; + + static const QString NETWORK_ADDRESS_SETTINGS_KEY = "domain_server." + PUBLIC_SOCKET_ADDRESS_KEY; + const QString networkAddressFromSettings = _settingsManager.valueForKeyPath(NETWORK_ADDRESS_SETTINGS_KEY).toString(); if (!networkAddress.isEmpty()) { - static const QString PUBLIC_NETWORK_ADDRESS_KEY = "network_address"; - domainObject[PUBLIC_NETWORK_ADDRESS_KEY] = networkAddress; + domainObject[PUBLIC_SOCKET_ADDRESS_KEY] = networkAddress; + } else if (!networkAddressFromSettings.isEmpty()) { + domainObject[PUBLIC_SOCKET_ADDRESS_KEY] = networkAddressFromSettings; + } + + static const QString PORT_SETTINGS_KEY = "domain_server." + PUBLIC_SOCKET_PORT_KEY; + const int portFromSettings = _settingsManager.valueForKeyPath(PORT_SETTINGS_KEY).toInt(); + if (port != NULL) { + domainObject[PUBLIC_SOCKET_PORT_KEY] = port; + } else if (portFromSettings != NULL) { + domainObject[PUBLIC_SOCKET_PORT_KEY] = portFromSettings; } static const QString AUTOMATIC_NETWORKING_KEY = "automatic_networking"; diff --git a/domain-server/src/DomainServer.h b/domain-server/src/DomainServer.h index 7a09141db6..69c99e5cf4 100644 --- a/domain-server/src/DomainServer.h +++ b/domain-server/src/DomainServer.h @@ -113,7 +113,7 @@ private slots: void sendPendingTransactionsToServer(); void performIPAddressUpdate(const HifiSockAddr& newPublicSockAddr); - void sendHeartbeatToMetaverse() { sendHeartbeatToMetaverse(QString()); } + void sendHeartbeatToMetaverse() { sendHeartbeatToMetaverse(QString(), int()); } void sendHeartbeatToIceServer(); void nodePingMonitor(); @@ -176,7 +176,7 @@ private: void setupAutomaticNetworking(); void setupICEHeartbeatForFullNetworking(); void setupHeartbeatToMetaverse(); - void sendHeartbeatToMetaverse(const QString& networkAddress); + void sendHeartbeatToMetaverse(const QString& networkAddress, const int port); void randomizeICEServerAddress(bool shouldTriggerHostLookup); From 97681786cdfbc019e6bfa06480575fcb4416d6c0 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Wed, 25 Nov 2020 04:54:47 -0500 Subject: [PATCH 07/16] Potentially fix STUN IP+Port init for heartbeat issue? --- domain-server/src/DomainServer.cpp | 15 +++++++-------- domain-server/src/DomainServer.h | 2 +- libraries/networking/src/LimitedNodeList.cpp | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 80458e7ad0..66bb06b2d6 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -901,14 +901,13 @@ void DomainServer::setupAutomaticNetworking() { qDebug() << "domain-server" << _automaticNetworkingSetting << "automatic networking enabled for ID" << uuidStringWithoutCurlyBraces(domainID) << "via" << _oauthProviderURL.toString(); + auto nodeList = DependencyManager::get(); + + // send any public socket changes to the data server so nodes can find us at our new IP + connect(nodeList.data(), &LimitedNodeList::publicSockAddrChanged, this, + &DomainServer::performIPAddressPortUpdate); + if (_automaticNetworkingSetting == IP_ONLY_AUTOMATIC_NETWORKING_VALUE) { - - auto nodeList = DependencyManager::get(); - - // send any public socket changes to the data server so nodes can find us at our new IP - connect(nodeList.data(), &LimitedNodeList::publicSockAddrChanged, - this, &DomainServer::performIPAddressUpdate); - // have the LNL enable public socket updating via STUN nodeList->startSTUNPublicSocketUpdate(); } @@ -1506,7 +1505,7 @@ QJsonObject jsonForDomainSocketUpdate(const HifiSockAddr& socket) { const QString DOMAIN_UPDATE_AUTOMATIC_NETWORKING_KEY = "automatic_networking"; -void DomainServer::performIPAddressUpdate(const HifiSockAddr& newPublicSockAddr) { +void DomainServer::performIPAddressPortUpdate(const HifiSockAddr& newPublicSockAddr) { static const QString PUBLIC_SOCKET_ADDRESS_KEY = "network_address"; static const QString PUBLIC_SOCKET_PORT_KEY = "port"; const QString& publicSocketAddress = newPublicSockAddr.getAddress().toString(); diff --git a/domain-server/src/DomainServer.h b/domain-server/src/DomainServer.h index 69c99e5cf4..24d26540c1 100644 --- a/domain-server/src/DomainServer.h +++ b/domain-server/src/DomainServer.h @@ -112,7 +112,7 @@ private slots: void setupPendingAssignmentCredits(); void sendPendingTransactionsToServer(); - void performIPAddressUpdate(const HifiSockAddr& newPublicSockAddr); + void performIPAddressPortUpdate(const HifiSockAddr& newPublicSockAddr); void sendHeartbeatToMetaverse() { sendHeartbeatToMetaverse(QString(), int()); } void sendHeartbeatToIceServer(); void nodePingMonitor(); diff --git a/libraries/networking/src/LimitedNodeList.cpp b/libraries/networking/src/LimitedNodeList.cpp index d867b49b30..3da5b53dcb 100644 --- a/libraries/networking/src/LimitedNodeList.cpp +++ b/libraries/networking/src/LimitedNodeList.cpp @@ -1197,7 +1197,7 @@ void LimitedNodeList::stopInitialSTUNUpdate(bool success) { } // We now setup a timer here to fire every so often to check that our IP address has not changed. - // Or, if we failed - if will check if we can eventually get a public socket + // Or, if we failed - it will check if we can eventually get a public socket const int STUN_IP_ADDRESS_CHECK_INTERVAL_MSECS = 10 * 1000; QTimer* stunOccasionalTimer = new QTimer { this }; From cec112dd286c034d2f078262e9a90415cbcf587f Mon Sep 17 00:00:00 2001 From: Kalila L Date: Wed, 25 Nov 2020 15:19:35 -0500 Subject: [PATCH 08/16] "port" -> "network_port" --- domain-server/resources/describe-settings.json | 2 +- domain-server/src/DomainServer.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/domain-server/resources/describe-settings.json b/domain-server/resources/describe-settings.json index 2cef93ad53..bb7acf344c 100644 --- a/domain-server/resources/describe-settings.json +++ b/domain-server/resources/describe-settings.json @@ -2024,7 +2024,7 @@ "default": "" }, { - "name": "port", + "name": "network_port", "type": "int", "default": 0 } diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 66bb06b2d6..9f5c7e0bb0 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1507,7 +1507,7 @@ const QString DOMAIN_UPDATE_AUTOMATIC_NETWORKING_KEY = "automatic_networking"; void DomainServer::performIPAddressPortUpdate(const HifiSockAddr& newPublicSockAddr) { static const QString PUBLIC_SOCKET_ADDRESS_KEY = "network_address"; - static const QString PUBLIC_SOCKET_PORT_KEY = "port"; + static const QString PUBLIC_SOCKET_PORT_KEY = "network_port"; const QString& publicSocketAddress = newPublicSockAddr.getAddress().toString(); const int publicSocketPort = newPublicSockAddr.getPort(); @@ -1533,7 +1533,7 @@ void DomainServer::sendHeartbeatToMetaverse(const QString& networkAddress, const domainObject[PROTOCOL_VERSION_KEY] = protocolVersionsSignatureBase64(); static const QString PUBLIC_SOCKET_ADDRESS_KEY = "network_address"; - static const QString PUBLIC_SOCKET_PORT_KEY = "port"; + static const QString PUBLIC_SOCKET_PORT_KEY = "network_port"; static const QString NETWORK_ADDRESS_SETTINGS_KEY = "domain_server." + PUBLIC_SOCKET_ADDRESS_KEY; const QString networkAddressFromSettings = _settingsManager.valueForKeyPath(NETWORK_ADDRESS_SETTINGS_KEY).toString(); From 699f28c9b49f7add16080c7e46ec8f6bbc53b5ba Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Tue, 8 Dec 2020 23:36:57 -0500 Subject: [PATCH 09/16] New Material Icon and Harmonization Add a new entity in-world edition icon for Material (when not parented) and new version for the 4 existing icons: Now they are all dark gray (same tone) with a white border for a better visibility under different lighting. --- .../create/assets/images/icon-material.svg | 5 + .../create/assets/images/icon-particles.svg | 43 +++---- .../create/assets/images/icon-point-light.svg | 105 ++++++++---------- .../create/assets/images/icon-spot-light.svg | 63 +++++------ .../system/create/assets/images/icon-zone.svg | 72 +----------- 5 files changed, 95 insertions(+), 193 deletions(-) create mode 100644 scripts/system/create/assets/images/icon-material.svg diff --git a/scripts/system/create/assets/images/icon-material.svg b/scripts/system/create/assets/images/icon-material.svg new file mode 100644 index 0000000000..470fed5dbd --- /dev/null +++ b/scripts/system/create/assets/images/icon-material.svg @@ -0,0 +1,5 @@ + + + + +Layer 1 \ No newline at end of file diff --git a/scripts/system/create/assets/images/icon-particles.svg b/scripts/system/create/assets/images/icon-particles.svg index 5e0105d7cd..2b3f365889 100644 --- a/scripts/system/create/assets/images/icon-particles.svg +++ b/scripts/system/create/assets/images/icon-particles.svg @@ -1,29 +1,14 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + +Layer 1 \ No newline at end of file diff --git a/scripts/system/create/assets/images/icon-point-light.svg b/scripts/system/create/assets/images/icon-point-light.svg index 896c35b63b..0f2e91d55b 100644 --- a/scripts/system/create/assets/images/icon-point-light.svg +++ b/scripts/system/create/assets/images/icon-point-light.svg @@ -1,57 +1,48 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +Layer 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/scripts/system/create/assets/images/icon-spot-light.svg b/scripts/system/create/assets/images/icon-spot-light.svg index ac2f87bb27..d8e196ffd7 100644 --- a/scripts/system/create/assets/images/icon-spot-light.svg +++ b/scripts/system/create/assets/images/icon-spot-light.svg @@ -1,37 +1,26 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +Layer 1 + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/scripts/system/create/assets/images/icon-zone.svg b/scripts/system/create/assets/images/icon-zone.svg index 41aeac4951..bfd8e07160 100644 --- a/scripts/system/create/assets/images/icon-zone.svg +++ b/scripts/system/create/assets/images/icon-zone.svg @@ -1,73 +1,5 @@ - - - -image/svg+xmlLayer 1 \ No newline at end of file From 5a3f4b59c8db1d54180ba310ad66c94c12db637c Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Tue, 8 Dec 2020 23:39:26 -0500 Subject: [PATCH 10/16] Add a Name on the Material of the shape visualizer Add a Name on the Material of the shape visualizer to be able to exclude it when a zone is selected. --- scripts/system/create/modules/entityShapeVisualizer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/system/create/modules/entityShapeVisualizer.js b/scripts/system/create/modules/entityShapeVisualizer.js index 45cf68fdb5..7a1cd74d25 100644 --- a/scripts/system/create/modules/entityShapeVisualizer.js +++ b/scripts/system/create/modules/entityShapeVisualizer.js @@ -143,6 +143,7 @@ EntityShape.prototype = { var PROJECTED_MATERIALS = false; this.materialEntity = Entities.addEntity({ type: "Material", + name: "MATERIAL_" + this.entityShapeVisualizerSessionName, localPosition: Vec3.ZERO, localRotation: Quat.IDENTITY, localDimensions: properties.localDimensions, From aea3e7936fbdb971b5c702ff112c77fd0a126a3e Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Tue, 8 Dec 2020 23:52:04 -0500 Subject: [PATCH 11/16] Add Material icons in edit mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1- This adds a new Material icon to identify the material entities that are linked to a parent. Since those material entities become invisible, this help to figure their presence. 2- The Create App - Preference: "Show Zones in Create Mode" has been removed, since it was doing nothing for a couple of years now. the method behind is still in the API, but do nothing. (abandoned since it was only drawing a box that wasn't useful to figure the shape of the zone) There was no real value to bring this back in a different way. 3- The Create App - Preference: "Show Lights and Particle Systems in Create Mode" has been renamed for "Show Icons in Create Mode" since this setting was also managing all the icons (including Zones and now the Parented Materials) The objective of the setting is mainly to simplify the display at the edit when a scene is very dense. (In the future, we might want to make this "à la carte". For now, I think we can try as is. ) --- scripts/system/create/edit.js | 56 ++++++++++++++--------------------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/scripts/system/create/edit.js b/scripts/system/create/edit.js index fc3d4fc10f..9e94b68ba1 100644 --- a/scripts/system/create/edit.js +++ b/scripts/system/create/edit.js @@ -87,21 +87,24 @@ var PARTICLE_SYSTEM_URL = Script.resolvePath("assets/images/icon-particles.svg") var POINT_LIGHT_URL = Script.resolvePath("assets/images/icon-point-light.svg"); var SPOT_LIGHT_URL = Script.resolvePath("assets/images/icon-spot-light.svg"); var ZONE_URL = Script.resolvePath("assets/images/icon-zone.svg"); +var MATERIAL_URL = Script.resolvePath("assets/images/icon-material.svg"); -var entityIconOverlayManager = new EntityIconOverlayManager(['Light', 'ParticleEffect', 'Zone'], function(entityID) { - var properties = Entities.getEntityProperties(entityID, ['type', 'isSpotlight']); - if (properties.type === 'Light') { - return { - url: properties.isSpotlight ? SPOT_LIGHT_URL : POINT_LIGHT_URL, - }; - } else if (properties.type === 'Zone') { - return { - url: ZONE_URL, +var entityIconOverlayManager = new EntityIconOverlayManager(["Light", "ParticleEffect", "Zone", "Material"], function(entityID) { + var properties = Entities.getEntityProperties(entityID, ["type", "isSpotlight", "parentID", "name"]); + if (properties.type === "Light") { + return { + imageURL: properties.isSpotlight ? SPOT_LIGHT_URL : POINT_LIGHT_URL }; + } else if (properties.type === "Zone") { + return { imageURL: ZONE_URL }; + } else if (properties.type === "Material") { + if (properties.parentID !== Uuid.NULL && properties.name !== "MATERIAL_" + entityShapeVisualizerSessionName) { + return { imageURL: MATERIAL_URL }; + } else { + return { imageURL: "" }; + } } else { - return { - url: PARTICLE_SYSTEM_URL, - }; + return { imageURL: PARTICLE_SYSTEM_URL }; } }); @@ -154,8 +157,7 @@ var MENU_CREATE_SEPARATOR = "Create Application"; var SUBMENU_ENTITY_EDITOR_PREFERENCES = "Edit > Preferences"; var MENU_AUTO_FOCUS_ON_SELECT = "Auto Focus on Select"; var MENU_EASE_ON_FOCUS = "Ease Orientation on Focus"; -var MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE = "Show Lights and Particle Systems in Create Mode"; -var MENU_SHOW_ZONES_IN_EDIT_MODE = "Show Zones in Create Mode"; +var MENU_SHOW_ICONS_IN_CREATE_MODE = "Show Icons in Create Mode"; var MENU_CREATE_ENTITIES_GRABBABLE = "Create Entities As Grabbable (except Zones, Particles, and Lights)"; var MENU_ALLOW_SELECTION_LARGE = "Allow Selecting of Large Models"; var MENU_ALLOW_SELECTION_SMALL = "Allow Selecting of Small Models"; @@ -1041,8 +1043,7 @@ var toolBar = (function () { // everybody else to think that Interface has lost focus overall. fogbugzid:558 // Window.setFocus(); } - entityIconOverlayManager.setVisible(isActive && Menu.isOptionChecked(MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE)); - Entities.setDrawZoneBoundaries(isActive && Menu.isOptionChecked(MENU_SHOW_ZONES_IN_EDIT_MODE)); + entityIconOverlayManager.setVisible(isActive && Menu.isOptionChecked(MENU_SHOW_ICONS_IN_CREATE_MODE)); }; initialize(); @@ -1465,22 +1466,15 @@ function setupModelMenus() { }); Menu.addMenuItem({ menuName: SUBMENU_ENTITY_EDITOR_PREFERENCES, - menuItemName: MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE, + menuItemName: MENU_SHOW_ICONS_IN_CREATE_MODE, afterItem: MENU_EASE_ON_FOCUS, isCheckable: true, isChecked: Settings.getValue(SETTING_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE) !== "false" }); - Menu.addMenuItem({ - menuName: SUBMENU_ENTITY_EDITOR_PREFERENCES, - menuItemName: MENU_SHOW_ZONES_IN_EDIT_MODE, - afterItem: MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE, - isCheckable: true, - isChecked: Settings.getValue(SETTING_SHOW_ZONES_IN_EDIT_MODE) !== "false" - }); Menu.addMenuItem({ menuName: SUBMENU_ENTITY_EDITOR_PREFERENCES, menuItemName: MENU_ENTITY_LIST_DEFAULT_RADIUS, - afterItem: MENU_SHOW_ZONES_IN_EDIT_MODE + afterItem: MENU_SHOW_ICONS_IN_CREATE_MODE }); Entities.setLightsArePickable(false); @@ -1497,8 +1491,7 @@ function cleanupModelMenus() { Menu.removeMenuItem(SUBMENU_ENTITY_EDITOR_PREFERENCES, MENU_ALLOW_SELECTION_LIGHTS); Menu.removeMenuItem(SUBMENU_ENTITY_EDITOR_PREFERENCES, MENU_AUTO_FOCUS_ON_SELECT); Menu.removeMenuItem(SUBMENU_ENTITY_EDITOR_PREFERENCES, MENU_EASE_ON_FOCUS); - Menu.removeMenuItem(SUBMENU_ENTITY_EDITOR_PREFERENCES, MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE); - Menu.removeMenuItem(SUBMENU_ENTITY_EDITOR_PREFERENCES, MENU_SHOW_ZONES_IN_EDIT_MODE); + Menu.removeMenuItem(SUBMENU_ENTITY_EDITOR_PREFERENCES, MENU_SHOW_ICONS_IN_CREATE_MODE); Menu.removeMenuItem(SUBMENU_ENTITY_EDITOR_PREFERENCES, MENU_CREATE_ENTITIES_GRABBABLE); Menu.removeMenuItem(SUBMENU_ENTITY_EDITOR_PREFERENCES, MENU_ENTITY_LIST_DEFAULT_RADIUS); Menu.removeMenu(SUBMENU_ENTITY_EDITOR_PREFERENCES); @@ -1511,8 +1504,7 @@ Script.scriptEnding.connect(function () { toolBar.setActive(false); Settings.setValue(SETTING_AUTO_FOCUS_ON_SELECT, Menu.isOptionChecked(MENU_AUTO_FOCUS_ON_SELECT)); Settings.setValue(SETTING_EASE_ON_FOCUS, Menu.isOptionChecked(MENU_EASE_ON_FOCUS)); - Settings.setValue(SETTING_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE, Menu.isOptionChecked(MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE)); - Settings.setValue(SETTING_SHOW_ZONES_IN_EDIT_MODE, Menu.isOptionChecked(MENU_SHOW_ZONES_IN_EDIT_MODE)); + Settings.setValue(SETTING_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE, Menu.isOptionChecked(MENU_SHOW_ICONS_IN_CREATE_MODE)); Settings.setValue(SETTING_EDIT_PREFIX + MENU_ALLOW_SELECTION_LARGE, Menu.isOptionChecked(MENU_ALLOW_SELECTION_LARGE)); Settings.setValue(SETTING_EDIT_PREFIX + MENU_ALLOW_SELECTION_SMALL, Menu.isOptionChecked(MENU_ALLOW_SELECTION_SMALL)); @@ -1869,10 +1861,8 @@ function handleMenuEvent(menuItem) { undoHistory.undo(); } else if (menuItem === "Redo") { undoHistory.redo(); - } else if (menuItem === MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE) { - entityIconOverlayManager.setVisible(isActive && Menu.isOptionChecked(MENU_SHOW_LIGHTS_AND_PARTICLES_IN_EDIT_MODE)); - } else if (menuItem === MENU_SHOW_ZONES_IN_EDIT_MODE) { - Entities.setDrawZoneBoundaries(isActive && Menu.isOptionChecked(MENU_SHOW_ZONES_IN_EDIT_MODE)); + } else if (menuItem === MENU_SHOW_ICONS_IN_CREATE_MODE) { + entityIconOverlayManager.setVisible(isActive && Menu.isOptionChecked(MENU_SHOW_ICONS_IN_CREATE_MODE)); } else if (menuItem === MENU_CREATE_ENTITIES_GRABBABLE) { Settings.setValue(SETTING_EDIT_PREFIX + menuItem, Menu.isOptionChecked(menuItem)); } else if (menuItem === MENU_ENTITY_LIST_DEFAULT_RADIUS) { From 28e53c9c8686345a2747c76333c81c2a0a57dad9 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Tue, 8 Dec 2020 23:54:32 -0500 Subject: [PATCH 12/16] Migrate from 3dImage Overlay to Local Entities Migrate from 3dImage Overlay to Local Entities --- .../libraries/entityIconOverlayManager.js | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/system/libraries/entityIconOverlayManager.js b/scripts/system/libraries/entityIconOverlayManager.js index 68104ff4bb..bed83b55a0 100644 --- a/scripts/system/libraries/entityIconOverlayManager.js +++ b/scripts/system/libraries/entityIconOverlayManager.js @@ -29,7 +29,7 @@ EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) { overlayProperties[key] = customProperties[key]; } } - Overlays.editOverlay(entityOverlays[entityID], overlayProperties); + Entities.editEntity(entityOverlays[entityID], overlayProperties); } }; @@ -63,7 +63,7 @@ EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) { if (visible !== isVisible) { visible = isVisible; for (var id in entityOverlays) { - Overlays.editOverlay(entityOverlays[id], { + Entities.editEntity(entityOverlays[id], { visible: visible, ignorePickIntersection: !visible }); @@ -75,7 +75,11 @@ EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) { function getOverlay() { var overlay; if (unusedOverlays.length === 0) { - overlay = Overlays.addOverlay("image3d", {}); + overlay = Entities.addEntity({ + "type": "Image", + "billboardMode": "full", + "emissive": true + },"local"); allOverlays.push(overlay); } else { overlay = unusedOverlays.pop(); @@ -85,7 +89,7 @@ EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) { function releaseOverlay(overlay) { unusedOverlays.push(overlay); - Overlays.editOverlay(overlay, { + Entities.editEntity(overlay, { visible: false, ignorePickIntersection: true }); @@ -103,9 +107,8 @@ EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) { visible: visible, ignorePickIntersection: !visible, alpha: 0.9, - scale: 0.5, - drawInFront: true, - isFacingAvatar: true, + dimensions: { x: 0.5, y: 0.5, z: 0.01 }, + renderLayer: "front", color: { red: 255, green: 255, @@ -118,7 +121,7 @@ EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) { overlayProperties[key] = customProperties[key]; } } - Overlays.editOverlay(overlay, overlayProperties); + Entities.editEntity(overlay, overlayProperties); } } @@ -149,7 +152,7 @@ EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) { Script.scriptEnding.connect(function() { for (var i = 0; i < allOverlays.length; i++) { - Overlays.deleteOverlay(allOverlays[i]); + Entities.deleteEntity(allOverlays[i]); } }); }; From 0468c98c30eb8bba6e32c7a4531de18b9e4241d1 Mon Sep 17 00:00:00 2001 From: Kalila L Date: Fri, 11 Dec 2020 15:55:24 -0500 Subject: [PATCH 13/16] CR, move duplicate consts to top of file. --- domain-server/src/DomainServer.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 9f5c7e0bb0..5d72f71797 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -68,6 +68,9 @@ Q_LOGGING_CATEGORY(domain_server_ice, "hifi.domain_server.ice") const QString ACCESS_TOKEN_KEY_PATH = "metaverse.access_token"; const QString DomainServer::REPLACEMENT_FILE_EXTENSION = ".replace"; +const QString PUBLIC_SOCKET_ADDRESS_KEY = "network_address"; +const QString PUBLIC_SOCKET_PORT_KEY = "network_port"; +const QString DOMAIN_UPDATE_AUTOMATIC_NETWORKING_KEY = "automatic_networking"; const int MIN_PORT = 1; const int MAX_PORT = 65535; @@ -1503,11 +1506,7 @@ QJsonObject jsonForDomainSocketUpdate(const HifiSockAddr& socket) { return socketObject; } -const QString DOMAIN_UPDATE_AUTOMATIC_NETWORKING_KEY = "automatic_networking"; - void DomainServer::performIPAddressPortUpdate(const HifiSockAddr& newPublicSockAddr) { - static const QString PUBLIC_SOCKET_ADDRESS_KEY = "network_address"; - static const QString PUBLIC_SOCKET_PORT_KEY = "network_port"; const QString& publicSocketAddress = newPublicSockAddr.getAddress().toString(); const int publicSocketPort = newPublicSockAddr.getPort(); @@ -1532,9 +1531,6 @@ void DomainServer::sendHeartbeatToMetaverse(const QString& networkAddress, const static const QString PROTOCOL_VERSION_KEY = "protocol"; domainObject[PROTOCOL_VERSION_KEY] = protocolVersionsSignatureBase64(); - static const QString PUBLIC_SOCKET_ADDRESS_KEY = "network_address"; - static const QString PUBLIC_SOCKET_PORT_KEY = "network_port"; - static const QString NETWORK_ADDRESS_SETTINGS_KEY = "domain_server." + PUBLIC_SOCKET_ADDRESS_KEY; const QString networkAddressFromSettings = _settingsManager.valueForKeyPath(NETWORK_ADDRESS_SETTINGS_KEY).toString(); if (!networkAddress.isEmpty()) { From 5c9b1edb86bb435c1c41053b614a61073319065a Mon Sep 17 00:00:00 2001 From: Kalila L Date: Mon, 14 Dec 2020 01:03:36 -0500 Subject: [PATCH 14/16] Convert QString to QJsonObject. --- domain-server/src/DomainServer.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 5d72f71797..1d7ef7fcfc 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1507,18 +1507,19 @@ QJsonObject jsonForDomainSocketUpdate(const HifiSockAddr& socket) { } void DomainServer::performIPAddressPortUpdate(const HifiSockAddr& newPublicSockAddr) { + const QString& DOMAIN_SERVER_SETTINGS_KEY = "domain_server"; const QString& publicSocketAddress = newPublicSockAddr.getAddress().toString(); const int publicSocketPort = newPublicSockAddr.getPort(); sendHeartbeatToMetaverse(publicSocketAddress, publicSocketPort); - QString newSettingsJSON = QString("{\"domain_server\": { \"%1\": \"%2\", \"%3\": %4}}") - .arg(PUBLIC_SOCKET_ADDRESS_KEY) - .arg(publicSocketAddress) - .arg(PUBLIC_SOCKET_PORT_KEY) - .arg(publicSocketPort); - auto settingsDocument = QJsonDocument::fromJson(newSettingsJSON.toUtf8()); - _settingsManager.recurseJSONObjectAndOverwriteSettings(settingsDocument.object(), DomainSettings); + QJsonObject rootObject; + QJsonObject domainServerObject; + domainServerObject.insert(PUBLIC_SOCKET_ADDRESS_KEY, publicSocketAddress); + domainServerObject.insert(PUBLIC_SOCKET_PORT_KEY, publicSocketPort); + rootObject.insert(DOMAIN_SERVER_SETTINGS_KEY, domainServerObject); + QJsonDocument doc(rootObject); + _settingsManager.recurseJSONObjectAndOverwriteSettings(rootObject, DomainSettings); } void DomainServer::sendHeartbeatToMetaverse(const QString& networkAddress, const int port) { From 7ff8236da26f0c0e2d1c3e37c425aeb22ddf6789 Mon Sep 17 00:00:00 2001 From: Alezia Kurdis <60075796+AleziaKurdis@users.noreply.github.com> Date: Thu, 17 Dec 2020 22:07:11 -0500 Subject: [PATCH 15/16] Minor Code Adjustments Minor Code Adjustments --- scripts/system/libraries/entityIconOverlayManager.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/system/libraries/entityIconOverlayManager.js b/scripts/system/libraries/entityIconOverlayManager.js index bed83b55a0..f2ca5625ea 100644 --- a/scripts/system/libraries/entityIconOverlayManager.js +++ b/scripts/system/libraries/entityIconOverlayManager.js @@ -76,10 +76,10 @@ EntityIconOverlayManager = function(entityTypes, getOverlayPropertiesFunc) { var overlay; if (unusedOverlays.length === 0) { overlay = Entities.addEntity({ - "type": "Image", - "billboardMode": "full", - "emissive": true - },"local"); + type: "Image", + billboardMode: "full", + emissive: true + }, "local"); allOverlays.push(overlay); } else { overlay = unusedOverlays.pop(); From 0f9f95f716f7c6bfb2ac3d7f7a1631709817f56f Mon Sep 17 00:00:00 2001 From: HifiExperiments Date: Mon, 28 Dec 2020 23:46:37 -0800 Subject: [PATCH 16/16] possible fix for physics --- .../entities-renderer/src/RenderableModelEntityItem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index e13ab6f837..c694f496d6 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -189,9 +189,6 @@ void RenderableModelEntityItem::updateModelBounds() { glm::vec3 scale = model->getScale(); model->setUseDualQuaternionSkinning(!isNonUniformScale(scale)); model->updateRenderItems(); - - markDirtyFlags(Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS); - locationChanged(); } } @@ -1267,6 +1264,9 @@ void ModelEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPoint entity->_originalTexturesRead = false; entity->_needsJointSimulation = true; entity->_needsToRescaleModel = true; + + entity->markDirtyFlags(Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS); + entity->locationChanged(); emit requestRenderUpdate(); }); scene->enqueueTransaction(transaction);