From d811660ed6f0da1574aadb2d114f1649ae84eb81 Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Wed, 9 Dec 2015 11:07:10 -0800 Subject: [PATCH 01/26] DO NOT MERGE - Testing PR environment --- README.md | 2 ++ cmake/modules/FindOpenSSL.cmake | 1 + 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index a2eb058ae6..7741445842 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +### TESTING BUILD - DO NOT MERGE ### + High Fidelity (hifi) is an early-stage technology lab experimenting with Virtual Worlds and VR. In this repository you'll find the source to many of the components in our diff --git a/cmake/modules/FindOpenSSL.cmake b/cmake/modules/FindOpenSSL.cmake index 9d9557ad9e..6893948d01 100644 --- a/cmake/modules/FindOpenSSL.cmake +++ b/cmake/modules/FindOpenSSL.cmake @@ -256,6 +256,7 @@ if (WIN32) # For some reason fixup misses the following DLL and only copies libeay32. There's gotta be a better way to handle this # but for now resorting to the following interm solution if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE) + message(STATUS "*********** Copying SSL DLL from ${OPENSSL_DLL_PATH}/ssleay32.dll") add_custom_command( TARGET ${TARGET_NAME} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy ${OPENSSL_DLL_PATH}/ssleay32.dll ${CMAKE_BINARY_DIR}/full-stack-deployment/ From 711d02ba2f44d7bef93c36e8079642d35e72e105 Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Wed, 16 Dec 2015 14:26:24 -0600 Subject: [PATCH 02/26] Consolidating installer checkpoint --- CMakeLists.txt | 42 ++--- cmake/macros/ConsolidateStackComponents.cmake | 37 ++-- cmake/modules/FindOpenSSL.cmake | 1 - tools/nsis/release.nsi | 176 ++++++++++++++++++ 4 files changed, 207 insertions(+), 49 deletions(-) create mode 100644 tools/nsis/release.nsi diff --git a/CMakeLists.txt b/CMakeLists.txt index a8271abd8e..836b808a4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12.2) +cmake_minimum_required(VERSION 3.3.2) if (USE_ANDROID_TOOLCHAIN) set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/android/android.toolchain.cmake") @@ -230,32 +230,14 @@ endif () include_application_version() if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE) - message(STATUS "+++++ Package for deployment will be generated on this build +++++") - - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/full-stack-deployment) - - set(ICONPATH_INTERFACE "$INSTDIR/${PATH_INSTALL_DATA}/interface.ico") - set(ICONPATH_STACK_MANAGER "$INSTDIR/${PATH_INSTALL_DATA}/stack-manager.ico") - string(REPLACE "/" "\\\\" ICONPATH_INTERFACE ${ICONPATH_INTERFACE}) - string(REPLACE "/" "\\\\" ICONPATH_STACK_MANAGER ${ICONPATH_STACK_MANAGER}) - - set(CPACK_PACKAGE_NAME "High Fidelity") - set(CPACK_PACKAGE_VENDOR "High Fidelity, Inc") - set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "High Fidelity Interface and Stack") - set(CPACK_PACKAGE_VERSION "${BUILD_SEQ}") - set(CPACK_PACKAGE_VERSION_MAJOR "${BUILD_SEQ}") - set(CPACK_PACKAGE_VERSION_MINOR "0") - set(CPACK_PACKAGE_VERSION_PATCH "0") - set(CPACK_PACKAGE_INSTALL_DIRECTORY "High Fidelity-${BUILD_SEQ}") - set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".") - set(CPACK_PACKAGE_EXECUTABLES - stack-manager "Stack Manager" - interface "Interface" - ) - - if (WIN32) - install(DIRECTORY ${CMAKE_BINARY_DIR}/full-stack-deployment/ DESTINATION "./") - endif (WIN32) - - include(CPack) -endif () + file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/full-stack-deployment") + find_program(MAKENSIS_COMMAND makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\NSIS]) + if (NOT MAKENSIS_COMMAND) + message(FATAL_ERROR "The Nullsoft Scriptable Install Systems is required for generating packaged installers on Windows (http://nsis.sourceforge.net/)") + endif () + add_custom_target( + build-package ALL + DEPENDS interface assignment-client domain-server stack-manager + COMMAND CMD /C "\"${MAKENSIS_COMMAND}\" ${CMAKE_SOURCE_DIR}/tools/nsis/release.nsi" + ) +endif () \ No newline at end of file diff --git a/cmake/macros/ConsolidateStackComponents.cmake b/cmake/macros/ConsolidateStackComponents.cmake index 4bcc777751..ca272f6485 100644 --- a/cmake/macros/ConsolidateStackComponents.cmake +++ b/cmake/macros/ConsolidateStackComponents.cmake @@ -1,26 +1,27 @@ macro(CONSOLIDATE_STACK_COMPONENTS) - if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE AND WIN32) - - # Copy all the output for this target into the common deployment location - add_custom_command( - TARGET ${TARGET_NAME} POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E copy_directory $ ${CMAKE_BINARY_DIR}/full-stack-deployment - ) - - # Copy icon files for interface and stack manager - if (TARGET_NAME STREQUAL "interface" OR TARGET_NAME STREQUAL "stack-manager") - if (TARGET_NAME STREQUAL "interface") - set (ICON_FILE_PATH "${PROJECT_SOURCE_DIR}/icon/interface.ico") - set (ICON_DESTINATION_NAME "interface.ico") - elseif (TARGET_NAME STREQUAL "stack-manager") - set (ICON_FILE_PATH "${PROJECT_SOURCE_DIR}/assets/icon.ico") - set (ICON_DESTINATION_NAME "stack-manager.ico") - endif () + if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE) + if (WIN32) + # Copy all the output for this target into the common deployment location add_custom_command( TARGET ${TARGET_NAME} POST_BUILD - COMMAND "${CMAKE_COMMAND}" -E copy ${ICON_FILE_PATH} ${CMAKE_BINARY_DIR}/full-stack-deployment/${ICON_DESTINATION_NAME} + COMMAND "${CMAKE_COMMAND}" -E copy_directory $ ${CMAKE_BINARY_DIR}/full-stack-deployment ) + + # Copy icon files for interface and stack manager + if (TARGET_NAME STREQUAL "interface" OR TARGET_NAME STREQUAL "stack-manager") + if (TARGET_NAME STREQUAL "interface") + set (ICON_FILE_PATH "${PROJECT_SOURCE_DIR}/icon/interface.ico") + set (ICON_DESTINATION_NAME "interface.ico") + elseif (TARGET_NAME STREQUAL "stack-manager") + set (ICON_FILE_PATH "${PROJECT_SOURCE_DIR}/assets/icon.ico") + set (ICON_DESTINATION_NAME "stack-manager.ico") + endif () + add_custom_command( + TARGET ${TARGET_NAME} POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E copy ${ICON_FILE_PATH} ${CMAKE_BINARY_DIR}/full-stack-deployment/${ICON_DESTINATION_NAME} + ) + endif () endif () endif () diff --git a/cmake/modules/FindOpenSSL.cmake b/cmake/modules/FindOpenSSL.cmake index 6893948d01..9d9557ad9e 100644 --- a/cmake/modules/FindOpenSSL.cmake +++ b/cmake/modules/FindOpenSSL.cmake @@ -256,7 +256,6 @@ if (WIN32) # For some reason fixup misses the following DLL and only copies libeay32. There's gotta be a better way to handle this # but for now resorting to the following interm solution if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE) - message(STATUS "*********** Copying SSL DLL from ${OPENSSL_DLL_PATH}/ssleay32.dll") add_custom_command( TARGET ${TARGET_NAME} POST_BUILD COMMAND "${CMAKE_COMMAND}" -E copy ${OPENSSL_DLL_PATH}/ssleay32.dll ${CMAKE_BINARY_DIR}/full-stack-deployment/ diff --git a/tools/nsis/release.nsi b/tools/nsis/release.nsi new file mode 100644 index 0000000000..5b2cce5c61 --- /dev/null +++ b/tools/nsis/release.nsi @@ -0,0 +1,176 @@ +!include LogicLib.nsh +!include x64.nsh + +!define srcdir "E:\development\md-hifi\build\full-stack-deployment" ;$%INSTALLER_SOURCE_DIR% +!define setup "E:\development\md-hifi\build\installer-test.exe" ;$%INSTALLER_NAME% +!define scriptsdir "E:\development\md-hifi\examples" ;$%INSTALLER_SCRIPTS_DIR% +!define company "High Fidelity" +!define prodname "Interface" +!define exec "interface.exe" +!define icon "${srcdir}\interface.ico" +!define regkey "Software\${company}\${prodname}" +!define uninstkey "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" +!define install_dir_company "$PROGRAMFILES64\${company}" +!define install_dir_product "${install_dir_company}\${prodname}" +!define startmenu_company "$SMPROGRAMS\${company}" +!define startmenu_product "${startmenu_company}\${prodname}" +!define uninstaller "uninstall.exe" + +;-------------------------------- + +XPStyle on +ShowInstDetails hide +ShowUninstDetails hide + +Name "${prodname}" +Caption "${prodname}" + +!ifdef icon + Icon "${icon}" +!endif + +OutFile "${setup}" + +SetDateSave on +SetDatablockOptimize on +CRCCheck on +SilentInstall normal + +InstallDir "${install_dir_product}" +InstallDirRegKey HKLM "${regkey}" "" + +; Page components +Page directory +Page components +Page instfiles + +UninstPage uninstConfirm +UninstPage instfiles + +;-------------------------------- + +AutoCloseWindow true +ShowInstDetails show + + +!ifdef screenimage + + ; set up background image + ; uses BgImage plugin + + Function .onGUIInit + ; extract background BMP into temp plugin directory + InitPluginsDir + File /oname=$PLUGINSDIR\1.bmp "${screenimage}" + + BgImage::SetBg /NOUNLOAD /FILLSCREEN $PLUGINSDIR\1.bmp + BgImage::Redraw /NOUNLOAD + FunctionEnd + + Function .onGUIEnd + ; Destroy must not have /NOUNLOAD so NSIS will be able to unload and delete BgImage before it exits + BgImage::Destroy + FunctionEnd + +!endif + +; Optional Component Selection +Section /o "DDE Face Recognition" SEC01 + SetOutPath "$INSTDIR" + CreateDirectory $INSTDIR\dde + NSISdl::download "https://s3-us-west-1.amazonaws.com/hifi-production/optionals/dde-installer.exe" "$INSTDIR\dde-installer.exe" + ExecWait '"$INSTDIR\dde-installer.exe" /q:a /t:"$INSTDIR\dde"' +SectionEnd + +; beginning (invisible) section +Section "Registry Entries and Procotol Handler" SEC02 + + SectionIn RO + + WriteRegStr HKLM "${regkey}" "Install_Dir" "$INSTDIR" + WriteRegStr HKLM "${uninstkey}" "DisplayName" "${prodname} (remove only)" + WriteRegStr HKLM "${uninstkey}" "UninstallString" '"$INSTDIR\${uninstaller}"' + WriteRegStr HKCR "${prodname}\Shell\open\command\" "" '"$INSTDIR\${exec} "%1"' + + !ifdef icon + WriteRegStr HKCR "${prodname}\DefaultIcon" "" "$INSTDIR\${icon}" + !endif + + ; hifi:// protocol handler registry entries + WriteRegStr HKCR 'hifi' '' 'URL:Alert Protocol' + WriteRegStr HKCR 'hifi' 'URL Protocol' '' + WriteRegStr HKCR 'hifi\DefaultIcon' '' '$INSTDIR\${icon},1' + WriteRegStr HKCR 'hifi\shell\open\command' '' '$INSTDIR\${exec} --url "%1"' + + SetOutPath $INSTDIR + + ; package all files, recursively, preserving attributes + ; assume files are in the correct places + File /r "${srcdir}\" + !ifdef icon + File /a "${icon}" + !endif + ; any application-specific files + !ifdef files + !include "${files}" + !endif + SetOutPath "$DOCUMENTS\${company}\Scripts" + File /r "${scriptsdir}\" + SetOutPath $INSTDIR + WriteUninstaller "${uninstaller}" + Exec '"$INSTDIR\2013_vcredist_x64.exe" /q /norestart' + Exec '"$INSTDIR\2010_vcredist_x86.exe" /q /norestart' +SectionEnd + +; create shortcuts +Section "Start Menu Shortcuts" SEC03 + + SectionIn RO + + ; This should install the shortcuts for "All Users" + SetShellVarContext all + CreateDirectory "${startmenu_product}" + SetOutPath $INSTDIR ; for working directory + !ifdef icon + CreateShortCut "${startmenu_product}\${prodname}.lnk" "$INSTDIR\${exec}" "" "$INSTDIR\${icon}" + !else + CreateShortCut "${startmenu_product}\${prodname}.lnk" "$INSTDIR\${exec}" + !endif + + CreateShortCut "${startmenu_product}\Uninstall ${prodname}.lnk" "$INSTDIR\${uninstaller}" +SectionEnd + +; Uninstaller +; All section names prefixed by "Un" will be in the uninstaller + +UninstallText "This will uninstall ${prodname}." + +!ifdef icon + UninstallIcon "${icon}" +!endif + +Section "Uninstall" SEC04 + + SectionIn RO + + ; Explicitly remove all added shortcuts + SetShellVarContext all + DELETE "${startmenu_product}\${prodname}.lnk" + DELETE "${startmenu_product}\Uninstall ${prodname}.lnk" + + RMDIR "${startmenu_product}" + ; This should remove the High Fidelity folder in Start Menu if it's empty + RMDIR "${startmenu_company}" + + RMDIR /r "$INSTDIR" + ; This should remove the High Fidelity folder in Program Files if it's empty + RMDIR "${install_dir_company}" + + !ifdef unfiles + !include "${unfiles}" + !endif + ; It's good practice to put the registry key removal at the very end + DeleteRegKey HKLM "${uninstkey}" + DeleteRegKey HKLM "${regkey}" + DeleteRegKey HKCR 'hifi' +SectionEnd \ No newline at end of file From 56ef52022dd17d9defc3fe25c144337b0826eb33 Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Wed, 16 Dec 2015 14:28:05 -0600 Subject: [PATCH 03/26] Removing unwanted changes --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 7741445842..a2eb058ae6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -### TESTING BUILD - DO NOT MERGE ### - High Fidelity (hifi) is an early-stage technology lab experimenting with Virtual Worlds and VR. In this repository you'll find the source to many of the components in our From 5ed422e3a19687a941fb5476212a30d854ccaaec Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Wed, 16 Dec 2015 14:28:49 -0600 Subject: [PATCH 04/26] Removing unwanted changes --- CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 836b808a4c..b2ed36a8c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,9 +67,9 @@ if ((NOT MSVC12) AND (NOT MSVC14)) CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) if (COMPILER_SUPPORTS_CXX11) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") elseif(COMPILER_SUPPORTS_CXX0X) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") else() message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") endif() @@ -235,9 +235,9 @@ if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE) if (NOT MAKENSIS_COMMAND) message(FATAL_ERROR "The Nullsoft Scriptable Install Systems is required for generating packaged installers on Windows (http://nsis.sourceforge.net/)") endif () - add_custom_target( - build-package ALL - DEPENDS interface assignment-client domain-server stack-manager + add_custom_target( + build-package ALL + DEPENDS interface assignment-client domain-server stack-manager COMMAND CMD /C "\"${MAKENSIS_COMMAND}\" ${CMAKE_SOURCE_DIR}/tools/nsis/release.nsi" - ) + ) endif () \ No newline at end of file From cbed8bf35a8001c309b8a136fbd5c04650e96251 Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Wed, 16 Dec 2015 15:12:14 -0600 Subject: [PATCH 05/26] NSIS Changes --- CMakeLists.txt | 3 ++ tools/nsis/release.nsi | 71 +++++++++++++++++------------------------- 2 files changed, 32 insertions(+), 42 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b2ed36a8c5..69e6365c8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -238,6 +238,9 @@ if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE) add_custom_target( build-package ALL DEPENDS interface assignment-client domain-server stack-manager + COMMAND set INSTALLER_SOURCE_DIR=${CMAKE_BINARY_DIR}/full-stack-deployment + COMMAND set INSTALLER_NAME=${CMAKE_BINARY_DIR}/this-is-a-test.exe + COMMANE set INSTALLER_SCRIPTS_DIR=${CMAKE_SOURCE_DIR}/examples COMMAND CMD /C "\"${MAKENSIS_COMMAND}\" ${CMAKE_SOURCE_DIR}/tools/nsis/release.nsi" ) endif () \ No newline at end of file diff --git a/tools/nsis/release.nsi b/tools/nsis/release.nsi index 5b2cce5c61..86ea055e6b 100644 --- a/tools/nsis/release.nsi +++ b/tools/nsis/release.nsi @@ -1,19 +1,18 @@ !include LogicLib.nsh !include x64.nsh -!define srcdir "E:\development\md-hifi\build\full-stack-deployment" ;$%INSTALLER_SOURCE_DIR% -!define setup "E:\development\md-hifi\build\installer-test.exe" ;$%INSTALLER_NAME% -!define scriptsdir "E:\development\md-hifi\examples" ;$%INSTALLER_SCRIPTS_DIR% -!define company "High Fidelity" -!define prodname "Interface" -!define exec "interface.exe" -!define icon "${srcdir}\interface.ico" -!define regkey "Software\${company}\${prodname}" -!define uninstkey "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" +!define srcdir $%INSTALLER_SOURCE_DIR% +!define setup $%INSTALLER_NAME% +!define scriptsdir $%INSTALLER_SCRIPTS_DIR% +!define company $%INSTALLER_COMPANY% +!define interface_exec "interface.exe" +!define stack_manager_exec "stack-manager.exe" +!define interface_icon "interface.ico" +!define stack_manager_icon "stack-manager.ico" +!define regkey "Software\${company}" +!define uninstkey "Software\Microsoft\Windows\CurrentVersion\Uninstall\${company}" !define install_dir_company "$PROGRAMFILES64\${company}" -!define install_dir_product "${install_dir_company}\${prodname}" !define startmenu_company "$SMPROGRAMS\${company}" -!define startmenu_product "${startmenu_company}\${prodname}" !define uninstaller "uninstall.exe" ;-------------------------------- @@ -22,8 +21,8 @@ XPStyle on ShowInstDetails hide ShowUninstDetails hide -Name "${prodname}" -Caption "${prodname}" +Name "${company}" +Caption "${company}" !ifdef icon Icon "${icon}" @@ -36,7 +35,7 @@ SetDatablockOptimize on CRCCheck on SilentInstall normal -InstallDir "${install_dir_product}" +InstallDir "${install_dir_company}" InstallDirRegKey HKLM "${regkey}" "" ; Page components @@ -88,35 +87,28 @@ Section "Registry Entries and Procotol Handler" SEC02 SectionIn RO WriteRegStr HKLM "${regkey}" "Install_Dir" "$INSTDIR" - WriteRegStr HKLM "${uninstkey}" "DisplayName" "${prodname} (remove only)" + WriteRegStr HKLM "${uninstkey}" "DisplayName" "${company} (remove only)" WriteRegStr HKLM "${uninstkey}" "UninstallString" '"$INSTDIR\${uninstaller}"' - WriteRegStr HKCR "${prodname}\Shell\open\command\" "" '"$INSTDIR\${exec} "%1"' - - !ifdef icon - WriteRegStr HKCR "${prodname}\DefaultIcon" "" "$INSTDIR\${icon}" - !endif + WriteRegStr HKCR "${company}\Shell\open\command\" "" '"$INSTDIR\${interface_exec} "%1"' + WriteRegStr HKCR "${company}\DefaultIcon" "" "$INSTDIR\${interface_icon}" ; hifi:// protocol handler registry entries WriteRegStr HKCR 'hifi' '' 'URL:Alert Protocol' WriteRegStr HKCR 'hifi' 'URL Protocol' '' - WriteRegStr HKCR 'hifi\DefaultIcon' '' '$INSTDIR\${icon},1' - WriteRegStr HKCR 'hifi\shell\open\command' '' '$INSTDIR\${exec} --url "%1"' + WriteRegStr HKCR 'hifi\DefaultIcon' '' '$INSTDIR\${interface_icon},1' + WriteRegStr HKCR 'hifi\shell\open\command' '' '$INSTDIR\${interface_exec} --url "%1"' SetOutPath $INSTDIR ; package all files, recursively, preserving attributes ; assume files are in the correct places File /r "${srcdir}\" - !ifdef icon - File /a "${icon}" - !endif + File /a "${srcdir}\${interface_icon}" + File /a "${srcdir}\${stack_manager_icon}" ; any application-specific files !ifdef files !include "${files}" !endif - SetOutPath "$DOCUMENTS\${company}\Scripts" - File /r "${scriptsdir}\" - SetOutPath $INSTDIR WriteUninstaller "${uninstaller}" Exec '"$INSTDIR\2013_vcredist_x64.exe" /q /norestart' Exec '"$INSTDIR\2010_vcredist_x86.exe" /q /norestart' @@ -129,24 +121,20 @@ Section "Start Menu Shortcuts" SEC03 ; This should install the shortcuts for "All Users" SetShellVarContext all - CreateDirectory "${startmenu_product}" + CreateDirectory "${startmenu_company}" SetOutPath $INSTDIR ; for working directory - !ifdef icon - CreateShortCut "${startmenu_product}\${prodname}.lnk" "$INSTDIR\${exec}" "" "$INSTDIR\${icon}" - !else - CreateShortCut "${startmenu_product}\${prodname}.lnk" "$INSTDIR\${exec}" - !endif - - CreateShortCut "${startmenu_product}\Uninstall ${prodname}.lnk" "$INSTDIR\${uninstaller}" + CreateShortCut "${startmenu_company}\Interface.lnk" "$INSTDIR\${interface_exec}" "" "$INSTDIR\${interface_icon}" + CreateShortCut "${startmenu_company}\Stack Manager.lnk" "$INSTDIR\${stack_manager_exec}" "" "$INSTDIR\${stack_manager_icon}" + CreateShortCut "${startmenu_company}\Uninstall ${company}.lnk" "$INSTDIR\${uninstaller}" SectionEnd ; Uninstaller ; All section names prefixed by "Un" will be in the uninstaller -UninstallText "This will uninstall ${prodname}." +UninstallText "This will uninstall ${company}." !ifdef icon - UninstallIcon "${icon}" + UninstallIcon "${interface_icon}" !endif Section "Uninstall" SEC04 @@ -155,11 +143,10 @@ Section "Uninstall" SEC04 ; Explicitly remove all added shortcuts SetShellVarContext all - DELETE "${startmenu_product}\${prodname}.lnk" - DELETE "${startmenu_product}\Uninstall ${prodname}.lnk" + DELETE "${startmenu_company}\Interface.lnk" + DELETE "${startmenu_company}\Stack Manager.lnk" + DELETE "${startmenu_company}\Uninstall ${company}.lnk" - RMDIR "${startmenu_product}" - ; This should remove the High Fidelity folder in Start Menu if it's empty RMDIR "${startmenu_company}" RMDIR /r "$INSTDIR" From 66770cc907c654d03b01dd6dc3b5a294467955b8 Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Wed, 16 Dec 2015 16:11:35 -0600 Subject: [PATCH 06/26] Finishing touches --- CMakeLists.txt | 6 ++++-- cmake/macros/IncludeApplicationVersion.cmake | 17 +++++++++++++---- tools/nsis/release.nsi | 13 +++++++------ 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 69e6365c8c..ca3e381405 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -239,8 +239,10 @@ if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE) build-package ALL DEPENDS interface assignment-client domain-server stack-manager COMMAND set INSTALLER_SOURCE_DIR=${CMAKE_BINARY_DIR}/full-stack-deployment - COMMAND set INSTALLER_NAME=${CMAKE_BINARY_DIR}/this-is-a-test.exe - COMMANE set INSTALLER_SCRIPTS_DIR=${CMAKE_SOURCE_DIR}/examples + COMMAND set INSTALLER_NAME=${CMAKE_BINARY_DIR}/${INSTALLER_NAME} + COMMAND set INSTALLER_SCRIPTS_DIR=${CMAKE_SOURCE_DIR}/examples + COMMAND set INSTALLER_COMPANY=${INSTALLER_COMPANY} + COMMAND set INSTALLER_DIRECTORY=${INSTALLER_DIRECTORY} COMMAND CMD /C "\"${MAKENSIS_COMMAND}\" ${CMAKE_SOURCE_DIR}/tools/nsis/release.nsi" ) endif () \ No newline at end of file diff --git a/cmake/macros/IncludeApplicationVersion.cmake b/cmake/macros/IncludeApplicationVersion.cmake index a91aad6acc..753a12a01c 100644 --- a/cmake/macros/IncludeApplicationVersion.cmake +++ b/cmake/macros/IncludeApplicationVersion.cmake @@ -14,13 +14,22 @@ macro(INCLUDE_APPLICATION_VERSION) # We are relying on Jenkins defined environment variables to determine the origin of this build # and will only package if this is a PR or Release build if (DEFINED ENV{JOB_ID}) - set (DEPLOY_PACKAGE 1) - set (BUILD_SEQ $ENV{JOB_ID}) + set(DEPLOY_PACKAGE 1) + set(BUILD_SEQ $ENV{JOB_ID}) + set(INSTALLER_COMPANY "High Fidelity") + set(INSTALLER_DIRECTORY "${INSTALLER_COMPANY}") + set(INSTALLER_NAME "interface-win64-${BUILD_SEQ}.exe") elseif (DEFINED ENV{ghprbPullId}) - set (DEPLOY_PACKAGE 1) - set (BUILD_SEQ "PR-$ENV{ghprbPullId}") + set(DEPLOY_PACKAGE 1) + set(BUILD_SEQ "PR-$ENV{ghprbPullId}") + set(INSTALLER_COMPANY "High Fidelity - PR") + set(INSTALLER_DIRECTORY "${INSTALLER_COMPANY}\\${BUILD_SEQ}") + set(INSTALLER_NAME "pr-interface-win64-${BUILD_SEQ}.exe") else () set(BUILD_SEQ "dev") + set(INSTALLER_COMPANY "High Fidelity - Dev") + set(INSTALLER_DIRECTORY "${INSTALLER_COMPANY}") + set(INSTALLER_NAME "dev-interface-win64.exe") endif () configure_file("${MACRO_DIR}/ApplicationVersion.h.in" "${PROJECT_BINARY_DIR}/includes/ApplicationVersion.h") include_directories("${PROJECT_BINARY_DIR}/includes") diff --git a/tools/nsis/release.nsi b/tools/nsis/release.nsi index 86ea055e6b..9bc75e5274 100644 --- a/tools/nsis/release.nsi +++ b/tools/nsis/release.nsi @@ -1,18 +1,19 @@ !include LogicLib.nsh !include x64.nsh -!define srcdir $%INSTALLER_SOURCE_DIR% -!define setup $%INSTALLER_NAME% -!define scriptsdir $%INSTALLER_SCRIPTS_DIR% -!define company $%INSTALLER_COMPANY% +!define srcdir "$%INSTALLER_SOURCE_DIR%" +!define setup "$%INSTALLER_NAME%" +!define scriptsdir "$%INSTALLER_SCRIPTS_DIR%" +!define company "$%INSTALLER_COMPANY%" +!define install_directory "$%INSTALLER_DIRECTORY%" !define interface_exec "interface.exe" !define stack_manager_exec "stack-manager.exe" !define interface_icon "interface.ico" !define stack_manager_icon "stack-manager.ico" !define regkey "Software\${company}" !define uninstkey "Software\Microsoft\Windows\CurrentVersion\Uninstall\${company}" -!define install_dir_company "$PROGRAMFILES64\${company}" -!define startmenu_company "$SMPROGRAMS\${company}" +!define install_dir_company "$PROGRAMFILES64\${install_directory}" +!define startmenu_company "$SMPROGRAMS\${install_directory}" !define uninstaller "uninstall.exe" ;-------------------------------- From bd7fa266cffb2cf142b9da521b21d6bd99ee874a Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Mon, 14 Dec 2015 11:57:52 -0800 Subject: [PATCH 07/26] Bit of cleanup --- .../src/octree/OctreeQueryNode.cpp | 32 +------------- .../src/octree/OctreeQueryNode.h | 43 ++++++++++--------- .../src/octree/OctreeSendThread.cpp | 8 ++-- .../src/octree/OctreeSendThread.h | 16 +++---- assignment-client/src/octree/OctreeServer.cpp | 1 + 5 files changed, 37 insertions(+), 63 deletions(-) diff --git a/assignment-client/src/octree/OctreeQueryNode.cpp b/assignment-client/src/octree/OctreeQueryNode.cpp index ffe2e24ca0..58fd39f73f 100644 --- a/assignment-client/src/octree/OctreeQueryNode.cpp +++ b/assignment-client/src/octree/OctreeQueryNode.cpp @@ -20,39 +20,11 @@ #include "OctreeSendThread.h" -OctreeQueryNode::OctreeQueryNode() : - _viewSent(false), - _octreePacket(), - _octreePacketWaiting(false), - _lastOctreePayload(new char[udt::MAX_PACKET_SIZE]), - _lastOctreePacketLength(0), - _duplicatePacketCount(0), - _firstSuppressedPacket(usecTimestampNow()), - _maxSearchLevel(1), - _maxLevelReachedInLastSearch(1), - _lastTimeBagEmpty(0), - _viewFrustumChanging(false), - _viewFrustumJustStoppedChanging(true), - _octreeSendThread(NULL), - _lastClientBoundaryLevelAdjust(0), - _lastClientOctreeSizeScale(DEFAULT_OCTREE_SIZE_SCALE), - _lodChanged(false), - _lodInitialized(false), - _sequenceNumber(0), - _lastRootTimestamp(0), - _myPacketType(PacketType::Unknown), - _isShuttingDown(false), - _sentPacketHistory() -{ -} - OctreeQueryNode::~OctreeQueryNode() { _isShuttingDown = true; if (_octreeSendThread) { forceNodeShutdown(); } - - delete[] _lastOctreePayload; } void OctreeQueryNode::nodeKilled() { @@ -105,7 +77,7 @@ bool OctreeQueryNode::packetIsDuplicate() const { // of the entire packet, we need to compare only the packet content... if (_lastOctreePacketLength == _octreePacket->getPayloadSize()) { - if (memcmp(_lastOctreePayload + OCTREE_PACKET_EXTRA_HEADERS_SIZE, + if (memcmp(&_lastOctreePayload + OCTREE_PACKET_EXTRA_HEADERS_SIZE, _octreePacket->getPayload() + OCTREE_PACKET_EXTRA_HEADERS_SIZE, _octreePacket->getPayloadSize() - OCTREE_PACKET_EXTRA_HEADERS_SIZE) == 0) { return true; @@ -173,7 +145,7 @@ void OctreeQueryNode::resetOctreePacket() { // scene information, (e.g. the root node packet of a static scene), we can use this as a strategy for reducing // packet send rate. _lastOctreePacketLength = _octreePacket->getPayloadSize(); - memcpy(_lastOctreePayload, _octreePacket->getPayload(), _lastOctreePacketLength); + memcpy(&_lastOctreePayload, _octreePacket->getPayload(), _lastOctreePacketLength); // If we're moving, and the client asked for low res, then we force monochrome, otherwise, use // the clients requested color state. diff --git a/assignment-client/src/octree/OctreeQueryNode.h b/assignment-client/src/octree/OctreeQueryNode.h index 89583492e0..130e7031d1 100644 --- a/assignment-client/src/octree/OctreeQueryNode.h +++ b/assignment-client/src/octree/OctreeQueryNode.h @@ -29,7 +29,7 @@ class OctreeServer; class OctreeQueryNode : public OctreeQuery { Q_OBJECT public: - OctreeQueryNode(); + OctreeQueryNode() {} virtual ~OctreeQueryNode(); void init(); // called after creation to set up some virtual items @@ -110,43 +110,44 @@ private slots: private: OctreeQueryNode(const OctreeQueryNode &); OctreeQueryNode& operator= (const OctreeQueryNode&); - - bool _viewSent; + + bool _viewSent { false }; std::unique_ptr _octreePacket; bool _octreePacketWaiting; - char* _lastOctreePayload = nullptr; - unsigned int _lastOctreePacketLength; - int _duplicatePacketCount; - quint64 _firstSuppressedPacket; + unsigned int _lastOctreePacketLength { 0 }; + int _duplicatePacketCount { 0 }; + quint64 _firstSuppressedPacket { usecTimestampNow() }; - int _maxSearchLevel; - int _maxLevelReachedInLastSearch; + int _maxSearchLevel { 1 }; + int _maxLevelReachedInLastSearch { 1 }; ViewFrustum _currentViewFrustum; ViewFrustum _lastKnownViewFrustum; - quint64 _lastTimeBagEmpty; - bool _viewFrustumChanging; - bool _viewFrustumJustStoppedChanging; + quint64 _lastTimeBagEmpty { 0 }; + bool _viewFrustumChanging { false }; + bool _viewFrustumJustStoppedChanging { true }; - OctreeSendThread* _octreeSendThread; + OctreeSendThread* _octreeSendThread { nullptr }; // watch for LOD changes - int _lastClientBoundaryLevelAdjust; - float _lastClientOctreeSizeScale; - bool _lodChanged; - bool _lodInitialized; + int _lastClientBoundaryLevelAdjust { 0 }; + float _lastClientOctreeSizeScale { DEFAULT_OCTREE_SIZE_SCALE }; + bool _lodChanged { false }; + bool _lodInitialized { false }; - OCTREE_PACKET_SEQUENCE _sequenceNumber; + OCTREE_PACKET_SEQUENCE _sequenceNumber { 0 }; - quint64 _lastRootTimestamp; + quint64 _lastRootTimestamp { 0 }; - PacketType _myPacketType; - bool _isShuttingDown; + PacketType _myPacketType { PacketType::Unknown }; + bool _isShuttingDown { false }; SentPacketHistory _sentPacketHistory; QQueue _nackedSequenceNumbers; quint64 _sceneSendStartTime = 0; + + std::array _lastOctreePayload; }; #endif // hifi_OctreeQueryNode_h diff --git a/assignment-client/src/octree/OctreeSendThread.cpp b/assignment-client/src/octree/OctreeSendThread.cpp index b4eb75ede9..dbd6d117dc 100644 --- a/assignment-client/src/octree/OctreeSendThread.cpp +++ b/assignment-client/src/octree/OctreeSendThread.cpp @@ -14,6 +14,7 @@ #include #include +#include "OctreeQueryNode.h" #include "OctreeSendThread.h" #include "OctreeServer.h" #include "OctreeServerConsts.h" @@ -25,10 +26,7 @@ quint64 endSceneSleepTime = 0; OctreeSendThread::OctreeSendThread(OctreeServer* myServer, const SharedNodePointer& node) : _myServer(myServer), _node(node), - _nodeUUID(node->getUUID()), - _packetData(), - _nodeMissingCount(0), - _isShuttingDown(false) + _nodeUUID(node->getUUID()) { QString safeServerName("Octree"); @@ -46,6 +44,8 @@ OctreeSendThread::OctreeSendThread(OctreeServer* myServer, const SharedNodePoint } OctreeSendThread::~OctreeSendThread() { + setIsShuttingDown(); + QString safeServerName("Octree"); if (_myServer) { safeServerName = _myServer->getMyServerName(); diff --git a/assignment-client/src/octree/OctreeSendThread.h b/assignment-client/src/octree/OctreeSendThread.h index 6775e56820..64a9c59465 100644 --- a/assignment-client/src/octree/OctreeSendThread.h +++ b/assignment-client/src/octree/OctreeSendThread.h @@ -18,8 +18,7 @@ #include -#include "OctreeQueryNode.h" - +class OctreeQueryNode; class OctreeServer; using AtomicUIntStat = std::atomic; @@ -48,17 +47,18 @@ protected: virtual bool process(); private: - OctreeServer* _myServer; + int handlePacketSend(OctreeQueryNode* nodeData, int& trueBytesSent, int& truePacketsSent); + int packetDistributor(OctreeQueryNode* nodeData, bool viewFrustumChanged); + + + OctreeServer* _myServer { nullptr }; SharedNodePointer _node; QUuid _nodeUUID; - int handlePacketSend(OctreeQueryNode* nodeData, int& trueBytesSent, int& truePacketsSent); - int packetDistributor(OctreeQueryNode* nodeData, bool viewFrustumChanged); - OctreePacketData _packetData; - int _nodeMissingCount; - bool _isShuttingDown; + int _nodeMissingCount { 0 }; + bool _isShuttingDown { false }; }; #endif // hifi_OctreeSendThread_h diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index ec34ad4410..d32968596a 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -25,6 +25,7 @@ #include "../AssignmentClient.h" +#include "OctreeQueryNode.h" #include "OctreeServerConsts.h" OctreeServer* OctreeServer::_instance = NULL; From b65cdd286524e806283898bd54af32c6b5e5def7 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Mon, 14 Dec 2015 15:26:50 -0800 Subject: [PATCH 08/26] Add logging categories to assignment client. --- assignment-client/src/AssignmentClient.cpp | 37 ++++++++++--------- .../src/AssignmentClientLogging.cpp | 14 +++++++ .../src/AssignmentClientLogging.h | 19 ++++++++++ 3 files changed, 52 insertions(+), 18 deletions(-) create mode 100644 assignment-client/src/AssignmentClientLogging.cpp create mode 100644 assignment-client/src/AssignmentClientLogging.h diff --git a/assignment-client/src/AssignmentClient.cpp b/assignment-client/src/AssignmentClient.cpp index fc0cfe1abb..bbee597797 100644 --- a/assignment-client/src/AssignmentClient.cpp +++ b/assignment-client/src/AssignmentClient.cpp @@ -35,6 +35,7 @@ #include "AssignmentActionFactory.h" #include "AssignmentClient.h" +#include "AssignmentClientLogging.h" #include "avatars/ScriptableAvatar.h" const QString ASSIGNMENT_CLIENT_TARGET_NAME = "assignment-client"; @@ -84,7 +85,7 @@ AssignmentClient::AssignmentClient(Assignment::Type requestAssignmentType, QStri // check for a wallet UUID on the command line or in the config // this would represent where the user running AC wants funds sent to if (!walletUUID.isNull()) { - qDebug() << "The destination wallet UUID for credits is" << uuidStringWithoutCurlyBraces(walletUUID); + qCDebug(assigmnentclient) << "The destination wallet UUID for credits is" << uuidStringWithoutCurlyBraces(walletUUID); _requestAssignment.setWalletUUID(walletUUID); } @@ -98,13 +99,13 @@ AssignmentClient::AssignmentClient(Assignment::Type requestAssignmentType, QStri _assignmentServerSocket.setObjectName("AssigmentServer"); nodeList->setAssignmentServerSocket(_assignmentServerSocket); - qDebug() << "Assignment server socket is" << _assignmentServerSocket; + qCDebug(assigmnentclient) << "Assignment server socket is" << _assignmentServerSocket; // call a timer function every ASSIGNMENT_REQUEST_INTERVAL_MSECS to ask for assignment, if required - qDebug() << "Waiting for assignment -" << _requestAssignment; + qCDebug(assigmnentclient) << "Waiting for assignment -" << _requestAssignment; if (_assignmentServerHostname != "localhost") { - qDebug () << "- will attempt to connect to domain-server on" << _assignmentServerSocket.getPort(); + qCDebug(assigmnentclient) << "- will attempt to connect to domain-server on" << _assignmentServerSocket.getPort(); } connect(&_requestTimer, SIGNAL(timeout()), SLOT(sendAssignmentRequest())); @@ -122,7 +123,7 @@ AssignmentClient::AssignmentClient(Assignment::Type requestAssignmentType, QStri _assignmentClientMonitorSocket = HifiSockAddr(DEFAULT_ASSIGNMENT_CLIENT_MONITOR_HOSTNAME, assignmentMonitorPort); _assignmentClientMonitorSocket.setObjectName("AssignmentClientMonitor"); - qDebug() << "Assignment-client monitor socket is" << _assignmentClientMonitorSocket; + qCDebug(assigmnentclient) << "Assignment-client monitor socket is" << _assignmentClientMonitorSocket; // Hook up a timer to send this child's status to the Monitor once per second setUpStatusToMonitor(); @@ -133,7 +134,7 @@ AssignmentClient::AssignmentClient(Assignment::Type requestAssignmentType, QStri } void AssignmentClient::stopAssignmentClient() { - qDebug() << "Forced stop of assignment-client."; + qCDebug(assigmnentclient) << "Forced stop of assignment-client."; _requestTimer.stop(); _statsTimerACM.stop(); @@ -209,14 +210,14 @@ void AssignmentClient::sendAssignmentRequest() { quint16 localAssignmentServerPort; if (nodeList->getLocalServerPortFromSharedMemory(DOMAIN_SERVER_LOCAL_PORT_SMEM_KEY, localAssignmentServerPort)) { if (localAssignmentServerPort != _assignmentServerSocket.getPort()) { - qDebug() << "Port for local assignment server read from shared memory is" + qCDebug(assigmnentclient) << "Port for local assignment server read from shared memory is" << localAssignmentServerPort; _assignmentServerSocket.setPort(localAssignmentServerPort); nodeList->setAssignmentServerSocket(_assignmentServerSocket); } } else { - qDebug() << "Failed to read local assignment server port from shared memory" + qCWarning(assigmnentclient) << "Failed to read local assignment server port from shared memory" << "- will send assignment request to previous assignment server socket."; } } @@ -226,13 +227,13 @@ void AssignmentClient::sendAssignmentRequest() { } void AssignmentClient::handleCreateAssignmentPacket(QSharedPointer message) { - qDebug() << "Received a PacketType::CreateAssignment - attempting to unpack."; + qCDebug(assigmnentclient) << "Received a PacketType::CreateAssignment - attempting to unpack."; // construct the deployed assignment from the packet data _currentAssignment = AssignmentFactory::unpackAssignment(*message); if (_currentAssignment && !_isAssigned) { - qDebug() << "Received an assignment -" << *_currentAssignment; + qDebug(assigmnentclient) << "Received an assignment -" << *_currentAssignment; _isAssigned = true; auto nodeList = DependencyManager::get(); @@ -242,7 +243,7 @@ void AssignmentClient::handleCreateAssignmentPacket(QSharedPointergetDomainHandler().setSockAddr(message->getSenderSockAddr(), _assignmentServerHostname); nodeList->getDomainHandler().setAssignmentUUID(_currentAssignment->getUUID()); - qDebug() << "Destination IP for assignment is" << nodeList->getDomainHandler().getIP().toString(); + qCDebug(assigmnentclient) << "Destination IP for assignment is" << nodeList->getDomainHandler().getIP().toString(); // start the deployed assignment QThread* workerThread = new QThread; @@ -270,7 +271,7 @@ void AssignmentClient::handleCreateAssignmentPacket(QSharedPointerstarted() workerThread->start(); } else { - qDebug() << "Received an assignment that could not be unpacked. Re-requesting."; + qCWarning(assigmnentclient) << "Received an assignment that could not be unpacked. Re-requesting."; } } @@ -278,12 +279,12 @@ void AssignmentClient::handleStopNodePacket(QSharedPointer mess const HifiSockAddr& senderSockAddr = message->getSenderSockAddr(); if (senderSockAddr.getAddress() == QHostAddress::LocalHost || - senderSockAddr.getAddress() == QHostAddress::LocalHostIPv6) { - qDebug() << "AssignmentClientMonitor at" << senderSockAddr << "requested stop via PacketType::StopNode."; - + senderSockAddr.getAddress() == QHostAddress::LocalHostIPv6) { + + qCDebug(assigmnentclient) << "AssignmentClientMonitor at" << senderSockAddr << "requested stop via PacketType::StopNode."; QCoreApplication::quit(); } else { - qDebug() << "Got a stop packet from other than localhost."; + qCWarning(assigmnentclient) << "Got a stop packet from other than localhost."; } } @@ -303,7 +304,7 @@ void AssignmentClient::handleAuthenticationRequest() { // ask the account manager to log us in from the env variables accountManager.requestAccessToken(username, password); } else { - qDebug() << "Authentication was requested against" << qPrintable(accountManager.getAuthURL().toString()) + qCWarning(assigmnentclient) << "Authentication was requested against" << qPrintable(accountManager.getAuthURL().toString()) << "but both or one of" << qPrintable(DATA_SERVER_USERNAME_ENV) << "/" << qPrintable(DATA_SERVER_PASSWORD_ENV) << "are not set. Unable to authenticate."; @@ -321,7 +322,7 @@ void AssignmentClient::assignmentCompleted() { // reset the logging target to the the CHILD_TARGET_NAME LogHandler::getInstance().setTargetName(ASSIGNMENT_CLIENT_TARGET_NAME); - qDebug() << "Assignment finished or never started - waiting for new assignment."; + qCDebug(assigmnentclient) << "Assignment finished or never started - waiting for new assignment."; auto nodeList = DependencyManager::get(); diff --git a/assignment-client/src/AssignmentClientLogging.cpp b/assignment-client/src/AssignmentClientLogging.cpp new file mode 100644 index 0000000000..3e9dbdc53c --- /dev/null +++ b/assignment-client/src/AssignmentClientLogging.cpp @@ -0,0 +1,14 @@ +// +// AssignmentClientLogging.cpp +// assignment-client/src +// +// Created by Clement on 12/14/15. +// Copyright 2015 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#include "AssignmentClientLogging.h" + +Q_LOGGING_CATEGORY(assigmnentclient, "hifi.assignmentclient") \ No newline at end of file diff --git a/assignment-client/src/AssignmentClientLogging.h b/assignment-client/src/AssignmentClientLogging.h new file mode 100644 index 0000000000..d6b5ee90e0 --- /dev/null +++ b/assignment-client/src/AssignmentClientLogging.h @@ -0,0 +1,19 @@ +// +// AssignmentClientLogging.h +// assignment-client/src +// +// Created by Clement on 12/14/15. +// Copyright 2015 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#ifndef hifi_AssignmentClientLogging_h +#define hifi_AssignmentClientLogging_h + +#include + +Q_DECLARE_LOGGING_CATEGORY(assigmnentclient) + +#endif // hifi_AssignmentClientLogging_h \ No newline at end of file From 09701fdcf1cebe6d17249c4653bf4ad27499737d Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Thu, 10 Dec 2015 14:14:20 -0800 Subject: [PATCH 09/26] deadlock 101 --- assignment-client/src/octree/OctreeServer.cpp | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index d32968596a..9f0e7919e4 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -1460,15 +1460,22 @@ void OctreeServer::didCallWriteDatagram(OctreeSendThread* thread) { void OctreeServer::stopTrackingThread(OctreeSendThread* thread) { - QMutexLocker lockerA(&_threadsDidProcessMutex); - QMutexLocker lockerB(&_threadsDidPacketDistributorMutex); - QMutexLocker lockerC(&_threadsDidHandlePacketSendMutex); - QMutexLocker lockerD(&_threadsDidCallWriteDatagramMutex); - - _threadsDidProcess.remove(thread); - _threadsDidPacketDistributor.remove(thread); - _threadsDidHandlePacketSend.remove(thread); - _threadsDidCallWriteDatagram.remove(thread); + { + QMutexLocker locker(&_threadsDidProcessMutex); + _threadsDidProcess.remove(thread); + } + { + QMutexLocker locker(&_threadsDidPacketDistributorMutex); + _threadsDidPacketDistributor.remove(thread); + } + { + QMutexLocker locker(&_threadsDidHandlePacketSendMutex); + _threadsDidHandlePacketSend.remove(thread); + } + { + QMutexLocker locker(&_threadsDidCallWriteDatagramMutex); + _threadsDidCallWriteDatagram.remove(thread); + } } int howManyThreadsDidSomething(QMutex& mutex, QMap& something, quint64 since) { From 346c28f9e21e231a89e6af8c7f65df4044c8f61e Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Tue, 15 Dec 2015 15:02:04 -0800 Subject: [PATCH 10/26] Remove OctreeServer's static instance --- assignment-client/src/octree/OctreeServer.cpp | 15 ++------------- assignment-client/src/octree/OctreeServer.h | 2 -- libraries/networking/src/LimitedNodeList.h | 2 +- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index 9f0e7919e4..4f572760b1 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -28,7 +28,6 @@ #include "OctreeQueryNode.h" #include "OctreeServerConsts.h" -OctreeServer* OctreeServer::_instance = NULL; int OctreeServer::_clientCount = 0; const int MOVING_AVERAGE_SAMPLE_COUNTS = 1000000; @@ -232,13 +231,6 @@ OctreeServer::OctreeServer(ReceivedMessage& message) : _started(time(0)), _startedUSecs(usecTimestampNow()) { - if (_instance) { - qDebug() << "Octree Server starting... while old instance still running _instance=["<<_instance<<"] this=[" << this << "]"; - } - - qDebug() << "Octree Server starting... setting _instance to=[" << this << "]"; - _instance = this; - _averageLoopTime.updateAverage(0); qDebug() << "Octree server starting... [" << this << "]"; @@ -282,9 +274,6 @@ OctreeServer::~OctreeServer() { _tree.reset(); qDebug() << qPrintable(_safeServerName) << "server DONE cleaning up octree... [" << this << "]"; - if (_instance == this) { - _instance = NULL; // we are gone - } qDebug() << qPrintable(_safeServerName) << "server DONE shutting down... [" << this << "]"; } @@ -1118,8 +1107,8 @@ void OctreeServer::domainSettingsRequestComplete() { setvbuf(stdout, NULL, _IOLBF, 0); #endif - nodeList->linkedDataCreateCallback = [] (Node* node) { - auto queryNodeData = _instance->createOctreeQueryNode(); + nodeList->linkedDataCreateCallback = [this](Node* node) { + auto queryNodeData = createOctreeQueryNode(); queryNodeData->init(); node->setLinkedData(std::move(queryNodeData)); }; diff --git a/assignment-client/src/octree/OctreeServer.h b/assignment-client/src/octree/OctreeServer.h index 80668f841c..51fe6d46c3 100644 --- a/assignment-client/src/octree/OctreeServer.h +++ b/assignment-client/src/octree/OctreeServer.h @@ -187,8 +187,6 @@ protected: int _backupInterval; int _maxBackupVersions; - static OctreeServer* _instance; - time_t _started; quint64 _startedUSecs; QString _safeServerName; diff --git a/libraries/networking/src/LimitedNodeList.h b/libraries/networking/src/LimitedNodeList.h index c89949b9fd..87ed12ac66 100644 --- a/libraries/networking/src/LimitedNodeList.h +++ b/libraries/networking/src/LimitedNodeList.h @@ -129,7 +129,7 @@ public: qint64 sendPacketList(std::unique_ptr packetList, const HifiSockAddr& sockAddr); qint64 sendPacketList(std::unique_ptr packetList, const Node& destinationNode); - void (*linkedDataCreateCallback)(Node *); + std::function linkedDataCreateCallback; size_t size() const { return _nodeHash.size(); } From 562d9ac2de4507f1250096992b0611e9280b497a Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Tue, 15 Dec 2015 16:30:31 -0800 Subject: [PATCH 11/26] Forward QThread's finished signal in GenericThread --- libraries/shared/src/GenericThread.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/shared/src/GenericThread.cpp b/libraries/shared/src/GenericThread.cpp index 66af2e01c8..4fdd2eb1d2 100644 --- a/libraries/shared/src/GenericThread.cpp +++ b/libraries/shared/src/GenericThread.cpp @@ -38,9 +38,10 @@ void GenericThread::initialize(bool isThreaded, QThread::Priority priority) { _thread->setObjectName(objectName()); // when the worker thread is started, call our engine's run.. - connect(_thread, SIGNAL(started()), this, SLOT(threadRoutine())); + connect(_thread, &QThread::started, this, &GenericThread::threadRoutine); + connect(_thread, &QThread::finished, this, &GenericThread::finished); - this->moveToThread(_thread); + moveToThread(_thread); // Starts an event loop, and emits _thread->started() _thread->start(); @@ -82,5 +83,4 @@ void GenericThread::threadRoutine() { if (_isThreaded && _thread) { _thread->quit(); } - emit finished(); } From 95da71b19c9812b6ff020cbc741b11c39bcfd279 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Tue, 15 Dec 2015 16:33:40 -0800 Subject: [PATCH 12/26] Assignment don't inherit from NodeData This is an artefact from an old design that stuck around --- libraries/networking/src/Assignment.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/networking/src/Assignment.h b/libraries/networking/src/Assignment.h index 399deaa314..97caedcfb3 100644 --- a/libraries/networking/src/Assignment.h +++ b/libraries/networking/src/Assignment.h @@ -23,7 +23,7 @@ const int MAX_PAYLOAD_BYTES = 1024; const QString emptyPool = QString(); /// Holds information used for request, creation, and deployment of assignments -class Assignment : public NodeData { +class Assignment : public QObject { Q_OBJECT public: From 3cd1eea1dc67f1b22c5f4cee610a473765909bfe Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Tue, 15 Dec 2015 16:35:22 -0800 Subject: [PATCH 13/26] Use weak pointer to the Node instead of strong ownership --- .../src/octree/OctreeSendThread.cpp | 44 +++++++++---------- .../src/octree/OctreeSendThread.h | 7 ++- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/assignment-client/src/octree/OctreeSendThread.cpp b/assignment-client/src/octree/OctreeSendThread.cpp index dbd6d117dc..6215712c6c 100644 --- a/assignment-client/src/octree/OctreeSendThread.cpp +++ b/assignment-client/src/octree/OctreeSendThread.cpp @@ -25,8 +25,7 @@ quint64 endSceneSleepTime = 0; OctreeSendThread::OctreeSendThread(OctreeServer* myServer, const SharedNodePointer& node) : _myServer(myServer), - _node(node), - _nodeUUID(node->getUUID()) + _node(node) { QString safeServerName("Octree"); @@ -56,8 +55,6 @@ OctreeSendThread::~OctreeSendThread() { OctreeServer::clientDisconnected(); OctreeServer::stopTrackingThread(this); - - _node.clear(); } void OctreeSendThread::setIsShuttingDown() { @@ -79,15 +76,17 @@ bool OctreeSendThread::process() { // don't do any send processing until the initial load of the octree is complete... if (_myServer->isInitialLoadComplete()) { - if (_node) { + if (auto node = _node.lock()) { _nodeMissingCount = 0; - OctreeQueryNode* nodeData = static_cast(_node->getLinkedData()); + OctreeQueryNode* nodeData = static_cast(node->getLinkedData()); // Sometimes the node data has not yet been linked, in which case we can't really do anything if (nodeData && !nodeData->isShuttingDown()) { bool viewFrustumChanged = nodeData->updateCurrentViewFrustum(); - packetDistributor(nodeData, viewFrustumChanged); + packetDistributor(node, nodeData, viewFrustumChanged); } + } else { + return false; // exit early if we're shutting down } } @@ -123,7 +122,8 @@ AtomicUIntStat OctreeSendThread::_totalSpecialBytes { 0 }; AtomicUIntStat OctreeSendThread::_totalSpecialPackets { 0 }; -int OctreeSendThread::handlePacketSend(OctreeQueryNode* nodeData, int& trueBytesSent, int& truePacketsSent) { +int OctreeSendThread::handlePacketSend(SharedNodePointer node, OctreeQueryNode* nodeData, int& trueBytesSent, + int& truePacketsSent) { OctreeServer::didHandlePacketSend(this); // if we're shutting down, then exit early @@ -183,12 +183,12 @@ int OctreeSendThread::handlePacketSend(OctreeQueryNode* nodeData, int& trueBytes // actually send it OctreeServer::didCallWriteDatagram(this); - DependencyManager::get()->sendUnreliablePacket(statsPacket, *_node); + DependencyManager::get()->sendUnreliablePacket(statsPacket, *node); packetSent = true; } else { // not enough room in the packet, send two packets OctreeServer::didCallWriteDatagram(this); - DependencyManager::get()->sendUnreliablePacket(statsPacket, *_node); + DependencyManager::get()->sendUnreliablePacket(statsPacket, *node); // since a stats message is only included on end of scene, don't consider any of these bytes "wasted", since // there was nothing else to send. @@ -219,7 +219,7 @@ int OctreeSendThread::handlePacketSend(OctreeQueryNode* nodeData, int& trueBytes packetsSent++; OctreeServer::didCallWriteDatagram(this); - DependencyManager::get()->sendUnreliablePacket(nodeData->getPacket(), *_node); + DependencyManager::get()->sendUnreliablePacket(nodeData->getPacket(), *node); packetSent = true; int packetSizeWithHeader = nodeData->getPacket().getDataSize(); @@ -251,7 +251,7 @@ int OctreeSendThread::handlePacketSend(OctreeQueryNode* nodeData, int& trueBytes if (nodeData->isPacketWaiting() && !nodeData->isShuttingDown()) { // just send the octree packet OctreeServer::didCallWriteDatagram(this); - DependencyManager::get()->sendUnreliablePacket(nodeData->getPacket(), *_node); + DependencyManager::get()->sendUnreliablePacket(nodeData->getPacket(), *node); packetSent = true; int packetSizeWithHeader = nodeData->getPacket().getDataSize(); @@ -293,7 +293,7 @@ int OctreeSendThread::handlePacketSend(OctreeQueryNode* nodeData, int& trueBytes } /// Version of octree element distributor that sends the deepest LOD level at once -int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrustumChanged) { +int OctreeSendThread::packetDistributor(SharedNodePointer node, OctreeQueryNode* nodeData, bool viewFrustumChanged) { OctreeServer::didPacketDistributor(this); @@ -322,7 +322,7 @@ int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrus // If we have a packet waiting, and our desired want color, doesn't match the current waiting packets color // then let's just send that waiting packet. if (nodeData->isPacketWaiting()) { - packetsSentThisInterval += handlePacketSend(nodeData, trueBytesSent, truePacketsSent); + packetsSentThisInterval += handlePacketSend(node, nodeData, trueBytesSent, truePacketsSent); } else { nodeData->resetOctreePacket(); } @@ -355,7 +355,7 @@ int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrus //unsigned long encodeTime = nodeData->stats.getTotalEncodeTime(); //unsigned long elapsedTime = nodeData->stats.getElapsedTime(); - int packetsJustSent = handlePacketSend(nodeData, trueBytesSent, truePacketsSent); + int packetsJustSent = handlePacketSend(node, nodeData, trueBytesSent, truePacketsSent); packetsSentThisInterval += packetsJustSent; // If we're starting a full scene, then definitely we want to empty the elementBag @@ -431,8 +431,8 @@ int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrus // Our trackSend() function is implemented by the server subclass, and will be called back // during the encodeTreeBitstream() as new entities/data elements are sent - params.trackSend = [this](const QUuid& dataID, quint64 dataEdited) { - _myServer->trackSend(dataID, dataEdited, _nodeUUID); + params.trackSend = [this, node](const QUuid& dataID, quint64 dataEdited) { + _myServer->trackSend(dataID, dataEdited, node->getUUID()); }; // TODO: should this include the lock time or not? This stat is sent down to the client, @@ -481,7 +481,7 @@ int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrus unsigned int writtenSize = _packetData.getFinalizedSize() + sizeof(OCTREE_PACKET_INTERNAL_SECTION_SIZE); if (writtenSize > nodeData->getAvailable()) { - packetsSentThisInterval += handlePacketSend(nodeData, trueBytesSent, truePacketsSent); + packetsSentThisInterval += handlePacketSend(node, nodeData, trueBytesSent, truePacketsSent); } nodeData->writeToPacket(_packetData.getFinalizedData(), _packetData.getFinalizedSize()); @@ -501,7 +501,7 @@ int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrus int targetSize = MAX_OCTREE_PACKET_DATA_SIZE; if (sendNow) { quint64 packetSendingStart = usecTimestampNow(); - packetsSentThisInterval += handlePacketSend(nodeData, trueBytesSent, truePacketsSent); + packetsSentThisInterval += handlePacketSend(node, nodeData, trueBytesSent, truePacketsSent); quint64 packetSendingEnd = usecTimestampNow(); packetSendingElapsedUsec = (float)(packetSendingEnd - packetSendingStart); @@ -538,9 +538,9 @@ int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrus // Here's where we can/should allow the server to send other data... // send the environment packet // TODO: should we turn this into a while loop to better handle sending multiple special packets - if (_myServer->hasSpecialPacketsToSend(_node) && !nodeData->isShuttingDown()) { + if (_myServer->hasSpecialPacketsToSend(node) && !nodeData->isShuttingDown()) { int specialPacketsSent = 0; - trueBytesSent += _myServer->sendSpecialPackets(_node, nodeData, specialPacketsSent); + trueBytesSent += _myServer->sendSpecialPackets(node, nodeData, specialPacketsSent); nodeData->resetOctreePacket(); // because nodeData's _sequenceNumber has changed truePacketsSent += specialPacketsSent; packetsSentThisInterval += specialPacketsSent; @@ -556,7 +556,7 @@ int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrus while (nodeData->hasNextNackedPacket() && packetsSentThisInterval < maxPacketsPerInterval) { const NLPacket* packet = nodeData->getNextNackedPacket(); if (packet) { - DependencyManager::get()->sendUnreliablePacket(*packet, *_node); + DependencyManager::get()->sendUnreliablePacket(*packet, *node); truePacketsSent++; packetsSentThisInterval++; diff --git a/assignment-client/src/octree/OctreeSendThread.h b/assignment-client/src/octree/OctreeSendThread.h index 64a9c59465..e3c47343b0 100644 --- a/assignment-client/src/octree/OctreeSendThread.h +++ b/assignment-client/src/octree/OctreeSendThread.h @@ -47,13 +47,12 @@ protected: virtual bool process(); private: - int handlePacketSend(OctreeQueryNode* nodeData, int& trueBytesSent, int& truePacketsSent); - int packetDistributor(OctreeQueryNode* nodeData, bool viewFrustumChanged); + int handlePacketSend(SharedNodePointer node, OctreeQueryNode* nodeData, int& trueBytesSent, int& truePacketsSent); + int packetDistributor(SharedNodePointer node, OctreeQueryNode* nodeData, bool viewFrustumChanged); OctreeServer* _myServer { nullptr }; - SharedNodePointer _node; - QUuid _nodeUUID; + QWeakPointer _node; OctreePacketData _packetData; From 51ec7ae2edbce416fd4c0bf477deec94eff46c28 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Tue, 15 Dec 2015 16:51:28 -0800 Subject: [PATCH 14/26] Keep UUID of node in send thread --- assignment-client/src/octree/OctreeSendThread.cpp | 5 +++-- assignment-client/src/octree/OctreeSendThread.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/assignment-client/src/octree/OctreeSendThread.cpp b/assignment-client/src/octree/OctreeSendThread.cpp index 6215712c6c..2ff06c7439 100644 --- a/assignment-client/src/octree/OctreeSendThread.cpp +++ b/assignment-client/src/octree/OctreeSendThread.cpp @@ -25,12 +25,13 @@ quint64 endSceneSleepTime = 0; OctreeSendThread::OctreeSendThread(OctreeServer* myServer, const SharedNodePointer& node) : _myServer(myServer), - _node(node) + _node(node), + _nodeUuid(node->getUUID()) { QString safeServerName("Octree"); // set our QThread object name so we can identify this thread while debugging - setObjectName(QString("Octree Send Thread (%1)").arg(uuidStringWithoutCurlyBraces(node->getUUID()))); + setObjectName(QString("Octree Send Thread (%1)").arg(uuidStringWithoutCurlyBraces(_nodeUuid))); if (_myServer) { safeServerName = _myServer->getMyServerName(); diff --git a/assignment-client/src/octree/OctreeSendThread.h b/assignment-client/src/octree/OctreeSendThread.h index e3c47343b0..c77a327e70 100644 --- a/assignment-client/src/octree/OctreeSendThread.h +++ b/assignment-client/src/octree/OctreeSendThread.h @@ -31,6 +31,7 @@ public: virtual ~OctreeSendThread(); void setIsShuttingDown(); + QUuid getNodeUuid() const { return _nodeUuid; } static AtomicUIntStat _totalBytes; static AtomicUIntStat _totalWastedBytes; @@ -53,6 +54,7 @@ private: OctreeServer* _myServer { nullptr }; QWeakPointer _node; + QUuid _nodeUuid; OctreePacketData _packetData; From a541fdd2df445d864dfa7b4435dee65b0317694c Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 16 Dec 2015 10:04:20 -0800 Subject: [PATCH 15/26] Move OctreeSendThread to the OctreeServer --- .../src/octree/OctreeQueryNode.cpp | 44 ------------ .../src/octree/OctreeQueryNode.h | 11 +-- .../src/octree/OctreeSendThread.h | 2 + assignment-client/src/octree/OctreeServer.cpp | 72 +++++++++---------- assignment-client/src/octree/OctreeServer.h | 5 +- libraries/shared/src/GenericThread.cpp | 1 - 6 files changed, 40 insertions(+), 95 deletions(-) diff --git a/assignment-client/src/octree/OctreeQueryNode.cpp b/assignment-client/src/octree/OctreeQueryNode.cpp index 58fd39f73f..044b44a165 100644 --- a/assignment-client/src/octree/OctreeQueryNode.cpp +++ b/assignment-client/src/octree/OctreeQueryNode.cpp @@ -20,52 +20,8 @@ #include "OctreeSendThread.h" -OctreeQueryNode::~OctreeQueryNode() { - _isShuttingDown = true; - if (_octreeSendThread) { - forceNodeShutdown(); - } -} - void OctreeQueryNode::nodeKilled() { _isShuttingDown = true; - if (_octreeSendThread) { - // just tell our thread we want to shutdown, this is asynchronous, and fast, we don't need or want it to block - // while the thread actually shuts down - _octreeSendThread->setIsShuttingDown(); - } -} - -void OctreeQueryNode::forceNodeShutdown() { - _isShuttingDown = true; - if (_octreeSendThread) { - // we really need to force our thread to shutdown, this is synchronous, we will block while the thread actually - // shuts down because we really need it to shutdown, and it's ok if we wait for it to complete - OctreeSendThread* sendThread = _octreeSendThread; - _octreeSendThread = NULL; - sendThread->setIsShuttingDown(); - sendThread->terminate(); - delete sendThread; - } -} - -void OctreeQueryNode::sendThreadFinished() { - // We've been notified by our thread that it is shutting down. So we can clean up our reference to it, and - // delete the actual thread object. Cleaning up our thread will correctly unroll all refereces to shared - // pointers to our node as well as the octree server assignment - if (_octreeSendThread) { - OctreeSendThread* sendThread = _octreeSendThread; - _octreeSendThread = NULL; - delete sendThread; - } -} - -void OctreeQueryNode::initializeOctreeSendThread(OctreeServer* myServer, const SharedNodePointer& node) { - _octreeSendThread = new OctreeSendThread(myServer, node); - - // we want to be notified when the thread finishes - connect(_octreeSendThread, &GenericThread::finished, this, &OctreeQueryNode::sendThreadFinished); - _octreeSendThread->initialize(true); } bool OctreeQueryNode::packetIsDuplicate() const { diff --git a/assignment-client/src/octree/OctreeQueryNode.h b/assignment-client/src/octree/OctreeQueryNode.h index 130e7031d1..4313d101fd 100644 --- a/assignment-client/src/octree/OctreeQueryNode.h +++ b/assignment-client/src/octree/OctreeQueryNode.h @@ -29,8 +29,8 @@ class OctreeServer; class OctreeQueryNode : public OctreeQuery { Q_OBJECT public: - OctreeQueryNode() {} - virtual ~OctreeQueryNode(); + OctreeQueryNode() = default; + virtual ~OctreeQueryNode() = default; void init(); // called after creation to set up some virtual items virtual PacketType getMyPacketType() const = 0; @@ -79,9 +79,6 @@ public: OctreeSceneStats stats; - void initializeOctreeSendThread(OctreeServer* myServer, const SharedNodePointer& node); - bool isOctreeSendThreadInitalized() { return _octreeSendThread; } - void dumpOutOfView(); quint64 getLastRootTimestamp() const { return _lastRootTimestamp; } @@ -92,7 +89,6 @@ public: void sceneStart(quint64 sceneSendStartTime) { _sceneSendStartTime = sceneSendStartTime; } void nodeKilled(); - void forceNodeShutdown(); bool isShuttingDown() const { return _isShuttingDown; } void octreePacketSent() { packetSent(*_octreePacket); } @@ -104,9 +100,6 @@ public: bool hasNextNackedPacket() const; const NLPacket* getNextNackedPacket(); -private slots: - void sendThreadFinished(); - private: OctreeQueryNode(const OctreeQueryNode &); OctreeQueryNode& operator= (const OctreeQueryNode&); diff --git a/assignment-client/src/octree/OctreeSendThread.h b/assignment-client/src/octree/OctreeSendThread.h index c77a327e70..38f5de722f 100644 --- a/assignment-client/src/octree/OctreeSendThread.h +++ b/assignment-client/src/octree/OctreeSendThread.h @@ -31,6 +31,8 @@ public: virtual ~OctreeSendThread(); void setIsShuttingDown(); + bool isShuttingDown() { return _isShuttingDown; } + QUuid getNodeUuid() const { return _nodeUuid; } static AtomicUIntStat _totalBytes; diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index 4f572760b1..f42431589e 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -868,16 +868,28 @@ void OctreeServer::parsePayload() { } } +void OctreeServer::removeSendThread() { + auto sendThread = static_cast(sender()); + + // This deletes the unique_ptr, so sendThread is destructed after that line + _sendThreads.erase(sendThread->getNodeUuid()); +} + void OctreeServer::handleOctreeQueryPacket(QSharedPointer message, SharedNodePointer senderNode) { - if (!_isFinished) { + if (!_isFinished && !_isShuttingDown) { // If we got a query packet, then we're talking to an agent, and we // need to make sure we have it in our nodeList. auto nodeList = DependencyManager::get(); nodeList->updateNodeWithDataFromPacket(message, senderNode); - OctreeQueryNode* nodeData = dynamic_cast(senderNode->getLinkedData()); - if (nodeData && !nodeData->isOctreeSendThreadInitalized()) { - nodeData->initializeOctreeSendThread(this, senderNode); + auto it = _sendThreads.find(senderNode->getUUID()); + if (it == _sendThreads.end() || it->second->isShuttingDown()) { + auto sendThread = std::unique_ptr(new OctreeSendThread(this, senderNode)); + + // we want to be notified when the thread finishes + connect(sendThread.get(), &GenericThread::finished, this, &OctreeServer::removeSendThread); + sendThread->initialize(true); + _sendThreads.emplace(senderNode->getUUID(), std::move(sendThread)); } } } @@ -1157,6 +1169,12 @@ void OctreeServer::nodeAdded(SharedNodePointer node) { void OctreeServer::nodeKilled(SharedNodePointer node) { quint64 start = usecTimestampNow(); + + // Shutdown send thread + auto it = _sendThreads.find(node->getUUID()); + if (it != _sendThreads.end()) { + it->second->setIsShuttingDown(); + } // calling this here since nodeKilled slot in ReceivedPacketProcessor can't be triggered by signals yet!! _octreeInboundPacketProcessor->nodeKilled(node); @@ -1178,24 +1196,6 @@ void OctreeServer::nodeKilled(SharedNodePointer node) { trackViewerGone(node->getUUID()); } -void OctreeServer::forceNodeShutdown(SharedNodePointer node) { - quint64 start = usecTimestampNow(); - - qDebug() << qPrintable(_safeServerName) << "server killed node:" << *node; - OctreeQueryNode* nodeData = dynamic_cast(node->getLinkedData()); - if (nodeData) { - nodeData->forceNodeShutdown(); // tell our node data and sending threads that we'd like to shut down - } else { - qDebug() << qPrintable(_safeServerName) << "server node missing linked data node:" << *node; - } - - quint64 end = usecTimestampNow(); - quint64 usecsElapsed = (end - start); - qDebug() << qPrintable(_safeServerName) << "server forceNodeShutdown() took: " - << usecsElapsed << " usecs for node:" << *node; -} - - void OctreeServer::aboutToFinish() { qDebug() << qPrintable(_safeServerName) << "server STARTING about to finish..."; @@ -1204,9 +1204,8 @@ void OctreeServer::aboutToFinish() { qDebug() << qPrintable(_safeServerName) << "inform Octree Inbound Packet Processor that we are shutting down..."; // we're going down - set the NodeList linkedDataCallback to NULL so we do not create any more OctreeQueryNode objects. - // This ensures that when we forceNodeShutdown below for each node we don't get any more newly connecting nodes - auto nodeList = DependencyManager::get(); - nodeList->linkedDataCreateCallback = NULL; + // This ensures that we don't get any more newly connecting nodes + DependencyManager::get()->linkedDataCreateCallback = NULL; if (_octreeInboundPacketProcessor) { _octreeInboundPacketProcessor->terminating(); @@ -1216,27 +1215,20 @@ void OctreeServer::aboutToFinish() { _jurisdictionSender->terminating(); } - QSet nodesToShutdown; - - // Force a shutdown of all of our OctreeSendThreads. - // At this point it has to be impossible for a linkedDataCreateCallback to be called for a new node - nodeList->eachNode([&nodesToShutdown](const SharedNodePointer& node) { - nodesToShutdown << node; - }); - - // What follows is a hack to force OctreeSendThreads to cleanup before the OctreeServer is gone. - // I would prefer to allow the SharedNodePointer ref count drop to zero to do this automatically - // but that isn't possible as long as the OctreeSendThread has an OctreeServer* that it uses. - for (auto& node : nodesToShutdown) { - qDebug() << qPrintable(_safeServerName) << "server about to finish while node still connected node:" << *node; - forceNodeShutdown(node); + // Shut down all the send threads + for (auto it = _sendThreads.begin(); it != _sendThreads.end(); ++it) { + it->second->disconnect(this); // Disconnect so that removeSendThread doesn't get called later + it->second->setIsShuttingDown(); } + + // Wait on all send threads to be done before continuing + _sendThreads.clear(); if (_persistThread) { _persistThread->aboutToFinish(); _persistThread->terminating(); } - + qDebug() << qPrintable(_safeServerName) << "server ENDING about to finish..."; } diff --git a/assignment-client/src/octree/OctreeServer.h b/assignment-client/src/octree/OctreeServer.h index 51fe6d46c3..98f6c79893 100644 --- a/assignment-client/src/octree/OctreeServer.h +++ b/assignment-client/src/octree/OctreeServer.h @@ -124,7 +124,6 @@ public: bool handleHTTPRequest(HTTPConnection* connection, const QUrl& url, bool skipSubHandler); virtual void aboutToFinish(); - void forceNodeShutdown(SharedNodePointer node); public slots: /// runs the octree server assignment @@ -138,6 +137,7 @@ private slots: void handleOctreeQueryPacket(QSharedPointer message, SharedNodePointer senderNode); void handleOctreeDataNackPacket(QSharedPointer message, SharedNodePointer senderNode); void handleJurisdictionRequestPacket(QSharedPointer message, SharedNodePointer senderNode); + void removeSendThread(); protected: virtual OctreePointer createTree() = 0; @@ -190,6 +190,9 @@ protected: time_t _started; quint64 _startedUSecs; QString _safeServerName; + + using SendThreads = std::unordered_map>; + SendThreads _sendThreads; static int _clientCount; static SimpleMovingAverage _averageLoopTime; diff --git a/libraries/shared/src/GenericThread.cpp b/libraries/shared/src/GenericThread.cpp index 4fdd2eb1d2..c1c31ab50a 100644 --- a/libraries/shared/src/GenericThread.cpp +++ b/libraries/shared/src/GenericThread.cpp @@ -15,7 +15,6 @@ GenericThread::GenericThread() : - QObject(), _stopThread(false), _isThreaded(false) // assume non-threaded, must call initialize() { From b4dc3b1b472f1fc5dc8cbedd1691ebca0d746f42 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 16 Dec 2015 11:07:19 -0800 Subject: [PATCH 16/26] Fix windows compile error. --- assignment-client/src/octree/OctreeServer.cpp | 2 +- libraries/networking/src/LimitedNodeList.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index f42431589e..75252ddf8c 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -1205,7 +1205,7 @@ void OctreeServer::aboutToFinish() { // we're going down - set the NodeList linkedDataCallback to NULL so we do not create any more OctreeQueryNode objects. // This ensures that we don't get any more newly connecting nodes - DependencyManager::get()->linkedDataCreateCallback = NULL; + DependencyManager::get()->linkedDataCreateCallback = nullptr; if (_octreeInboundPacketProcessor) { _octreeInboundPacketProcessor->terminating(); diff --git a/libraries/networking/src/LimitedNodeList.cpp b/libraries/networking/src/LimitedNodeList.cpp index 4419ba882a..0b194b017e 100644 --- a/libraries/networking/src/LimitedNodeList.cpp +++ b/libraries/networking/src/LimitedNodeList.cpp @@ -40,7 +40,6 @@ const char SOLO_NODE_TYPES[2] = { }; LimitedNodeList::LimitedNodeList(unsigned short socketListenPort, unsigned short dtlsListenPort) : - linkedDataCreateCallback(NULL), _sessionUUID(), _nodeHash(), _nodeMutex(QReadWriteLock::Recursive), From a655557af0249cb9ed15d6321f51533d42896fa6 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 16 Dec 2015 11:11:34 -0800 Subject: [PATCH 17/26] Make variable name more obvious --- assignment-client/src/octree/OctreeServer.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index 75252ddf8c..acc9537a56 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -1173,7 +1173,8 @@ void OctreeServer::nodeKilled(SharedNodePointer node) { // Shutdown send thread auto it = _sendThreads.find(node->getUUID()); if (it != _sendThreads.end()) { - it->second->setIsShuttingDown(); + auto& sendThread = *it->second; + sendThread.setIsShuttingDown(); } // calling this here since nodeKilled slot in ReceivedPacketProcessor can't be triggered by signals yet!! @@ -1217,8 +1218,9 @@ void OctreeServer::aboutToFinish() { // Shut down all the send threads for (auto it = _sendThreads.begin(); it != _sendThreads.end(); ++it) { - it->second->disconnect(this); // Disconnect so that removeSendThread doesn't get called later - it->second->setIsShuttingDown(); + auto& sendThread = *it->second; + sendThread.disconnect(this); // Disconnect so that removeSendThread doesn't get called later + sendThread.setIsShuttingDown(); } // Wait on all send threads to be done before continuing From df24fafe49c2ae3563ab9a54b513a680baf41165 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 16 Dec 2015 11:28:26 -0800 Subject: [PATCH 18/26] CR feedback --- assignment-client/src/octree/OctreeServer.cpp | 17 +++++++++++------ assignment-client/src/octree/OctreeServer.h | 6 +++++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index acc9537a56..9cb809f48f 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -868,6 +868,16 @@ void OctreeServer::parsePayload() { } } +OctreeServer::UniqueSendThread OctreeServer::createSendThread(const SharedNodePointer& node) { + auto sendThread = std::unique_ptr(new OctreeSendThread(this, node)); + + // we want to be notified when the thread finishes + connect(sendThread.get(), &GenericThread::finished, this, &OctreeServer::removeSendThread); + sendThread->initialize(true); + + return sendThread; +} + void OctreeServer::removeSendThread() { auto sendThread = static_cast(sender()); @@ -884,12 +894,7 @@ void OctreeServer::handleOctreeQueryPacket(QSharedPointer messa auto it = _sendThreads.find(senderNode->getUUID()); if (it == _sendThreads.end() || it->second->isShuttingDown()) { - auto sendThread = std::unique_ptr(new OctreeSendThread(this, senderNode)); - - // we want to be notified when the thread finishes - connect(sendThread.get(), &GenericThread::finished, this, &OctreeServer::removeSendThread); - sendThread->initialize(true); - _sendThreads.emplace(senderNode->getUUID(), std::move(sendThread)); + _sendThreads.emplace(senderNode->getUUID(), createSendThread(senderNode)); } } } diff --git a/assignment-client/src/octree/OctreeServer.h b/assignment-client/src/octree/OctreeServer.h index 98f6c79893..2aabb97428 100644 --- a/assignment-client/src/octree/OctreeServer.h +++ b/assignment-client/src/octree/OctreeServer.h @@ -140,6 +140,9 @@ private slots: void removeSendThread(); protected: + using UniqueSendThread = std::unique_ptr; + using SendThreads = std::unordered_map; + virtual OctreePointer createTree() = 0; bool readOptionBool(const QString& optionName, const QJsonObject& settingsSectionObject, bool& result); bool readOptionInt(const QString& optionName, const QJsonObject& settingsSectionObject, int& result); @@ -153,6 +156,8 @@ protected: QString getFileLoadTime(); QString getConfiguration(); QString getStatusLink(); + + UniqueSendThread createSendThread(const SharedNodePointer& node); int _argc; const char** _argv; @@ -191,7 +196,6 @@ protected: quint64 _startedUSecs; QString _safeServerName; - using SendThreads = std::unordered_map>; SendThreads _sendThreads; static int _clientCount; From 0f7093bed7b259211f29d06bb1a38752c9ce47f6 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 16 Dec 2015 11:35:12 -0800 Subject: [PATCH 19/26] Whitespace --- assignment-client/src/octree/OctreeQueryNode.h | 2 +- assignment-client/src/octree/OctreeServer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assignment-client/src/octree/OctreeQueryNode.h b/assignment-client/src/octree/OctreeQueryNode.h index 4313d101fd..0ec876e674 100644 --- a/assignment-client/src/octree/OctreeQueryNode.h +++ b/assignment-client/src/octree/OctreeQueryNode.h @@ -103,7 +103,7 @@ public: private: OctreeQueryNode(const OctreeQueryNode &); OctreeQueryNode& operator= (const OctreeQueryNode&); - + bool _viewSent { false }; std::unique_ptr _octreePacket; bool _octreePacketWaiting; diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index 9cb809f48f..9961b5d688 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -1235,7 +1235,7 @@ void OctreeServer::aboutToFinish() { _persistThread->aboutToFinish(); _persistThread->terminating(); } - + qDebug() << qPrintable(_safeServerName) << "server ENDING about to finish..."; } From b55d8f750fed1368ab84e1af2ebb992b8c53fde0 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 16 Dec 2015 11:47:40 -0800 Subject: [PATCH 20/26] CR --- assignment-client/src/octree/OctreeServer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index 9961b5d688..937998f28a 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -1222,14 +1222,15 @@ void OctreeServer::aboutToFinish() { } // Shut down all the send threads - for (auto it = _sendThreads.begin(); it != _sendThreads.end(); ++it) { - auto& sendThread = *it->second; + for (auto& it : _sendThreads) { + auto& sendThread = *it.second; sendThread.disconnect(this); // Disconnect so that removeSendThread doesn't get called later sendThread.setIsShuttingDown(); } - // Wait on all send threads to be done before continuing - _sendThreads.clear(); + // Clear will destruct all the unique_ptr to OctreeSendThreads which will call the GenericThread's dtor + // which waits on the thread to be done before returning + _sendThreads.clear(); // Cleans up all the send threads. if (_persistThread) { _persistThread->aboutToFinish(); From 6bda8d3f18fb32a252e35ba0234965b97c567513 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 16 Dec 2015 11:48:23 -0800 Subject: [PATCH 21/26] CR logging category --- assignment-client/src/AssignmentClientLogging.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assignment-client/src/AssignmentClientLogging.cpp b/assignment-client/src/AssignmentClientLogging.cpp index 3e9dbdc53c..890187ecaa 100644 --- a/assignment-client/src/AssignmentClientLogging.cpp +++ b/assignment-client/src/AssignmentClientLogging.cpp @@ -11,4 +11,4 @@ #include "AssignmentClientLogging.h" -Q_LOGGING_CATEGORY(assigmnentclient, "hifi.assignmentclient") \ No newline at end of file +Q_LOGGING_CATEGORY(assigmnentclient, "hifi.assignment-client") \ No newline at end of file From b709c8162c71a05a099273c60db01fba66a5010d Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 16 Dec 2015 14:24:52 -0800 Subject: [PATCH 22/26] Fix node flapping race --- assignment-client/src/octree/OctreeServer.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index 937998f28a..04b6845ad8 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -879,10 +879,11 @@ OctreeServer::UniqueSendThread OctreeServer::createSendThread(const SharedNodePo } void OctreeServer::removeSendThread() { - auto sendThread = static_cast(sender()); - - // This deletes the unique_ptr, so sendThread is destructed after that line - _sendThreads.erase(sendThread->getNodeUuid()); + // If the object has been deleted since the event was queued, sender() will return nullptr + if (auto sendThread = qobject_cast(sender())) { + // This deletes the unique_ptr, so sendThread is destructed after that line + _sendThreads.erase(sendThread->getNodeUuid()); + } } void OctreeServer::handleOctreeQueryPacket(QSharedPointer message, SharedNodePointer senderNode) { @@ -893,7 +894,13 @@ void OctreeServer::handleOctreeQueryPacket(QSharedPointer messa nodeList->updateNodeWithDataFromPacket(message, senderNode); auto it = _sendThreads.find(senderNode->getUUID()); - if (it == _sendThreads.end() || it->second->isShuttingDown()) { + if (it == _sendThreads.end()) { + _sendThreads.emplace(senderNode->getUUID(), createSendThread(senderNode)); + } else if (it->second->isShuttingDown()) { + auto& sendThread = *it->second; + sendThread.setIsShuttingDown(); + _sendThreads.erase(it); // Remove right away and wait on thread to be + _sendThreads.emplace(senderNode->getUUID(), createSendThread(senderNode)); } } @@ -1224,7 +1231,6 @@ void OctreeServer::aboutToFinish() { // Shut down all the send threads for (auto& it : _sendThreads) { auto& sendThread = *it.second; - sendThread.disconnect(this); // Disconnect so that removeSendThread doesn't get called later sendThread.setIsShuttingDown(); } From a7b61cf791387695126b9da9a56233ab06ab170a Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Wed, 16 Dec 2015 16:39:09 -0600 Subject: [PATCH 23/26] Couple of fixes --- CMakeLists.txt | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca3e381405..13d5b2bc79 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.3.2) +cmake_minimum_required(VERSION 3.2) if (USE_ANDROID_TOOLCHAIN) set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/android/android.toolchain.cmake") @@ -228,21 +228,4 @@ if (HIFI_MEMORY_DEBUGGING) endif () include_application_version() - -if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE) - file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/full-stack-deployment") - find_program(MAKENSIS_COMMAND makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\NSIS]) - if (NOT MAKENSIS_COMMAND) - message(FATAL_ERROR "The Nullsoft Scriptable Install Systems is required for generating packaged installers on Windows (http://nsis.sourceforge.net/)") - endif () - add_custom_target( - build-package ALL - DEPENDS interface assignment-client domain-server stack-manager - COMMAND set INSTALLER_SOURCE_DIR=${CMAKE_BINARY_DIR}/full-stack-deployment - COMMAND set INSTALLER_NAME=${CMAKE_BINARY_DIR}/${INSTALLER_NAME} - COMMAND set INSTALLER_SCRIPTS_DIR=${CMAKE_SOURCE_DIR}/examples - COMMAND set INSTALLER_COMPANY=${INSTALLER_COMPANY} - COMMAND set INSTALLER_DIRECTORY=${INSTALLER_DIRECTORY} - COMMAND CMD /C "\"${MAKENSIS_COMMAND}\" ${CMAKE_SOURCE_DIR}/tools/nsis/release.nsi" - ) -endif () \ No newline at end of file +generate_installers() \ No newline at end of file From bbe444ffc1a4833f7b4bab49d81d02a02494782c Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Wed, 16 Dec 2015 16:40:51 -0600 Subject: [PATCH 24/26] Forgot to add file --- cmake/macros/GenerateInstallers.cmake | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 cmake/macros/GenerateInstallers.cmake diff --git a/cmake/macros/GenerateInstallers.cmake b/cmake/macros/GenerateInstallers.cmake new file mode 100644 index 0000000000..570e24332b --- /dev/null +++ b/cmake/macros/GenerateInstallers.cmake @@ -0,0 +1,30 @@ +# +# GenerateInstallers.cmake +# cmake/macros +# +# Created by Leonardo Murillo on 12/16/2015. +# Copyright 2015 High Fidelity, Inc. +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# + +macro(GENERATE_INSTALLERS) + if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE AND WIN32) + file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/full-stack-deployment") + find_program(MAKENSIS_COMMAND makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\NSIS]) + if (NOT MAKENSIS_COMMAND) + message(FATAL_ERROR "The Nullsoft Scriptable Install Systems is required for generating packaged installers on Windows (http://nsis.sourceforge.net/)") + endif () + add_custom_target( + build-package ALL + DEPENDS interface assignment-client domain-server stack-manager + COMMAND set INSTALLER_SOURCE_DIR=${CMAKE_BINARY_DIR}/full-stack-deployment + COMMAND set INSTALLER_NAME=${CMAKE_BINARY_DIR}/${INSTALLER_NAME} + COMMAND set INSTALLER_SCRIPTS_DIR=${CMAKE_SOURCE_DIR}/examples + COMMAND set INSTALLER_COMPANY=${INSTALLER_COMPANY} + COMMAND set INSTALLER_DIRECTORY=${INSTALLER_DIRECTORY} + COMMAND CMD /C "\"${MAKENSIS_COMMAND}\" ${CMAKE_SOURCE_DIR}/tools/nsis/release.nsi" + ) + endif () +endmacro() \ No newline at end of file From 364a70bb46106143a66a9d2f5da038c04c0b2ce0 Mon Sep 17 00:00:00 2001 From: AlessandroSigna Date: Wed, 16 Dec 2015 15:39:45 -0800 Subject: [PATCH 25/26] Fix to avoid MVS warning --- interface/src/ui/overlays/Image3DOverlay.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/ui/overlays/Image3DOverlay.cpp b/interface/src/ui/overlays/Image3DOverlay.cpp index 7d105a6ccf..f1e0f08a3a 100644 --- a/interface/src/ui/overlays/Image3DOverlay.cpp +++ b/interface/src/ui/overlays/Image3DOverlay.cpp @@ -34,8 +34,8 @@ Image3DOverlay::Image3DOverlay(const Image3DOverlay* image3DOverlay) : Billboard3DOverlay(image3DOverlay), _url(image3DOverlay->_url), _texture(image3DOverlay->_texture), - _fromImage(image3DOverlay->_fromImage), - _emissive(image3DOverlay->_emissive) + _emissive(image3DOverlay->_emissive), + _fromImage(image3DOverlay->_fromImage) { } From 2c8be15e6671df5e74f0241d1185d119a504df16 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 16 Dec 2015 15:56:22 -0800 Subject: [PATCH 26/26] Unnecessary shutdown (Already shutting down) --- assignment-client/src/octree/OctreeServer.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index 04b6845ad8..410aa922dc 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -897,8 +897,6 @@ void OctreeServer::handleOctreeQueryPacket(QSharedPointer messa if (it == _sendThreads.end()) { _sendThreads.emplace(senderNode->getUUID(), createSendThread(senderNode)); } else if (it->second->isShuttingDown()) { - auto& sendThread = *it->second; - sendThread.setIsShuttingDown(); _sendThreads.erase(it); // Remove right away and wait on thread to be _sendThreads.emplace(senderNode->getUUID(), createSendThread(senderNode));