From d20d594ae5b01420b48630bef3da89322bc29079 Mon Sep 17 00:00:00 2001 From: David Back Date: Thu, 31 May 2018 10:50:54 -0700 Subject: [PATCH 01/32] use setCollisionEnabled for avatar collisions --- scripts/system/libraries/entitySelectionTool.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/system/libraries/entitySelectionTool.js b/scripts/system/libraries/entitySelectionTool.js index d03d4477f7..cb5d510598 100644 --- a/scripts/system/libraries/entitySelectionTool.js +++ b/scripts/system/libraries/entitySelectionTool.js @@ -313,8 +313,6 @@ SelectionDisplay = (function() { var CTRL_KEY_CODE = 16777249; - var AVATAR_COLLISIONS_OPTION = "Enable Avatar Collisions"; - var TRANSLATE_DIRECTION = { X : 0, Y : 1, @@ -1811,7 +1809,7 @@ SelectionDisplay = (function() { that.restoreAvatarCollisionsFromStretch = function() { if (handleStretchCollisionOverride) { - Menu.setIsOptionChecked(AVATAR_COLLISIONS_OPTION, true); + MyAvatar.setCollisionsEnabled(true); handleStretchCollisionOverride = false; } } @@ -2018,8 +2016,8 @@ SelectionDisplay = (function() { if (scaleHandle != null) { Overlays.editOverlay(scaleHandle, { color: COLOR_SCALE_CUBE_SELECTED }); } - if (Menu.isOptionChecked(AVATAR_COLLISIONS_OPTION)) { - Menu.setIsOptionChecked(AVATAR_COLLISIONS_OPTION, false); + if (MyAvatar.getCollisionsEnabled()) { + MyAvatar.setCollisionsEnabled(false); handleStretchCollisionOverride = true; } }; From cde111d6012476acd4bd66655efedc1f415cf46a Mon Sep 17 00:00:00 2001 From: David Back Date: Tue, 12 Jun 2018 17:55:04 -0700 Subject: [PATCH 02/32] remove pointing at system overlay and overlay at point checks --- scripts/system/libraries/entitySelectionTool.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/system/libraries/entitySelectionTool.js b/scripts/system/libraries/entitySelectionTool.js index 1b41559160..3f9c331b47 100644 --- a/scripts/system/libraries/entitySelectionTool.js +++ b/scripts/system/libraries/entitySelectionTool.js @@ -667,9 +667,6 @@ SelectionDisplay = (function() { activeHand = (activeHand === Controller.Standard.RightHand) ? Controller.Standard.LeftHand : Controller.Standard.RightHand; } - if (Reticle.pointingAtSystemOverlay || Overlays.getOverlayAtPoint(Reticle.position)) { - return; - } that.mousePressEvent({}); } else if (that.triggered && (value < that.TRIGGER_OFF_VALUE)) { that.triggered = false; From 9b33e6757f6d33a2057d4b0bfc88a1406bf97599 Mon Sep 17 00:00:00 2001 From: David Back Date: Fri, 15 Jun 2018 14:29:47 -0700 Subject: [PATCH 03/32] prevent edit press events when pointing at desktop window or tablet --- .../controllerModules/inEditMode.js | 34 +++++++++++++++++++ .../system/libraries/entitySelectionTool.js | 24 ++++++++++++- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/scripts/system/controllers/controllerModules/inEditMode.js b/scripts/system/controllers/controllerModules/inEditMode.js index 5d90898b82..d0c2f94f85 100644 --- a/scripts/system/controllers/controllerModules/inEditMode.js +++ b/scripts/system/controllers/controllerModules/inEditMode.js @@ -18,10 +18,16 @@ Script.include("/~/system/libraries/controllers.js"); Script.include("/~/system/libraries/utils.js"); (function () { + var MARGIN = 25; + function InEditMode(hand) { this.hand = hand; this.triggerClicked = false; this.selectedTarget = null; + this.reticleMinX = MARGIN; + this.reticleMaxX; + this.reticleMinY = MARGIN; + this.reticleMaxY; this.parameters = makeDispatcherModuleParameters( 160, @@ -47,6 +53,16 @@ Script.include("/~/system/libraries/utils.js"); return (HMD.tabletScreenID && objectID === HMD.tabletScreenID) || (HMD.homeButtonID && objectID === HMD.homeButtonID); }; + + this.calculateNewReticlePosition = function(intersection) { + var dims = Controller.getViewportDimensions(); + this.reticleMaxX = dims.x - MARGIN; + this.reticleMaxY = dims.y - MARGIN; + var point2d = HMD.overlayFromWorldPoint(intersection); + point2d.x = Math.max(this.reticleMinX, Math.min(point2d.x, this.reticleMaxX)); + point2d.y = Math.max(this.reticleMinY, Math.min(point2d.y, this.reticleMaxY)); + return point2d; + }; this.sendPickData = function(controllerData) { if (controllerData.triggerClicks[this.hand]) { @@ -72,7 +88,24 @@ Script.include("/~/system/libraries/utils.js"); this.triggerClicked = true; } + + this.sendPointingAtData(controllerData); }; + + this.sendPointingAtData = function(controllerData) { + var rayPick = controllerData.rayPicks[this.hand]; + var hudRayPick = controllerData.hudRayPicks[this.hand]; + var point2d = this.calculateNewReticlePosition(hudRayPick.intersection); + var desktopWindow = Window.isPointOnDesktopWindow(point2d); + var tablet = this.pointingAtTablet(rayPick.objectID); + var rightHand = this.hand === RIGHT_HAND; + Messages.sendLocalMessage("entityToolUpdates", JSON.stringify({ + method: "pointingAt", + desktopWindow: desktopWindow, + tablet: tablet, + rightHand: rightHand + })); + }; this.exitModule = function() { return makeRunningValues(false, [], []); @@ -104,6 +137,7 @@ Script.include("/~/system/libraries/utils.js"); if (overlayLaser) { var overlayLaserReady = overlayLaser.isReady(controllerData); var target = controllerData.rayPicks[this.hand].objectID; + this.sendPointingAtData(controllerData); if (overlayLaserReady.active && this.pointingAtTablet(target)) { return this.exitModule(); } diff --git a/scripts/system/libraries/entitySelectionTool.js b/scripts/system/libraries/entitySelectionTool.js index 3f9c331b47..35ea579824 100644 --- a/scripts/system/libraries/entitySelectionTool.js +++ b/scripts/system/libraries/entitySelectionTool.js @@ -58,6 +58,14 @@ SelectionManager = (function() { that.setSelections([messageParsed.entityID]); } else if (messageParsed.method === "clearSelection") { that.clearSelections(); + } else if (messageParsed.method === "pointingAt") { + if (messageParsed.rightHand) { + that.pointingAtDesktopWindowRight = messageParsed.desktopWindow; + that.pointingAtTabletRight = messageParsed.tablet; + } else { + that.pointingAtDesktopWindowLeft = messageParsed.desktopWindow; + that.pointingAtTabletLeft = messageParsed.tablet; + } } } @@ -93,6 +101,11 @@ SelectionManager = (function() { that.worldDimensions = Vec3.ZERO; that.worldRegistrationPoint = Vec3.HALF; that.centerPosition = Vec3.ZERO; + + that.pointingAtDesktopWindowLeft = false; + that.pointingAtDesktopWindowRight = false; + that.pointingAtTabletLeft = false; + that.pointingAtTabletRight = false; that.saveProperties = function() { that.savedProperties = {}; @@ -667,7 +680,16 @@ SelectionDisplay = (function() { activeHand = (activeHand === Controller.Standard.RightHand) ? Controller.Standard.LeftHand : Controller.Standard.RightHand; } - that.mousePressEvent({}); + var pointingAtDesktopWindow = (hand === Controller.Standard.RightHand && + SelectionManager.pointingAtDesktopWindowRight) || + (hand === Controller.Standard.LeftHand && + SelectionManager.pointingAtDesktopWindowLeft); + var pointingAtTablet = (hand === Controller.Standard.RightHand && SelectionManager.pointingAtTabletRight) || + (hand === Controller.Standard.LeftHand && SelectionManager.pointingAtTabletLeft); + if (pointingAtDesktopWindow || pointingAtTablet) { + return; + } + that.mousePressEvent({}); } else if (that.triggered && (value < that.TRIGGER_OFF_VALUE)) { that.triggered = false; that.mouseReleaseEvent({}); From bc06b88afc49cb6074296046a7e5e584f7e4afda Mon Sep 17 00:00:00 2001 From: David Back Date: Fri, 15 Jun 2018 14:31:18 -0700 Subject: [PATCH 04/32] tabs --- .../controllerModules/inEditMode.js | 42 +++++++++---------- .../system/libraries/entitySelectionTool.js | 40 +++++++++--------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/scripts/system/controllers/controllerModules/inEditMode.js b/scripts/system/controllers/controllerModules/inEditMode.js index d0c2f94f85..a724c2037b 100644 --- a/scripts/system/controllers/controllerModules/inEditMode.js +++ b/scripts/system/controllers/controllerModules/inEditMode.js @@ -18,13 +18,13 @@ Script.include("/~/system/libraries/controllers.js"); Script.include("/~/system/libraries/utils.js"); (function () { - var MARGIN = 25; - + var MARGIN = 25; + function InEditMode(hand) { this.hand = hand; this.triggerClicked = false; this.selectedTarget = null; - this.reticleMinX = MARGIN; + this.reticleMinX = MARGIN; this.reticleMaxX; this.reticleMinY = MARGIN; this.reticleMaxY; @@ -53,7 +53,7 @@ Script.include("/~/system/libraries/utils.js"); return (HMD.tabletScreenID && objectID === HMD.tabletScreenID) || (HMD.homeButtonID && objectID === HMD.homeButtonID); }; - + this.calculateNewReticlePosition = function(intersection) { var dims = Controller.getViewportDimensions(); this.reticleMaxX = dims.x - MARGIN; @@ -88,24 +88,24 @@ Script.include("/~/system/libraries/utils.js"); this.triggerClicked = true; } - - this.sendPointingAtData(controllerData); + + this.sendPointingAtData(controllerData); }; - - this.sendPointingAtData = function(controllerData) { - var rayPick = controllerData.rayPicks[this.hand]; - var hudRayPick = controllerData.hudRayPicks[this.hand]; - var point2d = this.calculateNewReticlePosition(hudRayPick.intersection); - var desktopWindow = Window.isPointOnDesktopWindow(point2d); - var tablet = this.pointingAtTablet(rayPick.objectID); - var rightHand = this.hand === RIGHT_HAND; - Messages.sendLocalMessage("entityToolUpdates", JSON.stringify({ - method: "pointingAt", - desktopWindow: desktopWindow, - tablet: tablet, - rightHand: rightHand + + this.sendPointingAtData = function(controllerData) { + var rayPick = controllerData.rayPicks[this.hand]; + var hudRayPick = controllerData.hudRayPicks[this.hand]; + var point2d = this.calculateNewReticlePosition(hudRayPick.intersection); + var desktopWindow = Window.isPointOnDesktopWindow(point2d); + var tablet = this.pointingAtTablet(rayPick.objectID); + var rightHand = this.hand === RIGHT_HAND; + Messages.sendLocalMessage("entityToolUpdates", JSON.stringify({ + method: "pointingAt", + desktopWindow: desktopWindow, + tablet: tablet, + rightHand: rightHand })); - }; + }; this.exitModule = function() { return makeRunningValues(false, [], []); @@ -137,7 +137,7 @@ Script.include("/~/system/libraries/utils.js"); if (overlayLaser) { var overlayLaserReady = overlayLaser.isReady(controllerData); var target = controllerData.rayPicks[this.hand].objectID; - this.sendPointingAtData(controllerData); + this.sendPointingAtData(controllerData); if (overlayLaserReady.active && this.pointingAtTablet(target)) { return this.exitModule(); } diff --git a/scripts/system/libraries/entitySelectionTool.js b/scripts/system/libraries/entitySelectionTool.js index 35ea579824..5769e4fded 100644 --- a/scripts/system/libraries/entitySelectionTool.js +++ b/scripts/system/libraries/entitySelectionTool.js @@ -59,13 +59,13 @@ SelectionManager = (function() { } else if (messageParsed.method === "clearSelection") { that.clearSelections(); } else if (messageParsed.method === "pointingAt") { - if (messageParsed.rightHand) { - that.pointingAtDesktopWindowRight = messageParsed.desktopWindow; - that.pointingAtTabletRight = messageParsed.tablet; - } else { - that.pointingAtDesktopWindowLeft = messageParsed.desktopWindow; - that.pointingAtTabletLeft = messageParsed.tablet; - } + if (messageParsed.rightHand) { + that.pointingAtDesktopWindowRight = messageParsed.desktopWindow; + that.pointingAtTabletRight = messageParsed.tablet; + } else { + that.pointingAtDesktopWindowLeft = messageParsed.desktopWindow; + that.pointingAtTabletLeft = messageParsed.tablet; + } } } @@ -101,11 +101,11 @@ SelectionManager = (function() { that.worldDimensions = Vec3.ZERO; that.worldRegistrationPoint = Vec3.HALF; that.centerPosition = Vec3.ZERO; - - that.pointingAtDesktopWindowLeft = false; - that.pointingAtDesktopWindowRight = false; - that.pointingAtTabletLeft = false; - that.pointingAtTabletRight = false; + + that.pointingAtDesktopWindowLeft = false; + that.pointingAtDesktopWindowRight = false; + that.pointingAtTabletLeft = false; + that.pointingAtTabletRight = false; that.saveProperties = function() { that.savedProperties = {}; @@ -680,16 +680,16 @@ SelectionDisplay = (function() { activeHand = (activeHand === Controller.Standard.RightHand) ? Controller.Standard.LeftHand : Controller.Standard.RightHand; } - var pointingAtDesktopWindow = (hand === Controller.Standard.RightHand && - SelectionManager.pointingAtDesktopWindowRight) || - (hand === Controller.Standard.LeftHand && - SelectionManager.pointingAtDesktopWindowLeft); - var pointingAtTablet = (hand === Controller.Standard.RightHand && SelectionManager.pointingAtTabletRight) || - (hand === Controller.Standard.LeftHand && SelectionManager.pointingAtTabletLeft); + var pointingAtDesktopWindow = (hand === Controller.Standard.RightHand && + SelectionManager.pointingAtDesktopWindowRight) || + (hand === Controller.Standard.LeftHand && + SelectionManager.pointingAtDesktopWindowLeft); + var pointingAtTablet = (hand === Controller.Standard.RightHand && SelectionManager.pointingAtTabletRight) || + (hand === Controller.Standard.LeftHand && SelectionManager.pointingAtTabletLeft); if (pointingAtDesktopWindow || pointingAtTablet) { - return; + return; } - that.mousePressEvent({}); + that.mousePressEvent({}); } else if (that.triggered && (value < that.TRIGGER_OFF_VALUE)) { that.triggered = false; that.mouseReleaseEvent({}); From f6c624dcc3ad96f8e65b6a83f89c484b7f0b65e5 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 15 Jun 2018 16:31:09 -0700 Subject: [PATCH 05/32] Remove logging messages for behaviors that are expected. Attached entities with scripts are now being sold on the marketplace (rWatch) and are now being worn by various users. Because of this, it's now common for the 'removing entity scripts' case to be hit in code for every update, which causes debug log messages every 60 seconds for each entity entity with a script. Repro: Have an avatar wear rWatch. With a second instance of interface, turn on verbose logging while the first avatar is local. See debug logging 60 times a second. Fix: Given attached entities with scripts are happening, it's not an exceptional case and should probably not be logged. --- libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp index 048b8b1633..c257349bff 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.cpp @@ -294,7 +294,6 @@ void Avatar::updateAvatarEntities() { // NOTE: if this avatar entity is not attached to us, strip its entity script completely... auto attachedScript = properties.getScript(); if (!isMyAvatar() && !attachedScript.isEmpty()) { - qCDebug(avatars_renderer) << "removing entity script from avatar attached entity:" << entityID << "old script:" << attachedScript; QString noScript; properties.setScript(noScript); } From 6ef8206f3aeb913f14d9ffa164d97b8441d7313a Mon Sep 17 00:00:00 2001 From: David Back Date: Fri, 15 Jun 2018 17:32:03 -0700 Subject: [PATCH 06/32] temp disable myAvatar collisions when stretching --- .../system/libraries/entitySelectionTool.js | 43 ++++++++----------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/scripts/system/libraries/entitySelectionTool.js b/scripts/system/libraries/entitySelectionTool.js index b42ed5cf64..48c8c68f96 100644 --- a/scripts/system/libraries/entitySelectionTool.js +++ b/scripts/system/libraries/entitySelectionTool.js @@ -366,7 +366,7 @@ SelectionDisplay = (function() { var ctrlPressed = false; - var handleStretchCollisionOverride = false; + var replaceCollisionsAfterStretch = false; var handlePropertiesTranslateArrowCones = { shape: "Cone", @@ -642,11 +642,6 @@ SelectionDisplay = (function() { var activeTool = null; var handleTools = {}; - that.shutdown = function() { - that.restoreAvatarCollisionsFromStretch(); - } - Script.scriptEnding.connect(that.shutdown); - // We get mouseMoveEvents from the handControllers, via handControllerPointer. // But we dont' get mousePressEvents. that.triggerMapping = Controller.newMapping(Script.resolvePath('') + '-click'); @@ -1830,13 +1825,6 @@ SelectionDisplay = (function() { }; }; - that.restoreAvatarCollisionsFromStretch = function() { - if (handleStretchCollisionOverride) { - MyAvatar.setCollisionsEnabled(true); - handleStretchCollisionOverride = false; - } - } - // TOOL DEFINITION: HANDLE STRETCH TOOL function makeStretchTool(stretchMode, directionEnum, directionVec, pivot, offset, stretchPanel, scaleHandle) { var directionFor3DStretch = directionVec; @@ -2039,10 +2027,13 @@ SelectionDisplay = (function() { if (scaleHandle != null) { Overlays.editOverlay(scaleHandle, { color: COLOR_SCALE_CUBE_SELECTED }); } - if (MyAvatar.getCollisionsEnabled()) { - MyAvatar.setCollisionsEnabled(false); - handleStretchCollisionOverride = true; - } + + var myAvatarIndex = properties.collidesWith.indexOf("myAvatar"); + if (myAvatarIndex > -1) { + var newCollidesWith = properties.collidesWith.replace("myAvatar", ""); + Entities.editEntity(SelectionManager.selections[0], {collidesWith: newCollidesWith}); + that.replaceCollisionsAfterStretch = true; + } }; var onEnd = function(event, reason) { @@ -2052,7 +2043,13 @@ SelectionDisplay = (function() { if (scaleHandle != null) { Overlays.editOverlay(scaleHandle, { color: COLOR_SCALE_CUBE }); } - that.restoreAvatarCollisionsFromStretch(); + + if (that.replaceCollisionsAfterStretch) { + var newCollidesWith = SelectionManager.savedProperties[SelectionManager.selections[0]].collidesWith; + Entities.editEntity(SelectionManager.selections[0], {collidesWith: newCollidesWith}); + that.replaceCollisionsAfterStretch = false; + } + pushCommandForSelections(); }; @@ -2138,12 +2135,10 @@ SelectionDisplay = (function() { } var newPosition = Vec3.sum(initialPosition, changeInPosition); - for (var i = 0; i < SelectionManager.selections.length; i++) { - Entities.editEntity(SelectionManager.selections[i], { - position: newPosition, - dimensions: newDimensions - }); - } + Entities.editEntity(SelectionManager.selections[0], { + position: newPosition, + dimensions: newDimensions + }); var wantDebug = false; if (wantDebug) { From d16b7779779ad232d56e989a33a33e0f18923134 Mon Sep 17 00:00:00 2001 From: David Back Date: Fri, 15 Jun 2018 17:33:49 -0700 Subject: [PATCH 07/32] tabs --- .../system/libraries/entitySelectionTool.js | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/scripts/system/libraries/entitySelectionTool.js b/scripts/system/libraries/entitySelectionTool.js index 48c8c68f96..9da0e813d1 100644 --- a/scripts/system/libraries/entitySelectionTool.js +++ b/scripts/system/libraries/entitySelectionTool.js @@ -2027,13 +2027,13 @@ SelectionDisplay = (function() { if (scaleHandle != null) { Overlays.editOverlay(scaleHandle, { color: COLOR_SCALE_CUBE_SELECTED }); } - - var myAvatarIndex = properties.collidesWith.indexOf("myAvatar"); - if (myAvatarIndex > -1) { - var newCollidesWith = properties.collidesWith.replace("myAvatar", ""); - Entities.editEntity(SelectionManager.selections[0], {collidesWith: newCollidesWith}); - that.replaceCollisionsAfterStretch = true; - } + + var myAvatarIndex = properties.collidesWith.indexOf("myAvatar"); + if (myAvatarIndex > -1) { + var newCollidesWith = properties.collidesWith.replace("myAvatar", ""); + Entities.editEntity(SelectionManager.selections[0], {collidesWith: newCollidesWith}); + that.replaceCollisionsAfterStretch = true; + } }; var onEnd = function(event, reason) { @@ -2043,13 +2043,13 @@ SelectionDisplay = (function() { if (scaleHandle != null) { Overlays.editOverlay(scaleHandle, { color: COLOR_SCALE_CUBE }); } - - if (that.replaceCollisionsAfterStretch) { - var newCollidesWith = SelectionManager.savedProperties[SelectionManager.selections[0]].collidesWith; - Entities.editEntity(SelectionManager.selections[0], {collidesWith: newCollidesWith}); - that.replaceCollisionsAfterStretch = false; - } - + + if (that.replaceCollisionsAfterStretch) { + var newCollidesWith = SelectionManager.savedProperties[SelectionManager.selections[0]].collidesWith; + Entities.editEntity(SelectionManager.selections[0], {collidesWith: newCollidesWith}); + that.replaceCollisionsAfterStretch = false; + } + pushCommandForSelections(); }; @@ -2135,7 +2135,7 @@ SelectionDisplay = (function() { } var newPosition = Vec3.sum(initialPosition, changeInPosition); - Entities.editEntity(SelectionManager.selections[0], { + Entities.editEntity(SelectionManager.selections[0], { position: newPosition, dimensions: newDimensions }); From bb0b1cc4a4589b77be588754a0314f14bf2dd1cc Mon Sep 17 00:00:00 2001 From: David Back Date: Fri, 15 Jun 2018 17:35:18 -0700 Subject: [PATCH 08/32] no myAvatarIndex needed --- scripts/system/libraries/entitySelectionTool.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/system/libraries/entitySelectionTool.js b/scripts/system/libraries/entitySelectionTool.js index 9da0e813d1..8b1c50b129 100644 --- a/scripts/system/libraries/entitySelectionTool.js +++ b/scripts/system/libraries/entitySelectionTool.js @@ -2028,8 +2028,7 @@ SelectionDisplay = (function() { Overlays.editOverlay(scaleHandle, { color: COLOR_SCALE_CUBE_SELECTED }); } - var myAvatarIndex = properties.collidesWith.indexOf("myAvatar"); - if (myAvatarIndex > -1) { + if (properties.collidesWith.indexOf("myAvatar") > -1) { var newCollidesWith = properties.collidesWith.replace("myAvatar", ""); Entities.editEntity(SelectionManager.selections[0], {collidesWith: newCollidesWith}); that.replaceCollisionsAfterStretch = true; From 0242e1d4d5cc875e736a414a9b575010b1e379b1 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Mon, 18 Jun 2018 16:03:30 -0300 Subject: [PATCH 09/32] Use environment variables BACKTRACE_URL and BACKTRACE_TOKEN --- android/app/build.gradle | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 92dece2414..1d51b1ea26 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -28,7 +28,7 @@ android { '-DSTABLE_BUILD=' + STABLE_BUILD, '-DDISABLE_QML=OFF', '-DDISABLE_KTX_CACHE=OFF', - '-DUSE_BREAKPAD=' + (project.hasProperty("BACKTRACE_URL") && project.hasProperty("BACKTRACE_TOKEN") ? 'ON' : 'OFF'); + '-DUSE_BREAKPAD=' + (System.getenv("BACKTRACE_URL") && System.getenv("BACKTRACE_TOKEN") ? 'ON' : 'OFF'); } } signingConfigs { @@ -48,8 +48,8 @@ android { buildTypes { debug { - buildConfigField "String", "BACKTRACE_URL", "\"" + (project.hasProperty("BACKTRACE_URL") ? BACKTRACE_URL : '') + "\"" - buildConfigField "String", "BACKTRACE_TOKEN", "\"" + (project.hasProperty("BACKTRACE_TOKEN") ? BACKTRACE_TOKEN : '') + "\"" + buildConfigField "String", "BACKTRACE_URL", "\"" + (System.getenv("BACKTRACE_URL") ? System.getenv("BACKTRACE_URL") : '') + "\"" + buildConfigField "String", "BACKTRACE_TOKEN", "\"" + (System.getenv("BACKTRACE_TOKEN") ? System.getenv("BACKTRACE_TOKEN") : '') + "\"" } release { minifyEnabled false @@ -58,8 +58,8 @@ android { project.hasProperty("HIFI_ANDROID_KEYSTORE_PASSWORD") && project.hasProperty("HIFI_ANDROID_KEY_ALIAS") && project.hasProperty("HIFI_ANDROID_KEY_PASSWORD")? signingConfigs.release : null - buildConfigField "String", "BACKTRACE_URL", "\"" + (project.hasProperty("BACKTRACE_URL") ? BACKTRACE_URL : '') + "\"" - buildConfigField "String", "BACKTRACE_TOKEN", "\"" + (project.hasProperty("BACKTRACE_TOKEN") ? BACKTRACE_TOKEN : '') + "\"" + buildConfigField "String", "BACKTRACE_URL", "\"" + (System.getenv("BACKTRACE_URL") ? System.getenv("BACKTRACE_URL") : '') + "\"" + buildConfigField "String", "BACKTRACE_TOKEN", "\"" + (System.getenv("BACKTRACE_TOKEN") ? System.getenv("BACKTRACE_TOKEN") : '') + "\"" } } From e1b5564c7bdb37d3a9c24e9c845ed50d818940e1 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Mon, 18 Jun 2018 16:18:15 -0300 Subject: [PATCH 10/32] Use environment variables BACKTRACE_URL and BACKTRACE_TOKEN (fix) --- android/app/build.gradle | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 1d51b1ea26..ce39cdabf3 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -28,7 +28,7 @@ android { '-DSTABLE_BUILD=' + STABLE_BUILD, '-DDISABLE_QML=OFF', '-DDISABLE_KTX_CACHE=OFF', - '-DUSE_BREAKPAD=' + (System.getenv("BACKTRACE_URL") && System.getenv("BACKTRACE_TOKEN") ? 'ON' : 'OFF'); + '-DUSE_BREAKPAD=' + (System.getenv("CMAKE_BACKTRACE_URL") && System.getenv("CMAKE_BACKTRACE_TOKEN") ? 'ON' : 'OFF'); } } signingConfigs { @@ -48,8 +48,8 @@ android { buildTypes { debug { - buildConfigField "String", "BACKTRACE_URL", "\"" + (System.getenv("BACKTRACE_URL") ? System.getenv("BACKTRACE_URL") : '') + "\"" - buildConfigField "String", "BACKTRACE_TOKEN", "\"" + (System.getenv("BACKTRACE_TOKEN") ? System.getenv("BACKTRACE_TOKEN") : '') + "\"" + buildConfigField "String", "BACKTRACE_URL", "\"" + (System.getenv("CMAKE_BACKTRACE_URL") ? System.getenv("CMAKE_BACKTRACE_URL") : '') + "\"" + buildConfigField "String", "BACKTRACE_TOKEN", "\"" + (System.getenv("CMAKE_BACKTRACE_TOKEN") ? System.getenv("CMAKE_BACKTRACE_TOKEN") : '') + "\"" } release { minifyEnabled false @@ -58,8 +58,8 @@ android { project.hasProperty("HIFI_ANDROID_KEYSTORE_PASSWORD") && project.hasProperty("HIFI_ANDROID_KEY_ALIAS") && project.hasProperty("HIFI_ANDROID_KEY_PASSWORD")? signingConfigs.release : null - buildConfigField "String", "BACKTRACE_URL", "\"" + (System.getenv("BACKTRACE_URL") ? System.getenv("BACKTRACE_URL") : '') + "\"" - buildConfigField "String", "BACKTRACE_TOKEN", "\"" + (System.getenv("BACKTRACE_TOKEN") ? System.getenv("BACKTRACE_TOKEN") : '') + "\"" + buildConfigField "String", "BACKTRACE_URL", "\"" + (System.getenv("CMAKE_BACKTRACE_URL") ? System.getenv("CMAKE_BACKTRACE_URL") : '') + "\"" + buildConfigField "String", "BACKTRACE_TOKEN", "\"" + (System.getenv("CMAKE_BACKTRACE_TOKEN") ? System.getenv("CMAKE_BACKTRACE_TOKEN") : '') + "\"" } } From e2ddaeac029057cd7ad569be9804703a64f052a6 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Tue, 19 Jun 2018 14:31:44 -0300 Subject: [PATCH 11/32] Add gradle task runBreakpadDumpSyms --- android/app/build.gradle | 4 ++++ android/build.gradle | 46 ++++++++++++++++++++++++++++++++++++---- 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index ce39cdabf3..85bc4ea68e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -74,6 +74,10 @@ android { // so our merge has to depend on the external native build variant.externalNativeBuildTasks.each { task -> variant.mergeResources.dependsOn(task) + def dumpSymsTaskName = "runBreakpadDumpSyms${variant.name.capitalize()}"; + def dumpSymsTask = rootProject.getTasksByName(dumpSymsTaskName, false).first() + dumpSymsTask.dependsOn(task) + variant.assemble.dependsOn(dumpSymsTask) } variant.mergeAssets.doLast { diff --git a/android/build.gradle b/android/build.gradle index e2d92fe2f6..a232f31634 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -151,11 +151,11 @@ def packages = [ checksum: '14b02795d774457a33bbc60e00a786bc' ], breakpad: [ - file: 'breakpad.zip', - versionId: '2OwvCCZrF171wnte5T44AnjTYFhhJsGJ', - checksum: 'a46062a3167dfedd4fb4916136e204d2', + file: 'breakpad_dump_syms.zip', + versionId: 'udimLCwfB7tMbfGdE1CcLRt5p0.ehtoM', + checksum: '92b6ace2edb95ea82dca257cf0fe522b', sharedLibFolder: 'lib', - includeLibs: ['libbreakpad_client.a','libbreakpad.a'] + includeLibs: ['libbreakpad_client.a'] ] ] @@ -549,6 +549,44 @@ task cleanDependencies(type: Delete) { delete 'app/src/main/res/values/libs.xml' } +def runBreakpadDumpSyms = { buildType -> + def objDir = new File("${appDir}/build/intermediates/cmake/${buildType}/obj/arm64-v8a") + def stripDebugSymbol = "${appDir}/build/intermediates/transforms/stripDebugSymbol/${buildType}/0/lib/arm64-v8a/" + def outputDir = new File("${appDir}/build/tmp/breakpadDumpSyms") + if (!outputDir.exists()) { + outputDir.mkdirs() + } + + objDir.eachFileRecurse (FileType.FILES) { file -> + if (file.name.endsWith('.so')) { + def output = file.name + ".sym" + def cmdArgs = [ + file.toString(), + stripDebugSymbol + ] + exec { + workingDir HIFI_ANDROID_PRECOMPILED + '/breakpad/bin' + commandLine './dump_syms' + args cmdArgs + standardOutput = new BufferedOutputStream(new FileOutputStream(new File(outputDir, output))) + } + + } + } +} + +task runBreakpadDumpSymsRelease() { + doLast { + runBreakpadDumpSyms("release"); + } +} + +task runBreakpadDumpSymsDebug() { + doLast { + runBreakpadDumpSyms("debug"); + } +} + // FIXME this code is prototyping the desired functionality for doing build time binary dependency resolution. From 3a473eaa0ebaa5e4d1cc3ab46814c552ceb3488f Mon Sep 17 00:00:00 2001 From: Gabriel Date: Tue, 19 Jun 2018 15:46:07 -0300 Subject: [PATCH 12/32] Update breakpad_dump_syms.zip --- android/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index a232f31634..b98da8bf7e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -152,8 +152,8 @@ def packages = [ ], breakpad: [ file: 'breakpad_dump_syms.zip', - versionId: 'udimLCwfB7tMbfGdE1CcLRt5p0.ehtoM', - checksum: '92b6ace2edb95ea82dca257cf0fe522b', + versionId: 'yIIByczdMWGm.1f9DztIUoa6Sn3NM3IN', + checksum: '6440dbb25d0e86c8d32ad8b9fa74991c', sharedLibFolder: 'lib', includeLibs: ['libbreakpad_client.a'] ] From 77d53441c052f8a65d958985da943a8a92300b76 Mon Sep 17 00:00:00 2001 From: Gabriel Date: Tue, 19 Jun 2018 16:23:23 -0300 Subject: [PATCH 13/32] Add debug logging --- android/build.gradle | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index b98da8bf7e..71a36bc532 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -569,8 +569,11 @@ def runBreakpadDumpSyms = { buildType -> commandLine './dump_syms' args cmdArgs standardOutput = new BufferedOutputStream(new FileOutputStream(new File(outputDir, output))) + errorOutput = new ByteArrayOutputStream() + doLast { + println ("Exec error output: " + errorOutput.toString()) + } } - } } } From af29e10fe9715a23b40e53e28a231a5fa395deec Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Tue, 19 Jun 2018 16:51:22 -0300 Subject: [PATCH 14/32] Adding debug info --- android/app/build.gradle | 2 +- android/build.gradle | 52 +++++++++++++++++++++++++++++++++++----- 2 files changed, 47 insertions(+), 7 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 85bc4ea68e..af7cd9a890 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -74,7 +74,7 @@ android { // so our merge has to depend on the external native build variant.externalNativeBuildTasks.each { task -> variant.mergeResources.dependsOn(task) - def dumpSymsTaskName = "runBreakpadDumpSyms${variant.name.capitalize()}"; + def dumpSymsTaskName = "uploadBreakpadDumpSyms${variant.name.capitalize()}"; def dumpSymsTask = rootProject.getTasksByName(dumpSymsTaskName, false).first() dumpSymsTask.dependsOn(task) variant.assemble.dependsOn(dumpSymsTask) diff --git a/android/build.gradle b/android/build.gradle index 71a36bc532..b0fd32bc6d 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,6 +21,8 @@ buildscript { plugins { id 'de.undercouch.download' version '3.3.0' id "cz.malohlava" version "1.0.3" + id "io.github.http-builder-ng.http-plugin" version "0.1.1" + } allprojects { @@ -550,9 +552,11 @@ task cleanDependencies(type: Delete) { } def runBreakpadDumpSyms = { buildType -> + gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS + def objDir = new File("${appDir}/build/intermediates/cmake/${buildType}/obj/arm64-v8a") def stripDebugSymbol = "${appDir}/build/intermediates/transforms/stripDebugSymbol/${buildType}/0/lib/arm64-v8a/" - def outputDir = new File("${appDir}/build/tmp/breakpadDumpSyms") + def outputDir = new File("${appDir}/build/tmp/breakpadDumpSyms/${buildType}") if (!outputDir.exists()) { outputDir.mkdirs() } @@ -564,18 +568,44 @@ def runBreakpadDumpSyms = { buildType -> file.toString(), stripDebugSymbol ] - exec { + println ("Executing " + HIFI_ANDROID_PRECOMPILED + '/breakpad/bin' + "/dump_syms") + println ("Arguments " + cmdArgs) + def result = exec { workingDir HIFI_ANDROID_PRECOMPILED + '/breakpad/bin' commandLine './dump_syms' args cmdArgs standardOutput = new BufferedOutputStream(new FileOutputStream(new File(outputDir, output))) - errorOutput = new ByteArrayOutputStream() - doLast { - println ("Exec error output: " + errorOutput.toString()) - } + } + println ("Done " + result) + println ("E:[" + new File(outputDir, output+".err").text+ "]") + } + } +} + +def uploadDumpSyms = { buildType -> + def tmpDir = "${appDir}/build/tmp/breakpadDumpSyms/${buildType}/" + def zipFilename = "symbols-${RELEASE_NUMBER}.zip" + def zipDir = "${appDir}/build/tmp/breakpadDumpSyms/" + zip { + from tmpDir + include '*/*' + archiveName zipFilename + destinationDir(file(zipDir)) + } + + httpTask { + config { + request.uri = 'https://gcalero998.sp.backtrace.io:6098/post?format=symbols&token=d65d0d184789ac40c121952001fd91dfba7e149899b1eeccd68ccffe91dd2fd0' + } + post { + request.uri.path = '/notify' + request.body = new File(zipDir, zipFilename).bytes + response.success { + println 'Symbols upload successful' } } } + } task runBreakpadDumpSymsRelease() { @@ -590,7 +620,17 @@ task runBreakpadDumpSymsDebug() { } } +task uploadBreakpadDumpSymsRelease(dependsOn: runBreakpadDumpSymsRelease) { + doLast { + uploadDumpSyms("release") + } +} +task uploadBreakpadDumpSymsDebug(dependsOn: runBreakpadDumpSymsDebug) { + doLast { + uploadDumpSyms("debug") + } +} // FIXME this code is prototyping the desired functionality for doing build time binary dependency resolution. // See the comment on the qtBundle task above From f184e9fae827b6fd9e3a89993f3f7305d8b57879 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Tue, 19 Jun 2018 17:28:50 -0300 Subject: [PATCH 15/32] Debug dump_sym run --- android/app/build.gradle | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index af7cd9a890..3537df033d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -74,10 +74,10 @@ android { // so our merge has to depend on the external native build variant.externalNativeBuildTasks.each { task -> variant.mergeResources.dependsOn(task) - def dumpSymsTaskName = "uploadBreakpadDumpSyms${variant.name.capitalize()}"; - def dumpSymsTask = rootProject.getTasksByName(dumpSymsTaskName, false).first() - dumpSymsTask.dependsOn(task) - variant.assemble.dependsOn(dumpSymsTask) + def uploadDumpSymsTask = rootProject.getTasksByName("uploadBreakpadDumpSyms${variant.name.capitalize()}", false).first() + def runDumpSymsTask = rootProject.getTasksByName("runBreakpadDumpSyms${variant.name.capitalize()}", false).first() + runDumpSymsTask.dependsOn(task) + variant.assemble.dependsOn(uploadDumpSymsTask) } variant.mergeAssets.doLast { From a7c969f9df702bc41f9253a84fe793ddf2af31ff Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Tue, 19 Jun 2018 17:46:30 -0300 Subject: [PATCH 16/32] Adding debug info --- android/app/build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android/app/build.gradle b/android/app/build.gradle index 3537df033d..e67c5c89d7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -76,7 +76,9 @@ android { variant.mergeResources.dependsOn(task) def uploadDumpSymsTask = rootProject.getTasksByName("uploadBreakpadDumpSyms${variant.name.capitalize()}", false).first() def runDumpSymsTask = rootProject.getTasksByName("runBreakpadDumpSyms${variant.name.capitalize()}", false).first() + println (runDumpSymsTask.name + " dependsOn " + task.name) runDumpSymsTask.dependsOn(task) + println (variant.assemble.name + " dependsOn " + uploadDumpSymsTask.name) variant.assemble.dependsOn(uploadDumpSymsTask) } From 830dfd323358730c8826416b849cb1bb1813ef1a Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Tue, 19 Jun 2018 18:28:19 -0300 Subject: [PATCH 17/32] Debugging gradle script --- android/build.gradle | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index b0fd32bc6d..b312fb8f2c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -153,9 +153,9 @@ def packages = [ checksum: '14b02795d774457a33bbc60e00a786bc' ], breakpad: [ - file: 'breakpad_dump_syms.zip', - versionId: 'yIIByczdMWGm.1f9DztIUoa6Sn3NM3IN', - checksum: '6440dbb25d0e86c8d32ad8b9fa74991c', + file: 'breakpad.tgz', + versionId: '8VrYXz7oyc.QBxNia0BVJOUBvrFO61jI', + checksum: 'ddcb23df336b08017042ba4786db1d9e', sharedLibFolder: 'lib', includeLibs: ['libbreakpad_client.a'] ] @@ -568,16 +568,12 @@ def runBreakpadDumpSyms = { buildType -> file.toString(), stripDebugSymbol ] - println ("Executing " + HIFI_ANDROID_PRECOMPILED + '/breakpad/bin' + "/dump_syms") - println ("Arguments " + cmdArgs) def result = exec { workingDir HIFI_ANDROID_PRECOMPILED + '/breakpad/bin' commandLine './dump_syms' args cmdArgs standardOutput = new BufferedOutputStream(new FileOutputStream(new File(outputDir, output))) } - println ("Done " + result) - println ("E:[" + new File(outputDir, output+".err").text+ "]") } } } @@ -586,7 +582,7 @@ def uploadDumpSyms = { buildType -> def tmpDir = "${appDir}/build/tmp/breakpadDumpSyms/${buildType}/" def zipFilename = "symbols-${RELEASE_NUMBER}.zip" def zipDir = "${appDir}/build/tmp/breakpadDumpSyms/" - zip { + Zip { from tmpDir include '*/*' archiveName zipFilename From 2a36b85ece38ab6c9458619434b9401cab6400f2 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Tue, 19 Jun 2018 19:44:15 -0300 Subject: [PATCH 18/32] Debugging gradle script --- android/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/android/build.gradle b/android/build.gradle index b312fb8f2c..72193aaf88 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -572,6 +572,7 @@ def runBreakpadDumpSyms = { buildType -> workingDir HIFI_ANDROID_PRECOMPILED + '/breakpad/bin' commandLine './dump_syms' args cmdArgs + ignoreExitValue true standardOutput = new BufferedOutputStream(new FileOutputStream(new File(outputDir, output))) } } From b42f546b2ad9d98563749b910abb2e8a810bf284 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Tue, 19 Jun 2018 21:14:44 -0300 Subject: [PATCH 19/32] Debugging gradle script --- android/build.gradle | 58 +++++++++++++++++--------------------------- 1 file changed, 22 insertions(+), 36 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 72193aaf88..80439b1e5b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,8 +21,6 @@ buildscript { plugins { id 'de.undercouch.download' version '3.3.0' id "cz.malohlava" version "1.0.3" - id "io.github.http-builder-ng.http-plugin" version "0.1.1" - } allprojects { @@ -69,6 +67,7 @@ def baseFolder = new File(HIFI_ANDROID_PRECOMPILED) def appDir = new File(projectDir, 'app') def jniFolder = new File(appDir, 'src/main/jniLibs/arm64-v8a') def baseUrl = 'https://hifi-public.s3.amazonaws.com/dependencies/android/' +def breakpadDumpSymsDir = new File("${appDir}/build/tmp/breakpadDumpSyms") def qtFile='qt-5.9.3_linux_armv8-libcpp_openssl.tgz' def qtChecksum='04599670ccca84bd2b15f6915568eb2d' @@ -556,9 +555,8 @@ def runBreakpadDumpSyms = { buildType -> def objDir = new File("${appDir}/build/intermediates/cmake/${buildType}/obj/arm64-v8a") def stripDebugSymbol = "${appDir}/build/intermediates/transforms/stripDebugSymbol/${buildType}/0/lib/arm64-v8a/" - def outputDir = new File("${appDir}/build/tmp/breakpadDumpSyms/${buildType}") - if (!outputDir.exists()) { - outputDir.mkdirs() + if (!breakpadDumpSymsDir.exists()) { + breakpadDumpSymsDir.mkdirs() } objDir.eachFileRecurse (FileType.FILES) { file -> @@ -568,43 +566,18 @@ def runBreakpadDumpSyms = { buildType -> file.toString(), stripDebugSymbol ] + println ("Running dump_syms with arguments " + cmdArgs) def result = exec { workingDir HIFI_ANDROID_PRECOMPILED + '/breakpad/bin' commandLine './dump_syms' args cmdArgs ignoreExitValue true - standardOutput = new BufferedOutputStream(new FileOutputStream(new File(outputDir, output))) + standardOutput = new BufferedOutputStream(new FileOutputStream(new File(breakpadDumpSymsDir, output))) } } } } -def uploadDumpSyms = { buildType -> - def tmpDir = "${appDir}/build/tmp/breakpadDumpSyms/${buildType}/" - def zipFilename = "symbols-${RELEASE_NUMBER}.zip" - def zipDir = "${appDir}/build/tmp/breakpadDumpSyms/" - Zip { - from tmpDir - include '*/*' - archiveName zipFilename - destinationDir(file(zipDir)) - } - - httpTask { - config { - request.uri = 'https://gcalero998.sp.backtrace.io:6098/post?format=symbols&token=d65d0d184789ac40c121952001fd91dfba7e149899b1eeccd68ccffe91dd2fd0' - } - post { - request.uri.path = '/notify' - request.body = new File(zipDir, zipFilename).bytes - response.success { - println 'Symbols upload successful' - } - } - } - -} - task runBreakpadDumpSymsRelease() { doLast { runBreakpadDumpSyms("release"); @@ -617,18 +590,31 @@ task runBreakpadDumpSymsDebug() { } } -task uploadBreakpadDumpSymsRelease(dependsOn: runBreakpadDumpSymsRelease) { +task zipDumpSymsDebug(type: Zip, dependsOn: runBreakpadDumpSymsDebug) { + doFirst { + println ("Zipping " + breakpadDumpSymsDir.absolutePath + " into " + breakpadDumpSymsDir) + } + from (breakpadDumpSymsDir.absolutePath) + archiveName "symbols-${RELEASE_NUMBER}.zip" + destinationDir(breakpadDumpSymsDir) doLast { - uploadDumpSyms("release") + println ("Zipped " + breakpadDumpSymsDir.absolutePath + " into " + breakpadDumpSymsDir) } } -task uploadBreakpadDumpSymsDebug(dependsOn: runBreakpadDumpSymsDebug) { +task uploadBreakpadDumpSymsRelease(dependsOn: runBreakpadDumpSymsRelease) { doLast { - uploadDumpSyms("debug") + //uploadDumpSyms("release") } } + +task uploadBreakpadDumpSymsDebug(dependsOn: zipDumpSymsDebug) { + def p = ['curl', '--data-binary', "@"+new File(breakpadDumpSymsDir, "symbols-${RELEASE_NUMBER}.zip").absolutePath, "\"https://gcalero998.sp.backtrace.io:6098/post?format=symbols&token=d65d0d184789ac40c121952001fd91dfba7e149899b1eeccd68ccffe91dd2fd0\""].execute() +} + + + // FIXME this code is prototyping the desired functionality for doing build time binary dependency resolution. // See the comment on the qtBundle task above /* From f8511c52331be6893eeb581cbc01d48f88774466 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Tue, 19 Jun 2018 21:38:17 -0300 Subject: [PATCH 20/32] Debugging gradle script --- android/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 80439b1e5b..2b5fe2a384 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -596,7 +596,7 @@ task zipDumpSymsDebug(type: Zip, dependsOn: runBreakpadDumpSymsDebug) { } from (breakpadDumpSymsDir.absolutePath) archiveName "symbols-${RELEASE_NUMBER}.zip" - destinationDir(breakpadDumpSymsDir) + destinationDir(new File("${appDir}/build/tmp/")) doLast { println ("Zipped " + breakpadDumpSymsDir.absolutePath + " into " + breakpadDumpSymsDir) } @@ -610,7 +610,7 @@ task uploadBreakpadDumpSymsRelease(dependsOn: runBreakpadDumpSymsRelease) { task uploadBreakpadDumpSymsDebug(dependsOn: zipDumpSymsDebug) { - def p = ['curl', '--data-binary', "@"+new File(breakpadDumpSymsDir, "symbols-${RELEASE_NUMBER}.zip").absolutePath, "\"https://gcalero998.sp.backtrace.io:6098/post?format=symbols&token=d65d0d184789ac40c121952001fd91dfba7e149899b1eeccd68ccffe91dd2fd0\""].execute() + def p = ['curl', '--data-binary', "@"+new File("${appDir}/build/tmp/", "symbols-${RELEASE_NUMBER}.zip").absolutePath, "\"https://gcalero998.sp.backtrace.io:6098/post?format=symbols&token=d65d0d184789ac40c121952001fd91dfba7e149899b1eeccd68ccffe91dd2fd0\""].execute() } From 464f8e128ae38cbe5ef5421738079fb35a2db26e Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Tue, 19 Jun 2018 22:08:27 -0300 Subject: [PATCH 21/32] Debugging gradle script --- android/build.gradle | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 2b5fe2a384..2cd49d6a78 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -610,7 +610,15 @@ task uploadBreakpadDumpSymsRelease(dependsOn: runBreakpadDumpSymsRelease) { task uploadBreakpadDumpSymsDebug(dependsOn: zipDumpSymsDebug) { - def p = ['curl', '--data-binary', "@"+new File("${appDir}/build/tmp/", "symbols-${RELEASE_NUMBER}.zip").absolutePath, "\"https://gcalero998.sp.backtrace.io:6098/post?format=symbols&token=d65d0d184789ac40c121952001fd91dfba7e149899b1eeccd68ccffe91dd2fd0\""].execute() + doLast { + def p = ['curl', '--data-binary', "@"+new File("${appDir}/build/tmp/", "symbols-${RELEASE_NUMBER}.zip").absolutePath, "\"https://gcalero998.sp.backtrace.io:6098/post?format=symbols&token=d65d0d184789ac40c121952001fd91dfba7e149899b1eeccd68ccffe91dd2fd0\""].execute() + p.waitFor() + if (p.exitValue() != 0) { + println "Upload breakpad symbols: curl exited with status " + p.exitValue() + println p.getErrorStream().text + } + + } } From ac533a391346554d9a47c9ecc5012c0512711de4 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Tue, 19 Jun 2018 23:13:09 -0300 Subject: [PATCH 22/32] Debugging gradle script --- android/build.gradle | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 2cd49d6a78..358335de89 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,6 +21,7 @@ buildscript { plugins { id 'de.undercouch.download' version '3.3.0' id "cz.malohlava" version "1.0.3" + id "io.github.http-builder-ng.http-plugin" version "0.1.1" } allprojects { @@ -608,14 +609,17 @@ task uploadBreakpadDumpSymsRelease(dependsOn: runBreakpadDumpSymsRelease) { } } - -task uploadBreakpadDumpSymsDebug(dependsOn: zipDumpSymsDebug) { - doLast { - def p = ['curl', '--data-binary', "@"+new File("${appDir}/build/tmp/", "symbols-${RELEASE_NUMBER}.zip").absolutePath, "\"https://gcalero998.sp.backtrace.io:6098/post?format=symbols&token=d65d0d184789ac40c121952001fd91dfba7e149899b1eeccd68ccffe91dd2fd0\""].execute() - p.waitFor() - if (p.exitValue() != 0) { - println "Upload breakpad symbols: curl exited with status " + p.exitValue() - println p.getErrorStream().text +task uploadBreakpadDumpSymsDebug(type:io.github.httpbuilderng.http.HttpTask, dependsOn: zipDumpSymsDebug) { + config { + request.uri = 'https://gcalero998.sp.backtrace.io:6098' + } + post { + request.uri.path = '/post' + request.uri.query = [format: 'symbols', token: 'd65d0d184789ac40c121952001fd91dfba7e149899b1eeccd68ccffe91dd2fd0'] + request.body = new File("${appDir}/build/tmp/", "symbols-${RELEASE_NUMBER}.zip").bytes + request.contentType = 'application/octet-stream' + response.success { + println ("${appDir}/build/tmp/symbols-${RELEASE_NUMBER}.zip uploaded") } } From 730e14c9d9e41f5118999b825f1a5d9e099f9c65 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Wed, 20 Jun 2018 10:35:16 -0300 Subject: [PATCH 23/32] Debugging gradle script --- android/app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index e67c5c89d7..42d8a9680f 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -48,8 +48,8 @@ android { buildTypes { debug { - buildConfigField "String", "BACKTRACE_URL", "\"" + (System.getenv("CMAKE_BACKTRACE_URL") ? System.getenv("CMAKE_BACKTRACE_URL") : '') + "\"" - buildConfigField "String", "BACKTRACE_TOKEN", "\"" + (System.getenv("CMAKE_BACKTRACE_TOKEN") ? System.getenv("CMAKE_BACKTRACE_TOKEN") : '') + "\"" + buildConfigField "String", "BACKTRACE_URL", "\"https://gcalero999.sp.backtrace.io:6098\"" + buildConfigField "String", "BACKTRACE_TOKEN", "\"4ff1f957cd6c357e6e5d5b2fe076f9ca46379a19b7d6baea1707cefb70e7ed15\"" } release { minifyEnabled false From d5e2362ee260bd095435935df8f1c4a384f472e1 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Wed, 20 Jun 2018 11:32:03 -0300 Subject: [PATCH 24/32] Clean up and complete gradle script --- android/app/build.gradle | 6 ++-- android/build.gradle | 68 +++++++++++++++++++++++----------------- 2 files changed, 42 insertions(+), 32 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 42d8a9680f..3537df033d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -48,8 +48,8 @@ android { buildTypes { debug { - buildConfigField "String", "BACKTRACE_URL", "\"https://gcalero999.sp.backtrace.io:6098\"" - buildConfigField "String", "BACKTRACE_TOKEN", "\"4ff1f957cd6c357e6e5d5b2fe076f9ca46379a19b7d6baea1707cefb70e7ed15\"" + buildConfigField "String", "BACKTRACE_URL", "\"" + (System.getenv("CMAKE_BACKTRACE_URL") ? System.getenv("CMAKE_BACKTRACE_URL") : '') + "\"" + buildConfigField "String", "BACKTRACE_TOKEN", "\"" + (System.getenv("CMAKE_BACKTRACE_TOKEN") ? System.getenv("CMAKE_BACKTRACE_TOKEN") : '') + "\"" } release { minifyEnabled false @@ -76,9 +76,7 @@ android { variant.mergeResources.dependsOn(task) def uploadDumpSymsTask = rootProject.getTasksByName("uploadBreakpadDumpSyms${variant.name.capitalize()}", false).first() def runDumpSymsTask = rootProject.getTasksByName("runBreakpadDumpSyms${variant.name.capitalize()}", false).first() - println (runDumpSymsTask.name + " dependsOn " + task.name) runDumpSymsTask.dependsOn(task) - println (variant.assemble.name + " dependsOn " + uploadDumpSymsTask.name) variant.assemble.dependsOn(uploadDumpSymsTask) } diff --git a/android/build.gradle b/android/build.gradle index 358335de89..373569ca77 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -556,8 +556,9 @@ def runBreakpadDumpSyms = { buildType -> def objDir = new File("${appDir}/build/intermediates/cmake/${buildType}/obj/arm64-v8a") def stripDebugSymbol = "${appDir}/build/intermediates/transforms/stripDebugSymbol/${buildType}/0/lib/arm64-v8a/" - if (!breakpadDumpSymsDir.exists()) { - breakpadDumpSymsDir.mkdirs() + def outputDir = new File(breakpadDumpSymsDir, buildType) + if (!outputDir.exists()) { + outputDir.mkdirs() } objDir.eachFileRecurse (FileType.FILES) { file -> @@ -567,65 +568,76 @@ def runBreakpadDumpSyms = { buildType -> file.toString(), stripDebugSymbol ] - println ("Running dump_syms with arguments " + cmdArgs) def result = exec { workingDir HIFI_ANDROID_PRECOMPILED + '/breakpad/bin' commandLine './dump_syms' args cmdArgs ignoreExitValue true - standardOutput = new BufferedOutputStream(new FileOutputStream(new File(breakpadDumpSymsDir, output))) + standardOutput = new BufferedOutputStream(new FileOutputStream(new File(outputDir, output))) } } } } -task runBreakpadDumpSymsRelease() { - doLast { - runBreakpadDumpSyms("release"); - } -} - task runBreakpadDumpSymsDebug() { doLast { runBreakpadDumpSyms("debug"); } } -task zipDumpSymsDebug(type: Zip, dependsOn: runBreakpadDumpSymsDebug) { - doFirst { - println ("Zipping " + breakpadDumpSymsDir.absolutePath + " into " + breakpadDumpSymsDir) - } - from (breakpadDumpSymsDir.absolutePath) - archiveName "symbols-${RELEASE_NUMBER}.zip" - destinationDir(new File("${appDir}/build/tmp/")) +task runBreakpadDumpSymsRelease() { doLast { - println ("Zipped " + breakpadDumpSymsDir.absolutePath + " into " + breakpadDumpSymsDir) + runBreakpadDumpSyms("release"); } } -task uploadBreakpadDumpSymsRelease(dependsOn: runBreakpadDumpSymsRelease) { - doLast { - //uploadDumpSyms("release") - } +task zipDumpSymsDebug(type: Zip, dependsOn: runBreakpadDumpSymsDebug) { + from (new File(breakpadDumpSymsDir, "debug").absolutePath) + archiveName "symbols-${RELEASE_NUMBER}-debug.zip" + destinationDir(new File("${appDir}/build/tmp/")) +} + +task zipDumpSymsRelease(type: Zip, dependsOn: runBreakpadDumpSymsRelease) { + from (new File(breakpadDumpSymsDir, "release").absolutePath) + archiveName "symbols-${RELEASE_NUMBER}-release.zip" + destinationDir(new File("${appDir}/build/tmp/")) } task uploadBreakpadDumpSymsDebug(type:io.github.httpbuilderng.http.HttpTask, dependsOn: zipDumpSymsDebug) { + onlyIf { + System.getenv("CMAKE_BACKTRACE_URL") && System.getenv("CMAKE_BACKTRACE_SYMBOLS_TOKEN") + } config { - request.uri = 'https://gcalero998.sp.backtrace.io:6098' + request.uri = System.getenv("CMAKE_BACKTRACE_URL") } post { request.uri.path = '/post' - request.uri.query = [format: 'symbols', token: 'd65d0d184789ac40c121952001fd91dfba7e149899b1eeccd68ccffe91dd2fd0'] - request.body = new File("${appDir}/build/tmp/", "symbols-${RELEASE_NUMBER}.zip").bytes + request.uri.query = [format: 'symbols', token: System.getenv("CMAKE_BACKTRACE_SYMBOLS_TOKEN")] + request.body = new File("${appDir}/build/tmp/", "symbols-${RELEASE_NUMBER}-debug.zip").bytes request.contentType = 'application/octet-stream' response.success { - println ("${appDir}/build/tmp/symbols-${RELEASE_NUMBER}.zip uploaded") + println ("${appDir}/build/tmp/symbols-${RELEASE_NUMBER}-debug.zip uploaded") } - } } - +task uploadBreakpadDumpSymsRelease(type:io.github.httpbuilderng.http.HttpTask, dependsOn: zipDumpSymsRelease) { + onlyIf { + System.getenv("CMAKE_BACKTRACE_URL") && System.getenv("CMAKE_BACKTRACE_SYMBOLS_TOKEN") + } + config { + request.uri = System.getenv("CMAKE_BACKTRACE_URL") + } + post { + request.uri.path = '/post' + request.uri.query = [format: 'symbols', token: System.getenv("CMAKE_BACKTRACE_SYMBOLS_TOKEN")] + request.body = new File("${appDir}/build/tmp/", "symbols-${RELEASE_NUMBER}-release.zip").bytes + request.contentType = 'application/octet-stream' + response.success { + println ("${appDir}/build/tmp/symbols-${RELEASE_NUMBER}-release.zip uploaded") + } + } +} // FIXME this code is prototyping the desired functionality for doing build time binary dependency resolution. // See the comment on the qtBundle task above From 4af0815561f68e482c16f10bfdab6796df070fd0 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Wed, 20 Jun 2018 18:14:06 -0300 Subject: [PATCH 25/32] Add missing annotations to breakpad (version, build_number, build_type) --- interface/src/CrashHandler_Breakpad.cpp | 27 ++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/interface/src/CrashHandler_Breakpad.cpp b/interface/src/CrashHandler_Breakpad.cpp index fe4979853e..f2a174b6ea 100644 --- a/interface/src/CrashHandler_Breakpad.cpp +++ b/interface/src/CrashHandler_Breakpad.cpp @@ -24,6 +24,7 @@ #include #include +#include google_breakpad::ExceptionHandler* gBreakpadHandler; @@ -43,7 +44,23 @@ QString obbDir() { return dataAbsPath; } +void flushAnnotations() { + QSettings settings(obbDir() + "/annotations.json", JSON_FORMAT); + settings.clear(); + settings.beginGroup("Annotations"); + for (auto k : annotations.keys()) { + settings.setValue(k, annotations.value(k)); + } + settings.endGroup(); + settings.sync(); +} + bool startCrashHandler() { + annotations["version"] = BuildInfo::VERSION; + annotations["build_number"] = BuildInfo::BUILD_NUMBER; + annotations["build_type"] = BuildInfo::BUILD_TYPE_STRING; + + flushAnnotations(); gBreakpadHandler = new google_breakpad::ExceptionHandler( google_breakpad::MinidumpDescriptor(obbDir().toStdString()), @@ -56,15 +73,7 @@ void setCrashAnnotation(std::string name, std::string value) { QString qName = QString::fromStdString(name); QString qValue = QString::fromStdString(value); annotations[qName] = qValue; - - QSettings settings(obbDir() + "/annotations.json", JSON_FORMAT); - settings.clear(); - settings.beginGroup("Annotations"); - for (auto k : annotations.keys()) { - settings.setValue(k, annotations.value(k)); - } - settings.endGroup(); - settings.sync(); + flushAnnotations(); } #endif From 80adad7965101f2ac5148e7c5529728f54e99067 Mon Sep 17 00:00:00 2001 From: David Back Date: Fri, 22 Jun 2018 13:52:43 -0700 Subject: [PATCH 26/32] myAvatar constant --- scripts/system/libraries/entitySelectionTool.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/system/libraries/entitySelectionTool.js b/scripts/system/libraries/entitySelectionTool.js index 8b1c50b129..a5a28fb206 100644 --- a/scripts/system/libraries/entitySelectionTool.js +++ b/scripts/system/libraries/entitySelectionTool.js @@ -2028,8 +2028,9 @@ SelectionDisplay = (function() { Overlays.editOverlay(scaleHandle, { color: COLOR_SCALE_CUBE_SELECTED }); } - if (properties.collidesWith.indexOf("myAvatar") > -1) { - var newCollidesWith = properties.collidesWith.replace("myAvatar", ""); + var collisionToRemove = "myAvatar"; + if (properties.collidesWith.indexOf(collisionToRemove) > -1) { + var newCollidesWith = properties.collidesWith.replace(collisionToRemove, ""); Entities.editEntity(SelectionManager.selections[0], {collidesWith: newCollidesWith}); that.replaceCollisionsAfterStretch = true; } From 25f22326a845040870a2d3c0ef6d616134b43748 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Fri, 22 Jun 2018 15:43:16 -0700 Subject: [PATCH 27/32] Fix MS16074, MS16076: Fix links to Go To BankOfHighFidelity --- .../qml/hifi/commerce/wallet/Help.qml | 6 +- .../qml/hifi/commerce/wallet/WalletHome.qml | 116 +++++++++--------- 2 files changed, 63 insertions(+), 59 deletions(-) diff --git a/interface/resources/qml/hifi/commerce/wallet/Help.qml b/interface/resources/qml/hifi/commerce/wallet/Help.qml index d76fe0d8a2..b453509712 100644 --- a/interface/resources/qml/hifi/commerce/wallet/Help.qml +++ b/interface/resources/qml/hifi/commerce/wallet/Help.qml @@ -253,7 +253,11 @@ At the moment, there is currently no way to convert HFC to other currencies. Sta } else if (link === "#blockchain") { Qt.openUrlExternally("https://docs.highfidelity.com/high-fidelity-commerce"); } else if (link === "#bank") { - Qt.openUrlExternally("hifi://BankOfHighFidelity"); + if ((Account.metaverseServerURL).toString().indexOf("staging") >= 0) { + Qt.openUrlExternally("hifi://hifiqa-master-metaverse-staging"); // So that we can test in staging. + } else { + Qt.openUrlExternally("hifi://BankOfHighFidelity"); + } } else if (link === "#support") { Qt.openUrlExternally("mailto:support@highfidelity.com"); } diff --git a/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml b/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml index 2a6ddfddfb..dcd1ab993b 100644 --- a/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml +++ b/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml @@ -252,64 +252,6 @@ Item { anchors.bottom: parent.bottom; anchors.left: parent.left; anchors.right: parent.right; - - Item { - // On empty history. We don't want to flash and then replace, so don't show until we know we should. - // The history is empty when it contains 1 item (the pending item count) AND there are no pending items. - visible: transactionHistoryModel.count === 1 && - transactionHistoryModel.retrievedAtLeastOnePage && - transactionHistoryModel.get(0).count === 0; - anchors.centerIn: parent; - width: parent.width - 12; - height: parent.height; - - HifiControlsUit.Separator { - colorScheme: 1; - anchors.left: parent.left; - anchors.right: parent.right; - anchors.top: parent.top; - } - - RalewayRegular { - id: noActivityText; - text: "Congrats! Your wallet is all set!

" + - "Where's my HFC?
" + - "High Fidelity commerce is in open beta right now. Want more HFC? Get it by meeting with a banker at " + - "BankOfHighFidelity!" - // Text size - size: 22; - // Style - color: hifi.colors.blueAccent; - anchors.top: parent.top; - anchors.topMargin: 36; - anchors.left: parent.left; - anchors.leftMargin: 12; - anchors.right: parent.right; - anchors.rightMargin: 12; - height: paintedHeight; - wrapMode: Text.WordWrap; - horizontalAlignment: Text.AlignHCenter; - - onLinkActivated: { - sendSignalToWallet({ method: "transactionHistory_goToBank" }); - } - } - - HifiControlsUit.Button { - id: bankButton; - color: hifi.buttons.blue; - colorScheme: hifi.colorSchemes.dark; - anchors.top: noActivityText.bottom; - anchors.topMargin: 30; - anchors.horizontalCenter: parent.horizontalCenter; - width: parent.width/2; - height: 50; - text: "VISIT BANK OF HIGH FIDELITY"; - onClicked: { - sendSignalToWallet({ method: "transactionHistory_goToBank" }); - } - } - } ListView { id: transactionHistory; @@ -411,6 +353,64 @@ Item { } } } + + Item { + // On empty history. We don't want to flash and then replace, so don't show until we know we should. + // The history is empty when it contains 1 item (the pending item count) AND there are no pending items. + visible: transactionHistoryModel.count === 1 && + transactionHistoryModel.retrievedAtLeastOnePage && + transactionHistoryModel.get(0).count === 0; + anchors.centerIn: parent; + width: parent.width - 12; + height: parent.height; + + HifiControlsUit.Separator { + colorScheme: 1; + anchors.left: parent.left; + anchors.right: parent.right; + anchors.top: parent.top; + } + + RalewayRegular { + id: noActivityText; + text: "Congrats! Your wallet is all set!

" + + "Where's my HFC?
" + + "High Fidelity commerce is in open beta right now. Want more HFC? Get it by meeting with a banker at " + + "BankOfHighFidelity!" + // Text size + size: 22; + // Style + color: hifi.colors.blueAccent; + anchors.top: parent.top; + anchors.topMargin: 36; + anchors.left: parent.left; + anchors.leftMargin: 12; + anchors.right: parent.right; + anchors.rightMargin: 12; + height: paintedHeight; + wrapMode: Text.WordWrap; + horizontalAlignment: Text.AlignHCenter; + + onLinkActivated: { + sendSignalToWallet({ method: "transactionHistory_goToBank" }); + } + } + + HifiControlsUit.Button { + id: bankButton; + color: hifi.buttons.blue; + colorScheme: hifi.colorSchemes.dark; + anchors.top: noActivityText.bottom; + anchors.topMargin: 30; + anchors.horizontalCenter: parent.horizontalCenter; + width: parent.width/2; + height: 50; + text: "VISIT BANK OF HIGH FIDELITY"; + onClicked: { + sendSignalToWallet({ method: "transactionHistory_goToBank" }); + } + } + } } } From 6fce6431a31fe1aba1f41f4452cda59a9fc6ce46 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Fri, 22 Jun 2018 16:09:49 -0700 Subject: [PATCH 28/32] Fix MS16088: Prevent long usernames from overlapping HFC logo in Wallet Home --- interface/resources/qml/hifi/commerce/wallet/WalletHome.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml b/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml index 2a6ddfddfb..354673a3c2 100644 --- a/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml +++ b/interface/resources/qml/hifi/commerce/wallet/WalletHome.qml @@ -76,7 +76,7 @@ Item { anchors.top: parent.top; anchors.left: parent.left; anchors.leftMargin: 20; - width: parent.width/2; + width: parent.width/2 - anchors.leftMargin; height: 80; } From 5e2a08b3c2f503a8e115a5a7b8f0bbf0b828d01e Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 25 Jun 2018 10:36:36 -0700 Subject: [PATCH 29/32] handle deactivation of avatar entities differently --- .../physics/src/PhysicalEntitySimulation.cpp | 21 ++++++++++++++++--- .../physics/src/PhysicalEntitySimulation.h | 8 +++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/libraries/physics/src/PhysicalEntitySimulation.cpp b/libraries/physics/src/PhysicalEntitySimulation.cpp index 4d31067c20..b990d3612b 100644 --- a/libraries/physics/src/PhysicalEntitySimulation.cpp +++ b/libraries/physics/src/PhysicalEntitySimulation.cpp @@ -312,11 +312,26 @@ void PhysicalEntitySimulation::handleDeactivatedMotionStates(const VectorOfMotio assert(state); if (state->getType() == MOTIONSTATE_TYPE_ENTITY) { EntityMotionState* entityState = static_cast(state); - if (!serverlessMode) { - entityState->handleDeactivation(); - } EntityItemPointer entity = entityState->getEntity(); _entitiesToSort.insert(entity); + if (!serverlessMode) { + if (entity->getClientOnly()) { + switch (entityState->getOwnershipState()) { + case EntityMotionState::OwnershipState::PendingBid: + _bids.removeFirst(entityState); + entityState->clearOwnershipState(); + break; + case EntityMotionState::OwnershipState::LocallyOwned: + _owned.removeFirst(entityState); + entityState->clearOwnershipState(); + break; + default: + break; + } + } else { + entityState->handleDeactivation(); + } + } } } } diff --git a/libraries/physics/src/PhysicalEntitySimulation.h b/libraries/physics/src/PhysicalEntitySimulation.h index 3f04347f18..fdf996df25 100644 --- a/libraries/physics/src/PhysicalEntitySimulation.h +++ b/libraries/physics/src/PhysicalEntitySimulation.h @@ -37,6 +37,14 @@ public: } pop_back(); } + void removeFirst(EntityMotionState* state) { + for (uint32_t i = 0; i < size(); ++i) { + if ((*this)[i] == state) { + remove(i); + break; + } + } + } }; class PhysicalEntitySimulation : public EntitySimulation { From 756f34761fd8e3adb807daecbe672a89d663d4c5 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 25 Jun 2018 10:37:12 -0700 Subject: [PATCH 30/32] don't build AvatarMotionStates until physics enabled --- interface/src/avatar/AvatarManager.cpp | 3 ++- interface/src/avatar/AvatarMotionState.cpp | 4 ++++ interface/src/avatar/AvatarMotionState.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index 4d133706e6..c63095a204 100644 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -186,6 +186,7 @@ void AvatarManager::updateOtherAvatars(float deltaTime) { uint64_t updateExpiry = startTime + UPDATE_BUDGET; int numAvatarsUpdated = 0; int numAVatarsNotUpdated = 0; + bool physicsEnabled = qApp->isPhysicsEnabled(); render::Transaction transaction; while (!sortedAvatars.empty()) { @@ -202,7 +203,7 @@ void AvatarManager::updateOtherAvatars(float deltaTime) { if (_shouldRender) { avatar->ensureInScene(avatar, qApp->getMain3DScene()); } - if (!avatar->isInPhysicsSimulation()) { + if (physicsEnabled && !avatar->isInPhysicsSimulation()) { ShapeInfo shapeInfo; avatar->computeShapeInfo(shapeInfo); btCollisionShape* shape = const_cast(ObjectMotionState::getShapeManager()->getShape(shapeInfo)); diff --git a/interface/src/avatar/AvatarMotionState.cpp b/interface/src/avatar/AvatarMotionState.cpp index 6fc1bd8196..50c715b14a 100644 --- a/interface/src/avatar/AvatarMotionState.cpp +++ b/interface/src/avatar/AvatarMotionState.cpp @@ -154,6 +154,10 @@ const QUuid AvatarMotionState::getObjectID() const { return _avatar->getSessionUUID(); } +QString AvatarMotionState::getName() const { + return _avatar->getName(); +} + // virtual QUuid AvatarMotionState::getSimulatorID() const { return _avatar->getSessionUUID(); diff --git a/interface/src/avatar/AvatarMotionState.h b/interface/src/avatar/AvatarMotionState.h index 2738aba8ee..9228641b25 100644 --- a/interface/src/avatar/AvatarMotionState.h +++ b/interface/src/avatar/AvatarMotionState.h @@ -59,6 +59,7 @@ public: virtual const QUuid getObjectID() const override; + virtual QString getName() const override; virtual QUuid getSimulatorID() const override; void setBoundingBox(const glm::vec3& corner, const glm::vec3& diagonal); From 43cba68cd25f1f1599619a90efc53b6aeb56f88d Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Mon, 25 Jun 2018 13:40:45 -0700 Subject: [PATCH 31/32] test wearables for wear before gifting and wearing --- .../resources/qml/hifi/commerce/purchases/PurchasedItem.qml | 1 + interface/resources/qml/hifi/commerce/purchases/Purchases.qml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml b/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml index b43372da5c..9f1d307f0e 100644 --- a/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml +++ b/interface/resources/qml/hifi/commerce/purchases/PurchasedItem.qml @@ -646,6 +646,7 @@ Item { height: 40; enabled: root.hasPermissionToRezThis && MyAvatar.skeletonModelURL !== root.itemHref && + !root.wornEntityID && root.valid; onHoveredChanged: { diff --git a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml index 0d2acf4ec3..8a5b1fb0e7 100644 --- a/interface/resources/qml/hifi/commerce/purchases/Purchases.qml +++ b/interface/resources/qml/hifi/commerce/purchases/Purchases.qml @@ -957,7 +957,7 @@ Rectangle { function updateCurrentlyWornWearables(wearables) { for (var i = 0; i < purchasesModel.count; i++) { for (var j = 0; j < wearables.length; j++) { - if (purchasesModel.get(i).itemType === "wearable" && + if (purchasesModel.get(i).item_type === "wearable" && wearables[j].entityCertID === purchasesModel.get(i).certificate_id && wearables[j].entityEdition.toString() === purchasesModel.get(i).edition_number) { purchasesModel.setProperty(i, 'wornEntityID', wearables[j].entityID); From ea2c1298e5b228641cbb1e24fb2a18919d04c27e Mon Sep 17 00:00:00 2001 From: Gabriel Date: Mon, 25 Jun 2018 19:13:47 -0300 Subject: [PATCH 32/32] Remove crash added with testing purposes only --- scripts/system/+android/audio.js | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/system/+android/audio.js b/scripts/system/+android/audio.js index 50919ed5d1..34dd52604a 100644 --- a/scripts/system/+android/audio.js +++ b/scripts/system/+android/audio.js @@ -46,7 +46,6 @@ function init() { function onMuteClicked() { Audio.muted = !Audio.muted; - Menu.triggerOption("Out of Bounds Vector Access"); } function onMutePressed() {