From 4ce942b0f2ec13801d01a819609df0c35390ec63 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Wed, 19 Sep 2018 13:00:56 -0700 Subject: [PATCH 01/81] updating spawn location/floor in redirect --- interface/resources/serverless/redirect.json | 52 +++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/interface/resources/serverless/redirect.json b/interface/resources/serverless/redirect.json index 64cb4d8a3f..97cd75c8cd 100644 --- a/interface/resources/serverless/redirect.json +++ b/interface/resources/serverless/redirect.json @@ -2,7 +2,7 @@ "DataVersion": 0, "Paths": { - "/": "/4,1.4,4/0,0.49544,0,0.868645" + "/": "/5.77,1.4,4.96/0,0.49544,0,0.868645" }, "Entities": [ { @@ -96,6 +96,53 @@ "userData": "{\"grabbableKey\":{\"grabbable\":false}}", "visible": false }, + { + "clientOnly": false, + "color": { + "blue": 0, + "green": 0, + "red": 0 + }, + "created": "2018-09-05T00:40:03Z", + "dimensions": { + "blue": 6.9401350021362305, + "green": 0.04553089290857315, + "red": 7.004304885864258, + "x": 7.004304885864258, + "y": 0.04553089290857315, + "z": 6.9401350021362305 + }, + "id": "{33440bf8-f9ce-4d52-9b29-1b321e226982}", + "lastEdited": 1536107948774796, + "lastEditedBy": "{4eecd88f-ef9b-4a83-bb9a-7f7496209c6b}", + "locked": true, + "modelURL": "http://hifi-content.s3.amazonaws.com/alexia/LoadingScreens/floor.fbx", + "name": "floorModel", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "blue": 3.6175529956817627, + "green": 0, + "red": 4.102385997772217, + "x": 4.102385997772217, + "y": 0, + "z": 3.6175529956817627 + }, + "queryAACube": { + "scale": 9.860417366027832, + "x": -0.8278226852416992, + "y": -4.930208683013916, + "z": -1.3126556873321533 + }, + "rotation": { + "w": 0.8660253882408142, + "x": -1.5922749298624694e-05, + "y": 0.5, + "z": -4.572480611386709e-05 + }, + "shapeType": "simple-hull", + "type": "Model", + "userData": "{\"grabbableKey\":{\"grabbable\":false}}" + }, { "clientOnly": false, "color": { @@ -140,7 +187,8 @@ }, "shape": "Cube", "type": "Box", - "userData": "{\"grabbableKey\":{\"grabbable\":false}}" + "userData": "{\"grabbableKey\":{\"grabbable\":false}}", + "visible": false }, { "clientOnly": false, From d3368146ce1a34f11b2eb48d27820f5931979970 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 21 Sep 2018 11:42:26 -0700 Subject: [PATCH 02/81] saving work --- interface/src/Application.cpp | 106 ++++++------------ interface/src/Application.h | 8 +- interface/src/octree/SafeLanding.cpp | 4 + .../utilities/render/textureMonitor.qml | 2 +- scripts/system/interstitialPage.js | 46 +++++++- 5 files changed, 84 insertions(+), 82 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 46cebc1661..0947a85a17 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -122,6 +122,7 @@ #include #include #include +#include #include #include #include @@ -5346,8 +5347,8 @@ void Application::resetPhysicsReadyInformation() { // collision information of nearby entities to make running bullet be safe. _fullSceneReceivedCounter = 0; _fullSceneCounterAtLastPhysicsCheck = 0; - _nearbyEntitiesCountAtLastPhysicsCheck = 0; - _nearbyEntitiesStabilityCount = 0; + _gpuTextureMemSizeStabilityCount = 0; + _gpuTextureMemSizeAtLastCheck = 0; _physicsEnabled = false; _octreeProcessor.startEntitySequence(); } @@ -5586,18 +5587,20 @@ void Application::update(float deltaTime) { // for nearby entities before starting bullet up. quint64 now = usecTimestampNow(); if (isServerlessMode() || _octreeProcessor.isLoadSequenceComplete()) { - // we've received a new full-scene octree stats packet, or it's been long enough to try again anyway - _lastPhysicsCheckTime = now; - _fullSceneCounterAtLastPhysicsCheck = _fullSceneReceivedCounter; - _lastQueriedViews.clear(); // Force new view. + if (gpuTextureMemSizeStable()) { + // we've received a new full-scene octree stats packet, or it's been long enough to try again anyway + _lastPhysicsCheckTime = now; + _fullSceneCounterAtLastPhysicsCheck = _fullSceneReceivedCounter; + _lastQueriedViews.clear(); // Force new view. - // process octree stats packets are sent in between full sends of a scene (this isn't currently true). - // We keep physics disabled until we've received a full scene and everything near the avatar in that - // scene is ready to compute its collision shape. - if (getMyAvatar()->isReadyForPhysics()) { - _physicsEnabled = true; - setIsInterstitialMode(false); - getMyAvatar()->updateMotionBehaviorFromMenu(); + // process octree stats packets are sent in between full sends of a scene (this isn't currently true). + // We keep physics disabled until we've received a full scene and everything near the avatar in that + // scene is ready to compute its collision shape. + if (getMyAvatar()->isReadyForPhysics()) { + _physicsEnabled = true; + setIsInterstitialMode(false); + getMyAvatar()->updateMotionBehaviorFromMenu(); + } } } } else if (domainLoadingInProgress) { @@ -6234,9 +6237,14 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType) { const bool isModifiedQuery = !_physicsEnabled; if (isModifiedQuery) { // Create modified view that is a simple sphere. + ConicalViewFrustum sphericalView; + ConicalViewFrustum farView; + + farView.set(_viewFrustum); + sphericalView.setSimpleRadius(INITIAL_QUERY_RADIUS); - _octreeQuery.setConicalViews({ sphericalView }); + _octreeQuery.setConicalViews({ sphericalView, farView }); _octreeQuery.setOctreeSizeScale(DEFAULT_OCTREE_SIZE_SCALE); static constexpr float MIN_LOD_ADJUST = -20.0f; _octreeQuery.setBoundaryLevelAdjust(MIN_LOD_ADJUST); @@ -6548,69 +6556,23 @@ void Application::trackIncomingOctreePacket(ReceivedMessage& message, SharedNode } } -bool Application::nearbyEntitiesAreReadyForPhysics() { - // this is used to avoid the following scenario: - // A table has some items sitting on top of it. The items are at rest, meaning they aren't active in bullet. - // Someone logs in close to the table. They receive information about the items on the table before they - // receive information about the table. The items are very close to the avatar's capsule, so they become - // activated in bullet. This causes them to fall to the floor, because the table's shape isn't yet in bullet. - EntityTreePointer entityTree = getEntities()->getTree(); - if (!entityTree) { - return false; - } +bool Application::gpuTextureMemSizeStable() { + auto renderConfig = qApp->getRenderEngine()->getConfiguration(); + auto renderStats = renderConfig->getConfig("Stats"); - // We don't want to use EntityTree::findEntities(AABox, ...) method because that scan will snarf parented entities - // whose bounding boxes cannot be computed (it is too loose for our purposes here). Instead we manufacture - // custom filters and use the general-purpose EntityTree::findEntities(filter, ...) - QVector entities; - AABox avatarBox(getMyAvatar()->getWorldPosition() - glm::vec3(PHYSICS_READY_RANGE), glm::vec3(2 * PHYSICS_READY_RANGE)); - // create two functions that use avatarBox (entityScan and elementScan), the second calls the first - std::function entityScan = [=](EntityItemPointer& entity) { - if (entity->shouldBePhysical()) { - bool success = false; - AABox entityBox = entity->getAABox(success); - // important: bail for entities that cannot supply a valid AABox - return success && avatarBox.touches(entityBox); - } - return false; - }; - std::function elementScan = [&](const OctreeElementPointer& element, void* unused) { - if (element->getAACube().touches(avatarBox)) { - EntityTreeElementPointer entityTreeElement = std::static_pointer_cast(element); - entityTreeElement->getEntities(entityScan, entities); - return true; - } - return false; - }; + quint64 textureResourceGPUMemSize = renderStats->textureResourceGPUMemSize; + quint64 texturePopulatedGPUMemSize = renderStats->textureResourcePopulatedGPUMemSize; - entityTree->withReadLock([&] { - // Pass the second function to the general-purpose EntityTree::findEntities() - // which will traverse the tree, apply the two filter functions (to element, then to entities) - // as it traverses. The end result will be a list of entities that match. - entityTree->findEntities(elementScan, entities); - }); - - uint32_t nearbyCount = entities.size(); - if (nearbyCount == _nearbyEntitiesCountAtLastPhysicsCheck) { - _nearbyEntitiesStabilityCount++; + if (_gpuTextureMemSizeAtLastCheck == textureResourceGPUMemSize) { + _gpuTextureMemSizeStabilityCount++; } else { - _nearbyEntitiesStabilityCount = 0; + _gpuTextureMemSizeStabilityCount = 0; } - _nearbyEntitiesCountAtLastPhysicsCheck = nearbyCount; + _gpuTextureMemSizeAtLastCheck = textureResourceGPUMemSize; - const uint32_t MINIMUM_NEARBY_ENTITIES_STABILITY_COUNT = 3; - if (_nearbyEntitiesStabilityCount >= MINIMUM_NEARBY_ENTITIES_STABILITY_COUNT) { - // We've seen the same number of nearby entities for several stats packets in a row. assume we've got all - // the local entities. - bool result = true; - foreach (EntityItemPointer entity, entities) { - if (entity->shouldBePhysical() && !entity->isReadyToComputeShape()) { - HIFI_FCDEBUG(interfaceapp(), "Physics disabled until entity loads: " << entity->getID() << entity->getName()); - // don't break here because we want all the relevant entities to start their downloads - result = false; - } - } - return result; + const uint32_t MINIMUM_GPU_TEXTURE_MEM_SIZE_STABILITY_COUNT = 10; + if (_gpuTextureMemSizeStabilityCount >= MINIMUM_GPU_TEXTURE_MEM_SIZE_STABILITY_COUNT) { + return (textureResourceGPUMemSize == texturePopulatedGPUMemSize); } return false; } diff --git a/interface/src/Application.h b/interface/src/Application.h index 3bebc60480..4a15c4fa61 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -528,7 +528,7 @@ private: bool importFromZIP(const QString& filePath); bool importImage(const QString& urlString); - bool nearbyEntitiesAreReadyForPhysics(); + bool gpuTextureMemSizeStable(); int processOctreeStats(ReceivedMessage& message, SharedNodePointer sendingNode); void trackIncomingOctreePacket(ReceivedMessage& message, SharedNodePointer sendingNode, bool wasStatsPacket); @@ -725,8 +725,10 @@ private: std::atomic _fullSceneReceivedCounter { 0 }; // how many times have we received a full-scene octree stats packet uint32_t _fullSceneCounterAtLastPhysicsCheck { 0 }; // _fullSceneReceivedCounter last time we checked physics ready - uint32_t _nearbyEntitiesCountAtLastPhysicsCheck { 0 }; // how many in-range entities last time we checked physics ready - uint32_t _nearbyEntitiesStabilityCount { 0 }; // how many times has _nearbyEntitiesCountAtLastPhysicsCheck been the same + + quint64 _gpuTextureMemSizeStabilityCount { 0 }; + quint64 _gpuTextureMemSizeAtLastCheck { 0 }; + quint64 _lastPhysicsCheckTime { usecTimestampNow() }; // when did we last check to see if physics was ready bool _keyboardDeviceHasFocus { true }; diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index 5d4ebe9853..7c6ea3b015 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -171,6 +171,9 @@ bool SafeLanding::isEntityLoadingComplete() { bool isVisuallyReady = true; + + qDebug() << "EntityTpye" << EntityTypes::getEntityTypeName(entity->getType()) << entity->getEntityItemID(); + Settings settings; bool enableInterstitial = settings.value("enableIntersitialMode", false).toBool(); @@ -188,6 +191,7 @@ bool SafeLanding::isEntityLoadingComplete() { entityMapIter++; } } + qDebug() << "EntityList size" << _trackedEntities.size() << "\n"; return _trackedEntities.empty(); } diff --git a/scripts/developer/utilities/render/textureMonitor.qml b/scripts/developer/utilities/render/textureMonitor.qml index 97cc577ff9..b01a390fa8 100644 --- a/scripts/developer/utilities/render/textureMonitor.qml +++ b/scripts/developer/utilities/render/textureMonitor.qml @@ -75,4 +75,4 @@ Item { } } -} \ No newline at end of file +} diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index 57726f397b..6c2db91010 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -14,7 +14,7 @@ (function() { Script.include("/~/system/libraries/Xform.js"); - var DEBUG = false; + var DEBUG = true; var MIN_LOADING_PROGRESS = 3.6; var TOTAL_LOADING_PROGRESS = 3.8; var EPSILON = 0.01; @@ -186,6 +186,8 @@ var currentDomain = "no domain"; var timer = null; var target = 0; + var textureMemSizeStabilityCount = 0; + var textureMemSizeAtLastCheck = 0; var connectionToDomainFailed = false; @@ -228,6 +230,8 @@ updateOverlays(false); startAudio(); target = 0; + textureMemSizeStabilityCount = 0; + textureMemSizeAtLastCheck = 0; currentProgress = 0.1; connectionToDomainFailed = false; previousCameraMode = Camera.mode; @@ -348,10 +352,11 @@ Overlays.editOverlay(loadingBarPlacard, properties); Overlays.editOverlay(loadingBarProgress, loadingBarProperties); - - Menu.setIsOptionChecked("Show Overlays", physicsEnabled); - if (!HMD.active) { - toolbar.writeProperty("visible", physicsEnabled); + if (!DEBUG) { + Menu.setIsOptionChecked("Show Overlays", physicsEnabled); + if (!HMD.active) { + toolbar.writeProperty("visible", physicsEnabled); + } } resetValues(); @@ -374,6 +379,7 @@ } function update() { + var renderStats = Render.getConfig("Stats"); var physicsEnabled = Window.isPhysicsEnabled(); var thisInterval = Date.now(); var deltaTime = (thisInterval - lastInterval); @@ -381,11 +387,39 @@ var domainLoadingProgressPercentage = Window.domainLoadingProgress(); - var progress = MIN_LOADING_PROGRESS * domainLoadingProgressPercentage; + var progress = ((TOTAL_LOADING_PROGRESS * 0.4) * domainLoadingProgressPercentage); if (progress >= target) { target = progress; } + if (currentProgress >= (TOTAL_LOADING_PROGRESS * 0.4)) { + var textureResourceGPUMemSize = renderStats.textureResourceGPUMemSize; + var texturePopulatedGPUMemSize = renderStats.textureResourcePopulatedGPUMemSize; + + if (textureMemSizeAtLastCheck === textureResourceGPUMemSize) { + textureMemSizeStabilityCount++; + } else { + textureMemSizeStabilityCount = 0; + } + + textureMemSizeAtLastCheck = textureResourceGPUMemSize; + + if (textureMemSizeStabilityCount >= 15) { + + if (textureResourceGPUMemSize > 0) { + print((texturePopulatedGPUMemSize / textureResourceGPUMemSize)); + var gpuPercantage = (TOTAL_LOADING_PROGRESS * 0.6) * (texturePopulatedGPUMemSize / textureResourceGPUMemSize); + print("---> gpu: " + gpuPercantage); + print("----> current: " + progress); + var totalProgress = progress + gpuPercantage; + print("------> totalProgress: " + totalProgress + "\n"); + if (totalProgress >= target) { + target = totalProgress; + } + } + } + } + if ((physicsEnabled && (currentProgress < TOTAL_LOADING_PROGRESS))) { target = TOTAL_LOADING_PROGRESS; } From 57ae8ff8a14fb7dc1538e57c93fe3314a3822fe5 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Mon, 24 Sep 2018 16:09:53 -0700 Subject: [PATCH 03/81] update interstitial page stability count and loading bar --- interface/src/Application.cpp | 3 +- interface/src/Application.h | 4 ++ interface/src/octree/SafeLanding.cpp | 40 ++++++++++++++----- interface/src/octree/SafeLanding.h | 3 ++ .../scripting/WindowScriptingInterface.cpp | 4 ++ .../src/scripting/WindowScriptingInterface.h | 2 + scripts/system/interstitialPage.js | 6 +-- 7 files changed, 45 insertions(+), 17 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 0947a85a17..ac21af6d44 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6570,8 +6570,7 @@ bool Application::gpuTextureMemSizeStable() { } _gpuTextureMemSizeAtLastCheck = textureResourceGPUMemSize; - const uint32_t MINIMUM_GPU_TEXTURE_MEM_SIZE_STABILITY_COUNT = 10; - if (_gpuTextureMemSizeStabilityCount >= MINIMUM_GPU_TEXTURE_MEM_SIZE_STABILITY_COUNT) { + if (_gpuTextureMemSizeStabilityCount >= _minimumGPUTextureMemSizeStabilityCount) { return (textureResourceGPUMemSize == texturePopulatedGPUMemSize); } return false; diff --git a/interface/src/Application.h b/interface/src/Application.h index 4a15c4fa61..b4df36704a 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -233,6 +233,8 @@ public: float getSettingConstrainToolbarPosition() { return _constrainToolbarPosition.get(); } void setSettingConstrainToolbarPosition(bool setting); + Q_INVOKABLE void setMinimumGPUTextureMemStabilityCount(int stabilityCount) { _minimumGPUTextureMemSizeStabilityCount = stabilityCount; } + NodeToOctreeSceneStats* getOcteeSceneStats() { return &_octreeServerSceneStats; } virtual controller::ScriptingInterface* getControllerScriptingInterface() { return _controllerScriptingInterface; } @@ -585,6 +587,8 @@ private: QElapsedTimer _lastTimeUpdated; QElapsedTimer _lastTimeRendered; + int _minimumGPUTextureMemSizeStabilityCount { 15 }; + ShapeManager _shapeManager; PhysicalEntitySimulationPointer _entitySimulation; PhysicsEnginePointer _physicsEngine; diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index 7c6ea3b015..ba6e1dac8a 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -10,6 +10,9 @@ // #include "SafeLanding.h" + +#include + #include "EntityTreeRenderer.h" #include "ModelEntityItem.h" #include "InterfaceLogging.h" @@ -39,6 +42,7 @@ void SafeLanding::startEntitySequence(QSharedPointer entityT _entityTree = entityTree; _trackedEntities.clear(); _trackingEntities = true; + _maxTrackedEntityCount = 0; connect(std::const_pointer_cast(_entityTree).get(), &EntityTree::addingEntity, this, &SafeLanding::addTrackedEntity); connect(std::const_pointer_cast(_entityTree).get(), @@ -47,6 +51,7 @@ void SafeLanding::startEntitySequence(QSharedPointer entityT _sequenceNumbers.clear(); _initialStart = INVALID_SEQUENCE; _initialEnd = INVALID_SEQUENCE; + _startTime = usecTimestampNow(); EntityTreeRenderer::setEntityLoadingPriorityFunction(&ElevatedPriority); } } @@ -55,6 +60,7 @@ void SafeLanding::stopEntitySequence() { Locker lock(_lock); _trackingEntities = false; _maxTrackedEntityCount = 0; + _trackedEntityStabilityCount = 0; _initialStart = INVALID_SEQUENCE; _initialEnd = INVALID_SEQUENCE; _trackedEntities.clear(); @@ -66,13 +72,14 @@ void SafeLanding::addTrackedEntity(const EntityItemID& entityID) { Locker lock(_lock); EntityItemPointer entity = _entityTree->findEntityByID(entityID); - if (entity) { + if (entity && entity->getCreated() < _startTime) { _trackedEntities.emplace(entityID, entity); int trackedEntityCount = (int)_trackedEntities.size(); if (trackedEntityCount > _maxTrackedEntityCount) { _maxTrackedEntityCount = trackedEntityCount; + _trackedEntityStabilityCount = 0; } qCDebug(interfaceapp) << "Safe Landing: Tracking entity " << entity->getItemName(); } @@ -116,11 +123,19 @@ bool SafeLanding::isLoadSequenceComplete() { float SafeLanding::loadingProgressPercentage() { Locker lock(_lock); + + static const int MINIMUM_TRACKED_ENTITY_STABILITY_COUNT = 15; + + float percentage = 0.0f; if (_maxTrackedEntityCount > 0) { - return ((_maxTrackedEntityCount - _trackedEntities.size()) / (float)_maxTrackedEntityCount); + percentage = ((_maxTrackedEntityCount - _trackedEntities.size()) / (float)_maxTrackedEntityCount); } - return 0.0f; + if (_trackedEntityStabilityCount < MINIMUM_TRACKED_ENTITY_STABILITY_COUNT) { + percentage *= 0.20f; + } + + return percentage; } bool SafeLanding::isSequenceNumbersComplete() { @@ -166,19 +181,18 @@ bool SafeLanding::isEntityLoadingComplete() { auto entityTree = qApp->getEntities(); auto entityMapIter = _trackedEntities.begin(); + Settings settings; + bool enableInterstitial = settings.value("enableIntersitialMode", false).toBool(); + while (entityMapIter != _trackedEntities.end()) { auto entity = entityMapIter->second; bool isVisuallyReady = true; - - qDebug() << "EntityTpye" << EntityTypes::getEntityTypeName(entity->getType()) << entity->getEntityItemID(); - - Settings settings; - bool enableInterstitial = settings.value("enableIntersitialMode", false).toBool(); - if (enableInterstitial) { isVisuallyReady = (entity->isVisuallyReady() || !entityTree->renderableForEntityId(entityMapIter->first)); + + qDebug() << "EntityTpye" << EntityTypes::getEntityTypeName(entity->getType()) << entity->getEntityItemID() << isVisuallyReady; } if (isEntityPhysicsReady(entity) && isVisuallyReady) { @@ -191,7 +205,13 @@ bool SafeLanding::isEntityLoadingComplete() { entityMapIter++; } } - qDebug() << "EntityList size" << _trackedEntities.size() << "\n"; + + if (enableInterstitial) { + _trackedEntityStabilityCount++; + qDebug() << "EntityList size" << _trackedEntities.size() << "\n"; + } + + return _trackedEntities.empty(); } diff --git a/interface/src/octree/SafeLanding.h b/interface/src/octree/SafeLanding.h index 317e4587c7..51357b60ff 100644 --- a/interface/src/octree/SafeLanding.h +++ b/interface/src/octree/SafeLanding.h @@ -52,6 +52,9 @@ private: int _initialStart { INVALID_SEQUENCE }; int _initialEnd { INVALID_SEQUENCE }; int _maxTrackedEntityCount { 0 }; + int _trackedEntityStabilityCount { 0 }; + + quint64 _startTime { 0 }; struct SequenceLessThan { bool operator()(const int& a, const int& b) const; diff --git a/interface/src/scripting/WindowScriptingInterface.cpp b/interface/src/scripting/WindowScriptingInterface.cpp index e3ae65aee1..543dfe4933 100644 --- a/interface/src/scripting/WindowScriptingInterface.cpp +++ b/interface/src/scripting/WindowScriptingInterface.cpp @@ -389,6 +389,10 @@ void WindowScriptingInterface::showAssetServer(const QString& upload) { QMetaObject::invokeMethod(qApp, "showAssetServerWidget", Qt::QueuedConnection, Q_ARG(QString, upload)); } +void WindowScriptingInterface::setMinimumGPUTextureMemSizeStabilityCount(int stabilityCount) { + QMetaObject::invokeMethod(qApp, " setMinimumGPUTextureMemStabilityCount", Qt::QueuedConnection, Q_ARG(int, stabilityCount)); +} + QString WindowScriptingInterface::checkVersion() { return QCoreApplication::applicationVersion(); } diff --git a/interface/src/scripting/WindowScriptingInterface.h b/interface/src/scripting/WindowScriptingInterface.h index 3827406729..bf93e73ea9 100644 --- a/interface/src/scripting/WindowScriptingInterface.h +++ b/interface/src/scripting/WindowScriptingInterface.h @@ -570,6 +570,8 @@ public slots: float domainLoadingProgress(); + void setMinimumGPUTextureMemSizeStabilityCount(int stabilityCount); + private slots: void onWindowGeometryChanged(const QRect& geometry); void onMessageBoxSelected(int button); diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index f5cd8293be..b8b9385a4d 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -14,7 +14,7 @@ (function() { Script.include("/~/system/libraries/Xform.js"); - var DEBUG = true; + var DEBUG = false; var MIN_LOADING_PROGRESS = 3.6; var TOTAL_LOADING_PROGRESS = 3.8; var EPSILON = 0.01; @@ -385,7 +385,6 @@ lastInterval = thisInterval; var domainLoadingProgressPercentage = Window.domainLoadingProgress(); - var progress = ((TOTAL_LOADING_PROGRESS * 0.4) * domainLoadingProgressPercentage); if (progress >= target) { target = progress; @@ -408,10 +407,7 @@ if (textureResourceGPUMemSize > 0) { print((texturePopulatedGPUMemSize / textureResourceGPUMemSize)); var gpuPercantage = (TOTAL_LOADING_PROGRESS * 0.6) * (texturePopulatedGPUMemSize / textureResourceGPUMemSize); - print("---> gpu: " + gpuPercantage); - print("----> current: " + progress); var totalProgress = progress + gpuPercantage; - print("------> totalProgress: " + totalProgress + "\n"); if (totalProgress >= target) { target = totalProgress; } From 26b6967ba6830e3eb5eb4041a9ce1c1b6674218d Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Tue, 25 Sep 2018 18:16:18 -0700 Subject: [PATCH 04/81] adding overlays to redirect domain --- interface/resources/serverless/redirect.json | 1098 ++++-------------- libraries/networking/src/DomainHandler.cpp | 1 + scripts/defaultScripts.js | 1 + scripts/system/interstitialPage.js | 18 +- scripts/system/redirectOverlays.js | 144 +++ 5 files changed, 408 insertions(+), 854 deletions(-) create mode 100644 scripts/system/redirectOverlays.js diff --git a/interface/resources/serverless/redirect.json b/interface/resources/serverless/redirect.json index 97cd75c8cd..b40b3867b3 100644 --- a/interface/resources/serverless/redirect.json +++ b/interface/resources/serverless/redirect.json @@ -5,50 +5,6 @@ "/": "/5.77,1.4,4.96/0,0.49544,0,0.868645" }, "Entities": [ - { - "clientOnly": false, - "collidesWith": "static,dynamic,kinematic,otherAvatar,", - "collisionMask": 23, - "created": "2018-09-05T18:13:00Z", - "dimensions": { - "blue": 1.159199833869934, - "green": 2.8062009811401367, - "red": 1.6216505765914917, - "x": 1.6216505765914917, - "y": 2.8062009811401367, - "z": 1.159199833869934 - }, - "id": "{d0ed60b8-9174-4c56-8e78-2c5399329ae0}", - "lastEdited": 1536171372916208, - "lastEditedBy": "{151cb20e-715a-4c80-aa0d-5b58b1c8a0c9}", - "locked": true, - "name": "Try Again Zone", - "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", - "position": { - "blue":4.015342712402344, - "green":1.649999976158142, - "red":2.00921893119812, - "x":2.00921893119812, - "y":1.649999976158142, - "z":4.015342712402344 - }, - "queryAACube": { - "scale": 3.4421300888061523, - "x": 1.6001315116882324, - "y": -0.07100248336791992, - "z": 0.14220571517944336 - }, - "rotation": { - "w": 0.9914448857307434, - "x": 0, - "y": -0.13052619993686676, - "z": 0 - }, - "script": "https://hifi-content.s3.amazonaws.com/wayne/404redirectionScripts/zoneTryAgainEntityScript.js", - "shapeType": "box", - "type": "Zone", - "userData": "{\"grabbableKey\":{\"grabbable\":false}}" - }, { "clientOnly": false, "color": { @@ -56,7 +12,7 @@ "green": 0, "red": 255 }, - "created": "2018-09-05T00:40:03Z", + "created": "2018-09-25T18:44:28Z", "dimensions": { "blue": 8.645400047302246, "green": 0.20000000298023224, @@ -65,23 +21,23 @@ "y": 0.20000000298023224, "z": 8.645400047302246 }, - "id": "{e44fb546-b34a-4966-9b11-73556f800d21}", - "lastEdited": 1536107948776951, - "lastEditedBy": "{ce82d352-3002-44ae-9b76-66492989a1db}", + "id": "{eac57ccf-1e81-4d74-80f1-f17f23fc2f2c}", + "lastEdited": 1537901430334573, + "lastEditedBy": "{69540019-db48-4375-86c8-ac1a4a90d043}", "locked": true, "name": "ceiling", "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", "position": { "blue": 4.846520900726318, "green": 2.912982940673828, - "red": 5.739595890045166, - "x": 5.739595890045166, + "red": 6.00444221496582, + "x": 6.00444221496582, "y": 2.912982940673828, "z": 4.846520900726318 }, "queryAACube": { "scale": 21.812576293945312, - "x": -5.16669225692749, + "x": -4.901845932006836, "y": -7.993305206298828, "z": -6.059767246246338 }, @@ -103,7 +59,189 @@ "green": 0, "red": 0 }, - "created": "2018-09-05T00:40:03Z", + "created": "2018-09-25T18:44:28Z", + "dimensions": { + "blue": 11.117486953735352, + "green": 3.580313205718994, + "red": 0.20000000298023224, + "x": 0.20000000298023224, + "y": 3.580313205718994, + "z": 11.117486953735352 + }, + "id": "{54609e9e-f729-46fc-ac06-78d44ee6b6fe}", + "lastEdited": 1537901430334887, + "lastEditedBy": "{69540019-db48-4375-86c8-ac1a4a90d043}", + "locked": true, + "name": "backWall", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "blue": 5.268576622009277, + "green": 1.0066027641296387, + "red": 6.358620643615723, + "x": 6.358620643615723, + "y": 1.0066027641296387, + "z": 5.268576622009277 + }, + "queryAACube": { + "scale": 11.681488037109375, + "x": 0.5178766250610352, + "y": -4.834141254425049, + "z": -0.5721673965454102 + }, + "rotation": { + "w": 0.9662165641784668, + "x": -4.57763671875e-05, + "y": -0.2576791048049927, + "z": 1.52587890625e-05 + }, + "shape": "Cube", + "type": "Box", + "userData": "{\"grabbableKey\":{\"grabbable\":false}}", + "visible": false + }, + { + "clientOnly": false, + "color": { + "blue": 0, + "green": 0, + "red": 0 + }, + "created": "2018-09-25T18:44:28Z", + "dimensions": { + "blue": 11.117486953735352, + "green": 3.580313205718994, + "red": 0.20000000298023224, + "x": 0.20000000298023224, + "y": 3.580313205718994, + "z": 11.117486953735352 + }, + "id": "{c9352a54-b2cd-4c0f-a898-7e79c01404d0}", + "lastEdited": 1537901430334652, + "lastEditedBy": "{69540019-db48-4375-86c8-ac1a4a90d043}", + "locked": true, + "name": "frontWall", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "blue": 2.662257671356201, + "green": 1.0063786506652832, + "red": 1.7517199516296387, + "x": 1.7517199516296387, + "y": 1.0063786506652832, + "z": 2.662257671356201 + }, + "queryAACube": { + "scale": 11.681488037109375, + "x": -4.089024066925049, + "y": -4.834365367889404, + "z": -3.1784863471984863 + }, + "rotation": { + "w": 0.9666743278503418, + "x": -4.57763671875e-05, + "y": -0.2560006380081177, + "z": 1.52587890625e-05 + }, + "shape": "Cube", + "type": "Box", + "userData": "{\"grabbableKey\":{\"grabbable\":false}}", + "visible": false + }, + { + "clientOnly": false, + "color": { + "blue": 0, + "green": 0, + "red": 0 + }, + "created": "2018-09-25T18:44:28Z", + "dimensions": { + "blue": 11.117486953735352, + "green": 3.580313205718994, + "red": 0.20000000298023224, + "x": 0.20000000298023224, + "y": 3.580313205718994, + "z": 11.117486953735352 + }, + "id": "{c4b7a530-ec5b-47fc-be60-eed22f96799d}", + "lastEdited": 1537901430334730, + "lastEditedBy": "{69540019-db48-4375-86c8-ac1a4a90d043}", + "locked": true, + "name": "rightWall", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "blue": 0, + "green": 1.0061144828796387, + "red": 5.229935646057129, + "x": 5.229935646057129, + "y": 1.0061144828796387, + "z": 0 + }, + "queryAACube": { + "scale": 11.681488037109375, + "x": -0.6108083724975586, + "y": -4.834629535675049, + "z": -5.8407440185546875 + }, + "rotation": { + "w": 0.8637980222702026, + "x": -4.57763671875e-05, + "y": 0.5038070678710938, + "z": -1.52587890625e-05 + }, + "shape": "Cube", + "type": "Box", + "userData": "{\"grabbableKey\":{\"grabbable\":false}}", + "visible": false + }, + { + "clientOnly": false, + "created": "2018-09-25T18:44:28Z", + "dimensions": { + "blue": 14.40000057220459, + "green": 14.40000057220459, + "red": 14.40000057220459, + "x": 14.40000057220459, + "y": 14.40000057220459, + "z": 14.40000057220459 + }, + "id": "{351ddd1e-79b3-4be7-8784-aca29bd65193}", + "lastEdited": 1537901430334210, + "lastEditedBy": "{69540019-db48-4375-86c8-ac1a4a90d043}", + "locked": true, + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "blue": 2.3440732955932617, + "green": 1.6162219047546387, + "red": 2.1396677494049072, + "x": 2.1396677494049072, + "y": 1.6162219047546387, + "z": 2.3440732955932617 + }, + "queryAACube": { + "scale": 24.9415340423584, + "x": -10.331099510192871, + "y": -10.854545593261719, + "z": -10.126693725585938 + }, + "rotation": { + "w": 0.8697794675827026, + "x": -1.52587890625e-05, + "y": 0.4933699369430542, + "z": -4.57763671875e-05 + }, + "shapeType": "box", + "skyboxMode": "enabled", + "type": "Zone", + "userData": "{\"grabbableKey\":{\"grabbable\":false}}" + }, + { + "clientOnly": false, + "color": { + "blue": 0, + "green": 0, + "red": 0 + }, + "created": "2018-09-25T18:44:28Z", "dimensions": { "blue": 6.9401350021362305, "green": 0.04553089290857315, @@ -112,9 +250,51 @@ "y": 0.04553089290857315, "z": 6.9401350021362305 }, - "id": "{33440bf8-f9ce-4d52-9b29-1b321e226982}", - "lastEdited": 1536107948774796, - "lastEditedBy": "{4eecd88f-ef9b-4a83-bb9a-7f7496209c6b}", + "id": "{81c13ed1-1873-4f21-adea-5112a0fdacd1}", + "lastEdited": 1537901430334808, + "lastEditedBy": "{69540019-db48-4375-86c8-ac1a4a90d043}", + "locked": true, + "name": "floor", + "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", + "position": { + "blue": 3.6175529956817627, + "green": 0, + "red": 4.367232322692871, + "x": 4.367232322692871, + "y": 0, + "z": 3.6175529956817627 + }, + "queryAACube": { + "scale": 9.860417366027832, + "x": -0.5629763603210449, + "y": -4.930208683013916, + "z": -1.3126556873321533 + }, + "rotation": { + "w": 0.8660253882408142, + "x": -1.5922749298624694e-05, + "y": 0.5, + "z": -4.572480611386709e-05 + }, + "shape": "Cube", + "type": "Box", + "userData": "{\"grabbableKey\":{\"grabbable\":false}}", + "visible": false + }, + { + "clientOnly": false, + "created": "2018-09-25T18:44:28Z", + "dimensions": { + "blue": 6.9401350021362305, + "green": 0.04553089290857315, + "red": 7.004304885864258, + "x": 7.004304885864258, + "y": 0.04553089290857315, + "z": 6.9401350021362305 + }, + "id": "{5582179a-fb69-4678-af0c-c8e6d890839a}", + "lastEdited": 1537901430334966, + "lastEditedBy": "{69540019-db48-4375-86c8-ac1a4a90d043}", "locked": true, "modelURL": "http://hifi-content.s3.amazonaws.com/alexia/LoadingScreens/floor.fbx", "name": "floorModel", @@ -122,14 +302,14 @@ "position": { "blue": 3.6175529956817627, "green": 0, - "red": 4.102385997772217, - "x": 4.102385997772217, + "red": 4.367232322692871, + "x": 4.367232322692871, "y": 0, "z": 3.6175529956817627 }, "queryAACube": { "scale": 9.860417366027832, - "x": -0.8278226852416992, + "x": -0.5629763603210449, "y": -4.930208683013916, "z": -1.3126556873321533 }, @@ -150,54 +330,7 @@ "green": 0, "red": 0 }, - "created": "2018-09-05T00:40:03Z", - "dimensions": { - "blue": 6.9401350021362305, - "green": 0.04553089290857315, - "red": 7.004304885864258, - "x": 7.004304885864258, - "y": 0.04553089290857315, - "z": 6.9401350021362305 - }, - "id": "{8cd93fe5-16c0-44b7-b1e9-e7e06c4e9228}", - "lastEdited": 1536107948774796, - "lastEditedBy": "{4eecd88f-ef9b-4a83-bb9a-7f7496209c6b}", - "locked": true, - "name": "floor", - "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", - "position": { - "blue": 3.6175529956817627, - "green": 0, - "red": 4.102385997772217, - "x": 4.102385997772217, - "y": 0, - "z": 3.6175529956817627 - }, - "queryAACube": { - "scale": 9.860417366027832, - "x": -0.8278226852416992, - "y": -4.930208683013916, - "z": -1.3126556873321533 - }, - "rotation": { - "w": 0.8660253882408142, - "x": -1.5922749298624694e-05, - "y": 0.5, - "z": -4.572480611386709e-05 - }, - "shape": "Cube", - "type": "Box", - "userData": "{\"grabbableKey\":{\"grabbable\":false}}", - "visible": false - }, - { - "clientOnly": false, - "color": { - "blue": 0, - "green": 0, - "red": 0 - }, - "created": "2018-09-05T00:40:03Z", + "created": "2018-09-25T18:44:28Z", "dimensions": { "blue": 11.117486953735352, "green": 3.580313205718994, @@ -206,23 +339,23 @@ "y": 3.580313205718994, "z": 11.117486953735352 }, - "id": "{147272dc-a344-4171-9621-efc1c2095997}", - "lastEdited": 1536107948776823, - "lastEditedBy": "{ce82d352-3002-44ae-9b76-66492989a1db}", + "id": "{366ec0b9-5106-4172-a9f6-2143f6c279aa}", + "lastEdited": 1537901430334307, + "lastEditedBy": "{69540019-db48-4375-86c8-ac1a4a90d043}", "locked": true, "name": "leftWall", "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", "position": { "blue": 6.1806135177612305, "green": 1.0066027641296387, - "red": 1.4690406322479248, - "x": 1.4690406322479248, + "red": 1.7338871955871582, + "x": 1.7338871955871582, "y": 1.0066027641296387, "z": 6.1806135177612305 }, "queryAACube": { "scale": 11.681488037109375, - "x": -4.371703147888184, + "x": -4.106856822967529, "y": -4.834141254425049, "z": 0.33986949920654297 }, @@ -236,747 +369,8 @@ "type": "Box", "userData": "{\"grabbableKey\":{\"grabbable\":false}}", "visible": false - }, - { - "clientOnly": false, - "color": { - "blue": 0, - "green": 0, - "red": 0 - }, - "created": "2018-09-05T00:40:03Z", - "dimensions": { - "blue": 11.117486953735352, - "green": 3.580313205718994, - "red": 0.20000000298023224, - "x": 0.20000000298023224, - "y": 3.580313205718994, - "z": 11.117486953735352 - }, - "id": "{5f2b89b8-47e3-4915-a966-d46307a40f06}", - "lastEdited": 1536107948774605, - "lastEditedBy": "{ce82d352-3002-44ae-9b76-66492989a1db}", - "locked": true, - "name": "backWall", - "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", - "position": { - "blue": 5.268576622009277, - "green": 1.0066027641296387, - "red": 6.093774318695068, - "x": 6.093774318695068, - "y": 1.0066027641296387, - "z": 5.268576622009277 - }, - "queryAACube": { - "scale": 11.681488037109375, - "x": 0.25303030014038086, - "y": -4.834141254425049, - "z": -0.5721673965454102 - }, - "rotation": { - "w": 0.9662165641784668, - "x": -4.57763671875e-05, - "y": -0.2576791048049927, - "z": 1.52587890625e-05 - }, - "shape": "Cube", - "type": "Box", - "userData": "{\"grabbableKey\":{\"grabbable\":false}}", - "visible": false - }, - { - "clientOnly": false, - "created": "2018-09-05T00:40:03Z", - "dimensions": { - "blue": 14.40000057220459, - "green": 14.40000057220459, - "red": 14.40000057220459, - "x": 14.40000057220459, - "y": 14.40000057220459, - "z": 14.40000057220459 - }, - "id": "{baf96345-8f68-4068-af4c-3c690035852a}", - "lastEdited": 1536107948775591, - "lastEditedBy": "{b5bba536-25e5-4b12-a1be-5c7cd196a06a}", - "locked": true, - "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", - "position": { - "blue": 2.3440732955932617, - "green": 1.6162219047546387, - "red": 1.8748211860656738, - "x": 1.8748211860656738, - "y": 1.6162219047546387, - "z": 2.3440732955932617 - }, - "queryAACube": { - "scale": 24.9415340423584, - "x": -10.595945358276367, - "y": -10.854545593261719, - "z": -10.126693725585938 - }, - "rotation": { - "w": 0.8697794675827026, - "x": -1.52587890625e-05, - "y": 0.4933699369430542, - "z": -4.57763671875e-05 - }, - "shapeType": "box", - "skyboxMode": "enabled", - "type": "Zone", - "userData": "{\"grabbableKey\":{\"grabbable\":false}}" - }, - { - "alpha": 0, - "alphaFinish": 0, - "alphaStart": 1, - "clientOnly": false, - "color": { - "blue": 211, - "green": 227, - "red": 104 - }, - "colorFinish": { - "blue": 0, - "green": 0, - "red": 0, - "x": 0, - "y": 0, - "z": 0 - }, - "colorStart": { - "blue": 211, - "green": 227, - "red": 104, - "x": 104, - "y": 227, - "z": 211 - }, - "created": "2018-09-05T00:40:03Z", - "dimensions": { - "blue": 2.5, - "green": 2.5, - "red": 2.5, - "x": 2.5, - "y": 2.5, - "z": 2.5 - }, - "emitAcceleration": { - "blue": 0, - "green": 0, - "red": 0, - "x": 0, - "y": 0, - "z": 0 - }, - "emitDimensions": { - "blue": 1, - "green": 1, - "red": 1, - "x": 1, - "y": 1, - "z": 1 - }, - "emitOrientation": { - "w": 0.9993909597396851, - "x": 0.034897372126579285, - "y": -1.525880907138344e-05, - "z": -1.525880907138344e-05 - }, - "emitRate": 2, - "emitSpeed": 0, - "id": "{639a51f0-8613-4e46-bc7e-fef24597df73}", - "lastEdited": 1536107948776693, - "lastEditedBy": "{b5bba536-25e5-4b12-a1be-5c7cd196a06a}", - "lifespan": 10, - "locked": true, - "maxParticles": 40, - "name": "Rays", - "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", - "particleRadius": 0.75, - "polarFinish": 3.1415927410125732, - "position": { - "blue": 1.3553659915924072, - "green": 1.2890124320983887, - "red": 2.5663273334503174, - "x": 2.5663273334503174, - "y": 1.2890124320983887, - "z": 1.3553659915924072 - }, - "queryAACube": { - "scale": 4.330127239227295, - "x": 0.4012637138366699, - "y": -0.8760511875152588, - "z": -0.8096976280212402 - }, - "radiusFinish": 0.10000000149011612, - "radiusStart": 0, - "rotation": { - "w": 0.9803768396377563, - "x": -1.52587890625e-05, - "y": 0.19707024097442627, - "z": -7.62939453125e-05 - }, - "speedSpread": 0, - "spinFinish": null, - "spinStart": null, - "textures": "http://hifi-content.s3.amazonaws.com/alexia/Models/Portal/stripe.png", - "type": "ParticleEffect", - "userData": "{\"grabbableKey\":{\"grabbable\":false}}" - }, - { - "alpha": 0, - "alphaFinish": 0, - "alphaStart": 1, - "clientOnly": false, - "color": { - "blue": 255, - "green": 205, - "red": 3 - }, - "colorFinish": { - "blue": 0, - "green": 0, - "red": 0, - "x": 0, - "y": 0, - "z": 0 - }, - "colorStart": { - "blue": 255, - "green": 204, - "red": 0, - "x": 0, - "y": 204, - "z": 255 - }, - "created": "2018-09-05T00:40:03Z", - "dimensions": { - "blue": 2.5, - "green": 2.5, - "red": 2.5, - "x": 2.5, - "y": 2.5, - "z": 2.5 - }, - "emitAcceleration": { - "blue": 0, - "green": 0, - "red": 0, - "x": 0, - "y": 0, - "z": 0 - }, - "emitDimensions": { - "blue": 1, - "green": 1, - "red": 1, - "x": 1, - "y": 1, - "z": 1 - }, - "emitOrientation": { - "w": 0.9993909597396851, - "x": 0.034897372126579285, - "y": -1.525880907138344e-05, - "z": -1.525880907138344e-05 - }, - "emitRate": 2, - "emitSpeed": 0, - "emitterShouldTrail": true, - "id": "{e62ced49-fa18-4ae1-977f-abef5bc0f3ba}", - "lastEdited": 1536107948775366, - "lastEditedBy": "{b5bba536-25e5-4b12-a1be-5c7cd196a06a}", - "lifespan": 10, - "locked": true, - "maxParticles": 40, - "name": "Rays", - "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", - "particleRadius": 0.75, - "polarFinish": 3.1415927410125732, - "position": { - "blue": 3.814434051513672, - "green": 1.2890124320983887, - "red": 1.2254328727722168, - "x": 1.2254328727722168, - "y": 1.2890124320983887, - "z": 3.814434051513672 - }, - "queryAACube": { - "scale": 4.330127239227295, - "x": -0.9396307468414307, - "y": -0.8760511875152588, - "z": 1.6493704319000244 - }, - "radiusFinish": 0.10000000149011612, - "radiusStart": 0, - "rotation": { - "w": 0.9594720602035522, - "x": -1.52587890625e-05, - "y": 0.28178834915161133, - "z": -4.57763671875e-05 - }, - "speedSpread": 0, - "spinFinish": null, - "spinStart": null, - "textures": "http://hifi-content.s3.amazonaws.com/alexia/Models/Portal/stripe.png", - "type": "ParticleEffect", - "userData": "{\"grabbableKey\":{\"grabbable\":false}}" - }, - { - "alpha": 0, - "alphaFinish": 0, - "alphaStart": 0.25, - "clientOnly": false, - "colorFinish": { - "blue": 0, - "green": 0, - "red": 0, - "x": 0, - "y": 0, - "z": 0 - }, - "colorStart": { - "blue": 255, - "green": 255, - "red": 255, - "x": 255, - "y": 255, - "z": 255 - }, - "created": "2018-09-05T00:40:03Z", - "dimensions": { - "blue": 13.24000072479248, - "green": 13.24000072479248, - "red": 13.24000072479248, - "x": 13.24000072479248, - "y": 13.24000072479248, - "z": 13.24000072479248 - }, - "emitAcceleration": { - "blue": 0, - "green": 0.10000000149011612, - "red": 0, - "x": 0, - "y": 0.10000000149011612, - "z": 0 - }, - "emitDimensions": { - "blue": 1, - "green": 1, - "red": 1, - "x": 1, - "y": 1, - "z": 1 - }, - "emitOrientation": { - "w": 1, - "x": -1.52587890625e-05, - "y": -1.52587890625e-05, - "z": -1.52587890625e-05 - }, - "emitRate": 6, - "emitSpeed": 0, - "id": "{298c0571-cbd8-487b-8640-64037d6a8414}", - "lastEdited": 1536107948776382, - "lastEditedBy": "{b5bba536-25e5-4b12-a1be-5c7cd196a06a}", - "lifespan": 10, - "locked": true, - "maxParticles": 10, - "name": "Stars", - "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", - "particleRadius": 0.07000000029802322, - "polarFinish": 3.1415927410125732, - "position": { - "blue": 1.3712034225463867, - "green": 0.3698839843273163, - "red": 2.6216418743133545, - "x": 2.6216418743133545, - "y": 0.3698839843273163, - "z": 1.3712034225463867 - }, - "queryAACube": { - "scale": 22.932353973388672, - "x": -8.844534873962402, - "y": -11.096293449401855, - "z": -10.09497356414795 - }, - "radiusFinish": 0, - "radiusStart": 0, - "rotation": { - "w": 0.9852597713470459, - "x": -1.52587890625e-05, - "y": -0.17106890678405762, - "z": -7.62939453125e-05 - }, - "speedSpread": 0, - "spinFinish": null, - "spinStart": null, - "textures": "http://hifi-content.s3.amazonaws.com/alexia/Models/Portal/star.png", - "type": "ParticleEffect", - "userData": "{\"grabbableKey\":{\"grabbable\":false}}" - }, - { - "clientOnly": false, - "created": "2018-09-05T00:40:03Z", - "dimensions": { - "blue": 2.1097896099090576, - "green": 0.04847164824604988, - "red": 1.458284616470337, - "x": 1.458284616470337, - "y": 0.04847164824604988, - "z": 2.1097896099090576 - }, - "id": "{6625dbb8-ff25-458d-a92e-644b58460604}", - "lastEdited": 1536107948776195, - "lastEditedBy": "{b5bba536-25e5-4b12-a1be-5c7cd196a06a}", - "locked": true, - "modelURL": "http://hifi-content.s3.amazonaws.com/alexia/Models/Portal/portal1.fbx", - "name": "Try Again", - "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", - "position": { - "blue": 3.946338653564453, - "green": 0.09449335932731628, - "red": 1.594836711883545, - "x": 1.594836711883545, - "y": 0.09449335932731628, - "z": 3.946338653564453 - }, - "queryAACube": { - "scale": 2.5651814937591553, - "x": 0.3122459650039673, - "y": -1.188097357749939, - "z": 2.663747787475586 - }, - "rotation": { - "w": 0.8220492601394653, - "x": -1.52587890625e-05, - "y": 0.5693598985671997, - "z": -0.0001068115234375 - }, - "script": "https://hifi-content.s3.amazonaws.com/wayne/404redirectionScripts/tryAgainEntityScript.js", - "shapeType": "static-mesh", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":false}}" - }, - { - "clientOnly": false, - "created": "2018-09-05T00:40:03Z", - "dimensions": { - "blue": 0.06014331430196762, - "green": 2.582186460494995, - "red": 2.582186698913574, - "x": 2.582186698913574, - "y": 2.582186460494995, - "z": 0.06014331430196762 - }, - "id": "{dfe92dce-f09d-4e9e-b3ed-c68ecd4d476f}", - "lastEdited": 1536108160862286, - "lastEditedBy": "{4656d4a8-5e61-4230-ab34-2888d7945bd6}", - "modelURL": "", - "name": "Oops Dialog", - "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", - "position": { - "blue": 1.45927095413208, - "green": 1.6763916015625, - "red": 0, - "x": 0, - "y": 1.6763916015625, - "z": 1.45927095413208 - }, - "queryAACube": { - "scale": 3.6522583961486816, - "x": -1.8261291980743408, - "y": -0.14973759651184082, - "z": -0.36685824394226074 - }, - "rotation": { - "w": 0.8684672117233276, - "x": -4.57763671875e-05, - "y": 0.4957197904586792, - "z": -7.62939453125e-05 - }, - "script": "https://hifi-content.s3.amazonaws.com/wayne/404redirectionScripts/oopsEntityScript.js", - "scriptTimestamp": 1536102551825, - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":false}}" - }, - { - "clientOnly": false, - "color": { - "blue": 0, - "green": 0, - "red": 0 - }, - "created": "2018-09-05T00:40:03Z", - "dimensions": { - "blue": 11.117486953735352, - "green": 3.580313205718994, - "red": 0.20000000298023224, - "x": 0.20000000298023224, - "y": 3.580313205718994, - "z": 11.117486953735352 - }, - "id": "{144a8cf4-b0e8-489a-9403-d74d4dc4cb3e}", - "lastEdited": 1536107948775774, - "lastEditedBy": "{ce82d352-3002-44ae-9b76-66492989a1db}", - "locked": true, - "name": "rightWall", - "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", - "position": { - "blue": 0, - "green": 1.0061144828796387, - "red": 4.965089321136475, - "x": 4.965089321136475, - "y": 1.0061144828796387, - "z": 0 - }, - "queryAACube": { - "scale": 11.681488037109375, - "x": -0.8756546974182129, - "y": -4.834629535675049, - "z": -5.8407440185546875 - }, - "rotation": { - "w": 0.8637980222702026, - "x": -4.57763671875e-05, - "y": 0.5038070678710938, - "z": -1.52587890625e-05 - }, - "shape": "Cube", - "type": "Box", - "userData": "{\"grabbableKey\":{\"grabbable\":false}}", - "visible": false - }, - { - "clientOnly": false, - "collidesWith": "static,dynamic,kinematic,otherAvatar,", - "collisionMask": 23, - "created": "2018-09-05T00:40:03Z", - "dimensions": { - "blue": 1.159199833869934, - "green": 2.8062009811401367, - "red": 1.6216505765914917, - "x": 1.6216505765914917, - "y": 2.8062009811401367, - "z": 1.159199833869934 - }, - "id": "{37f53408-3d0c-42a5-9891-e6c40a227349}", - "lastEdited": 1536107948775010, - "lastEditedBy": "{b5bba536-25e5-4b12-a1be-5c7cd196a06a}", - "locked": true, - "name": "Back Zone", - "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", - "position": { - "blue": 1.8632707595825195, - "green": 1.6500625610351562, - "red": 3.3211965560913086, - "x": 3.3211965560913086, - "y": 1.6500625610351562, - "z": 1.8632707595825195 - }, - "queryAACube": { - "scale": 3.4421300888061523, - "x": 1.6001315116882324, - "y": -0.07100248336791992, - "z": 0.14220571517944336 - }, - "rotation": { - "w": 0.9304176568984985, - "x": 0, - "y": -0.36650121212005615, - "z": 0 - }, - "script": "https://hifi-content.s3.amazonaws.com/wayne/404redirectionScripts/zoneBackEntityScript.js", - "shapeType": "box", - "type": "Zone", - "userData": "{\"grabbableKey\":{\"grabbable\":false}}" - }, - { - "clientOnly": false, - "color": { - "blue": 0, - "green": 0, - "red": 0 - }, - "created": "2018-09-05T00:40:03Z", - "dimensions": { - "blue": 11.117486953735352, - "green": 3.580313205718994, - "red": 0.20000000298023224, - "x": 0.20000000298023224, - "y": 3.580313205718994, - "z": 11.117486953735352 - }, - "id": "{aa6e680c-6750-4776-95bc-ef3118cace5c}", - "lastEdited": 1536107948775945, - "lastEditedBy": "{ce82d352-3002-44ae-9b76-66492989a1db}", - "locked": true, - "name": "frontWall", - "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", - "position": { - "blue": 2.662257671356201, - "green": 1.0063786506652832, - "red": 1.4868733882904053, - "x": 1.4868733882904053, - "y": 1.0063786506652832, - "z": 2.662257671356201 - }, - "queryAACube": { - "scale": 11.681488037109375, - "x": -4.353870391845703, - "y": -4.834365367889404, - "z": -3.1784863471984863 - }, - "rotation": { - "w": 0.9666743278503418, - "x": -4.57763671875e-05, - "y": -0.2560006380081177, - "z": 1.52587890625e-05 - }, - "shape": "Cube", - "type": "Box", - "userData": "{\"grabbableKey\":{\"grabbable\":false}}", - "visible": false - }, - { - "clientOnly": false, - "created": "2018-09-05T00:40:03Z", - "dimensions": { - "blue": 2.1097896099090576, - "green": 0.04847164824604988, - "red": 1.458284616470337, - "x": 1.458284616470337, - "y": 0.04847164824604988, - "z": 2.1097896099090576 - }, - "id": "{303631f1-04f3-42a6-b8a8-8dd4b65d1231}", - "lastEdited": 1536107948776513, - "lastEditedBy": "{b5bba536-25e5-4b12-a1be-5c7cd196a06a}", - "locked": true, - "modelURL": "http://hifi-content.s3.amazonaws.com/alexia/Models/Portal/portal2.fbx", - "name": "Back", - "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", - "position": { - "blue": 1.5835940837860107, - "green": 0.09449335932731628, - "red": 3.028078079223633, - "x": 3.028078079223633, - "y": 0.09449335932731628, - "z": 1.5835940837860107 - }, - "queryAACube": { - "scale": 2.5651814937591553, - "x": 1.7454873323440552, - "y": -1.188097357749939, - "z": 0.3010033369064331 - }, - "rotation": { - "w": 0.9084458351135254, - "x": -1.52587890625e-05, - "y": 0.4179598093032837, - "z": -0.0001068115234375 - }, - "script": "https://hifi-content.s3.amazonaws.com/wayne/404redirectionScripts/backEntityScript.js", - "scriptTimestamp": 1535751754379, - "shapeType": "static-mesh", - "type": "Model", - "userData": "{\"grabbableKey\":{\"grabbable\":false}}" - }, - { - "alpha": 0, - "alphaFinish": 0, - "alphaStart": 0.25, - "clientOnly": false, - "colorFinish": { - "blue": 0, - "green": 0, - "red": 0, - "x": 0, - "y": 0, - "z": 0 - }, - "colorStart": { - "blue": 255, - "green": 255, - "red": 255, - "x": 255, - "y": 255, - "z": 255 - }, - "created": "2018-09-05T00:40:03Z", - "dimensions": { - "blue": 13.24000072479248, - "green": 13.24000072479248, - "red": 13.24000072479248, - "x": 13.24000072479248, - "y": 13.24000072479248, - "z": 13.24000072479248 - }, - "emitAcceleration": { - "blue": 0, - "green": 0.10000000149011612, - "red": 0, - "x": 0, - "y": 0.10000000149011612, - "z": 0 - }, - "emitDimensions": { - "blue": 1, - "green": 1, - "red": 1, - "x": 1, - "y": 1, - "z": 1 - }, - "emitOrientation": { - "w": 1, - "x": -1.52587890625e-05, - "y": -1.52587890625e-05, - "z": -1.52587890625e-05 - }, - "emitRate": 6, - "emitSpeed": 0, - "emitterShouldTrail": true, - "id": "{8ded39e6-303c-48f2-be79-81b715cca9f7}", - "lastEdited": 1536107948777127, - "lastEditedBy": "{b5bba536-25e5-4b12-a1be-5c7cd196a06a}", - "lifespan": 10, - "locked": true, - "maxParticles": 10, - "name": "Stars", - "owningAvatarID": "{00000000-0000-0000-0000-000000000000}", - "particleRadius": 0.07000000029802322, - "polarFinish": 3.1415927410125732, - "position": { - "blue": 3.78922963142395, - "green": 0.3698839843273163, - "red": 1.1863799095153809, - "x": 1.1863799095153809, - "y": 0.3698839843273163, - "z": 3.78922963142395 - }, - "queryAACube": { - "scale": 22.932353973388672, - "x": -10.279796600341797, - "y": -11.096293449401855, - "z": -7.676947593688965 - }, - "radiusFinish": 0, - "radiusStart": 0, - "rotation": { - "w": 0.996429443359375, - "x": -1.52587890625e-05, - "y": -0.08442819118499756, - "z": -4.57763671875e-05 - }, - "speedSpread": 0, - "spinFinish": null, - "spinStart": null, - "textures": "http://hifi-content.s3.amazonaws.com/alexia/Models/Portal/star.png", - "type": "ParticleEffect", - "userData": "{\"grabbableKey\":{\"grabbable\":false}}" } ], - "Id": "{18abccad-2d57-4176-9d89-24dc424916f5}", + "Id": "{6ec356c4-abf2-41b7-9980-c47dd08343b2}", "Version": 93 } diff --git a/libraries/networking/src/DomainHandler.cpp b/libraries/networking/src/DomainHandler.cpp index f34a93de96..64841295de 100644 --- a/libraries/networking/src/DomainHandler.cpp +++ b/libraries/networking/src/DomainHandler.cpp @@ -311,6 +311,7 @@ void DomainHandler::setIsConnected(bool isConnected) { _isConnected = isConnected; if (_isConnected) { + _lastDomainConnectionError = -1; emit connectedToDomain(_domainURL); if (_domainURL.scheme() == URL_SCHEME_HIFI && !_domainURL.host().isEmpty()) { diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index aaf5ca7260..e11891bb33 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -40,6 +40,7 @@ var DEFAULT_SCRIPTS_SEPARATE = [ if (Settings.getValue("enableInterstitialMode", false)) { DEFAULT_SCRIPTS_SEPARATE.push("system/interstitialPage.js"); + DEFAULT_SCRIPTS_SEPARATE.push("system/redirectOverlays.js"); } // add a menu item for debugging diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index 0c786dad87..c8a7dc3e83 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -178,7 +178,7 @@ localOrientation: Quat.fromVec3Degrees({ x: 0.0, y: 180.0, z: 0.0 }), parentID: anchorOverlay }); - + var TARGET_UPDATE_HZ = 60; // 50hz good enough, but we're using update var BASIC_TIMER_INTERVAL_MS = 1000 / TARGET_UPDATE_HZ; var lastInterval = Date.now(); @@ -347,7 +347,6 @@ Overlays.editOverlay(loadingBarPlacard, properties); Overlays.editOverlay(loadingBarProgress, loadingBarProperties); - Menu.setIsOptionChecked("Show Overlays", physicsEnabled); if (!HMD.active) { toolbar.writeProperty("visible", physicsEnabled); @@ -399,6 +398,18 @@ }; Overlays.editOverlay(loadingBarProgress, properties); + + + var hardRefusalErrorsIdx = hardRefusalErrors.indexOf(Window.getLastDomainConnectionError()); + + var redirectProperties = { + visible: (hardRefusalErrorsIdx >= 0) + }; + + Overlays.editOverlay(redirectOopsText, redirectProperties); + Overlays.editOverlay(tryAgainImage, redirectProperties); + Overlays.editOverlay(backImage, redirectProperties); + if ((physicsEnabled && (currentProgress >= (TOTAL_LOADING_PROGRESS - EPSILON)))) { updateOverlays((physicsEnabled || connectionToDomainFailed)); endAudio(); @@ -457,6 +468,9 @@ Overlays.deleteOverlay(loadingBarPlacard); Overlays.deleteOverlay(loadingBarProgress); Overlays.deleteOverlay(anchorOverlay); + Overlays.deleteOverlay(redirectOopsText); + Overlays.deleteOverlay(tryAgainImage); + Overlays.deleteOverlay(backImage); if (DEBUG) { tablet.removeButton(button); diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js new file mode 100644 index 0000000000..c3aca60a94 --- /dev/null +++ b/scripts/system/redirectOverlays.js @@ -0,0 +1,144 @@ +"use strict"; +(function() { + + var ERROR_MESSAGE_MAP = [ + "Oops! Protocol version mismatch.", + "Oops! Not authorized to join domain.", + "Oops! Connection timed out.", + "Oops! Something went wrong." + ]; + + var PROTOCOL_VERSION_MISMATCH = 1; + var NOT_AUTHORIZED = 3; + var TIMEOUT = 5; + var hardRefusalErrors = [PROTOCOL_VERSION_MISMATCH, + NOT_AUTHORIZED, TIMEOUT]; + var error = -1; + var timer = null; + + function getOopsText() { + error = Window.getLastDomainConnectionError(); + if (hardRefusalErrors.indexOf(error) >= 0) { + return ERROR_MESSAGE_MAP[error]; + } else { + // some other text. + return ERROR_MESSAGE_MAP[4]; + } + }; + + var redirectOopsText = Overlays.addOverlay("text3d", { + name: "oopsText", + // position: { x: 0.2656, y: 1.6764, z: 1.4593}, + position: { x: 0.0, y: 1.6764, z: 1.4593}, + text: getOopsText(), + textAlpha: 1, + backgroundAlpha: 0, + lineHeight: 0.13, + // dimensions: {x: 2.58, y: 2.58}, + visible: false, + emissive: true, + ignoreRayIntersection: false, + drawInFront: true, + grabbable: false, + orientation: {x: 0.0, y: 0.5, z: 0, w: 0.87}, + parentID: MyAvatar.SELF_ID + }); + print("redirect oops text = " + redirectOopsText); + + var tryAgainImage = Overlays.addOverlay("image3d", { + name: "tryAgainImage", + position: { x: 0.0, y: 1.0695, z: 1.9094}, + url: Script.resourcesPath() + "images/interstitialPage/button_tryAgain.png", + alpha: 1, + // dimensions: {x: 0.9, y: 0.4}, + visible: false, + emissive: true, + ignoreRayIntersection: false, + drawInFront: true, + grabbable: false, + orientation: {x: 0.0, y: 0.5, z: 0, w: 0.87}, + parentID: MyAvatar.SELF_ID + }); + print("try again image = " + tryAgainImage); + + var backImage = Overlays.addOverlay("image3d", { + name: "backImage", + position: { x: 0.525, y: 1.0695, z: 1.0186}, + url: Script.resourcesPath() + "images/interstitialPage/button_back.png", + alpha: 1, + // dimensions: {x: 0.9, y: 0.4}, + visible: false, + emissive: true, + ignoreRayIntersection: false, + drawInFront: true, + grabbable: false, + localOrientation: Quat.fromVec3Degrees({ x: 0.0, y: 180.0, z: 0.0 }), + orientation: {x: 0.0, y: 0.5, z: 0, w: 0.87}, + parentID: MyAvatar.SELF_ID + }); + print("back image = " + backImage); + + var TARGET_UPDATE_HZ = 60; + var BASIC_TIMER_INTERVAL_MS = 1000 / TARGET_UPDATE_HZ; + + function toggleOverlays() { + var overlaysVisible = false; + error = Window.getLastDomainConnectionError(); + var oopsText = ""; + if (error === -1) { + overlaysVisible = false; + } else if (hardRefusalErrors.indexOf(error) >= 0) { + overlaysVisible = true; + oopsText = ERROR_MESSAGE_MAP[error]; + } else { + overlaysVisible = true; + oopsText = ERROR_MESSAGE_MAP[4]; + } + var properties = { + visible: overlaysVisible + }; + var oopsTextProperties = { + visible: overlaysVisible, + text: oopsText + }; + + Overlays.editOverlay(redirectOopsText, oopsTextProperties); + Overlays.editOverlay(tryAgainImage, properties); + Overlays.editOverlay(backImage, properties) + } + + function clickedOnOverlay(overlayID, event) { + if (tryAgainImage === overlayID) { + location.goToLastAddress(); + } else if (backImage === overlayID) { + location.goBack(); + } + } + + function cleanup() { + timer = null; + Overlays.deleteOverlay(redirectOopsText); + Overlays.deleteOverlay(tryAgainImage); + Overlays.deleteOverlay(backImage); + } + + var whiteColor = {red: 255, green: 255, blue: 255}; + var greyColor = {red: 125, green: 125, blue: 125}; + Overlays.mouseReleaseOnOverlay.connect(clickedOnOverlay); + Overlays.hoverEnterOverlay.connect(function(overlayID, event) { + if (overlayID === backImage || overlayID === tryAgainImage) { + Overlays.editOverlay(overlayID, { color: greyColor }); + } + }); + + Overlays.hoverLeaveOverlay.connect(function(overlayID, event) { + if (overlayID === backImage || overlayID === tryAgainImage) { + Overlays.editOverlay(overlayID, { color: whiteColor }); + } + }); + + // timer = Script.setTimeout(update, BASIC_TIMER_INTERVAL_MS); + Script.update.connect(toggleOverlays); + + Script.scriptEnding.connect(cleanup); +}()); From 42579f3d167a67aa2f2a1ebd72f6a488b15fcbfa Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Tue, 25 Sep 2018 18:21:51 -0700 Subject: [PATCH 05/81] fixing oops dialog text index lookups --- scripts/system/redirectOverlays.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index c3aca60a94..fdd69fdab3 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -18,8 +18,9 @@ function getOopsText() { error = Window.getLastDomainConnectionError(); - if (hardRefusalErrors.indexOf(error) >= 0) { - return ERROR_MESSAGE_MAP[error]; + var errorMessageMapIndex = hardRefusalErrors.indexOf(error); + if (errorMessageMapIndex >= 0) { + return ERROR_MESSAGE_MAP[errorMessageMapIndex]; } else { // some other text. return ERROR_MESSAGE_MAP[4]; @@ -84,12 +85,13 @@ function toggleOverlays() { var overlaysVisible = false; error = Window.getLastDomainConnectionError(); + var errorMessageMapIndex = hardRefusalErrors.indexOf(error); var oopsText = ""; if (error === -1) { overlaysVisible = false; - } else if (hardRefusalErrors.indexOf(error) >= 0) { + } else if (errorMessageMapIndex >= 0) { overlaysVisible = true; - oopsText = ERROR_MESSAGE_MAP[error]; + oopsText = ERROR_MESSAGE_MAP[errorMessageMapIndex]; } else { overlaysVisible = true; oopsText = ERROR_MESSAGE_MAP[4]; From 54f800fbda08b9e859a050dcaf2b312540651f2f Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Tue, 25 Sep 2018 20:21:05 -0700 Subject: [PATCH 06/81] including images/parent buttons to text --- .../images/interstitialPage/button_back.png | Bin 0 -> 3842 bytes .../interstitialPage/button_tryAgain.png | Bin 0 -> 4512 bytes scripts/system/redirectOverlays.js | 26 ++++++++++-------- 3 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 interface/resources/images/interstitialPage/button_back.png create mode 100644 interface/resources/images/interstitialPage/button_tryAgain.png diff --git a/interface/resources/images/interstitialPage/button_back.png b/interface/resources/images/interstitialPage/button_back.png new file mode 100644 index 0000000000000000000000000000000000000000..cb9c9098361abd4aebc4778c26824e907ec290dc GIT binary patch literal 3842 zcmV~$2Ot#s0|4OPIU}O$Daw5ODTk{f>{;BK;~Q(dKv# zid#b7kqTv|m&7yBv4xU(g_4$f?Sb$~4cJ7DB}oTu3dCbY7R?V!kHA86hpn z@@+3>2idiico-qNt$*Xc(f%i+{BGK>apQF=1gNkOS3{Jd23W4E7696WRE;Fdi3{r@ zH@XXKZ@k=J*JoSGX{P*n)bnYnebh!-|+GR5S9+DunnTkQdT3<0)VtGPA+}d3KR!l<{ z_e-{i@G{&}j8vMi5Y~=L7HG3?jC-pMU#9&EMQ9!MxtzIJrwFo%=jyvXjQS zyD{1Qgn&}9Ur7fQyb~#Wl^^3IuMf!dbUSROp1*cb1djUUtFykSQz`nUQLONE8B))( zif}Q3xHq6SZ^;433tl8$T2`Cr*}Db9@8)0IFK#S;IQ4=68+!vIpU~6XvjeG4v;&f+ zht3|atc;VC&h+v%Vt@d`r$?mj^o4P)E5CKq-Ee7IvEOQc z3~nFR7By6YNB_O^*d2gcN(zo5Wr-h6txd4oG%v+d%?1H@`tYPrLR*Qe{N16r*`Vd# z1Tzroju;k?lq!j&F_{g%#`yyfSH9we;F`WzMwm5Gg@Wo4@e`BY&`c9m{iV|$Q`PpH z1PHh-;<&QYNcmPP?lD_%Gw~l;0E&(xL(txz2G~{#lK5BvP}HglOiQMrnCsNGDCUuA zp^vWta9h`gpp$BjoG_v5F>QL!w9W4^0ONn9^k-d}_V@;qwQ-gJh?@_){1Ob>Z;Bg( zj8wT>rmpZa1H|3v{;51yrs;j3jT_V}0E0Y|sn2C!dCukubJU4GJE^Dd*VqiO8TW-K z?W5K-WC(Wsld_Ti(6k3@2i}1@SZ`K^0U_YckJJd)_hUp{KTg@-461Mv2!4dgTlQM^ zQ)R46MTZ@~+`aHqa4Z~NXoF+JuqpMzPDZZ{T^YDB7qW1K(=9svE|Fk(v%-y)da;FF zA*RC+`wwHt2GUb8P#$v%LtfQt8|?Xa>Nz~wjaDQG;n)!2Ax-%;x<~M|wz8akuX)K+ z@>gm7h@sc8Cp+1*nWu$)g&V?gf6#&=Lm7M{3qdTwgA?xu2A}g-UD?ze8`f$=X9a59 zRn^depNcXy-p!BlbXM2(HI@9XzV42;2x&=m(X}rPc*P(QUB)@&pn&c`ex@8c9u`&E z8E&3%M*7!3I%Ha||EDgva@nyul+N&aP@ z^`9yN7R^&_5+lwB!OppX@h)~2YkE+Jc$kn1;aD27|4;C&M5n4~o`U_(NCKsgNU3~l zvqL6389EAF_)z+bWtXFBqs@#F^g)n_bWPjF@ zBVN{E62Wo6Zb0rJiPMN&?e3&nLHRwklCr~ho_x1WHH=Dr=(S8QKL(@h{mvT!c<63j zj!lC0nQd{7qFjT5r0J5p$*|XtupPC=)-G1GAmU$)WZ)>rTv={<&1a-szR0tmjq3Ed za_RbDO6)W47P(FTyiwvF|2cNopUOllf(j90_p6;ki>jToH4>aw_EcV@ z_eU)tyu~mZe{d2fMDff^WbH)hEVb|xTTdyQ34#^;q6Sllwp1y?5_G2Dn#x6mmDVTW zSJNddmm*&MwbuMAYuDzDzWGNj15RQ7+%DCow9U3@v%EpRr=3CS$x(Oy2tkhoy?QXd zMQuj*=Dj{Hp)k|6pH1(Zr_keCk~g*S$sAzzY~$iePm)?U;3k!oN79b^`guvWU+^ix z%Zf9)evGF20en&nWHZv)ykgqVR0}FsIsJi?i)b8&+_np4f{K zjDjP$IDU#wFDf4}hS_D&x_+Yb;apfHePpfk>qEsQOIWmfvIEsUN{aejNnswsXx2miBaN;yFynzRY4e~BApHSxRel^#j8|&tTNc-;kW93@1`_r`kA%|UO{a= zk6CSf^%vpG^~>4siLMBANDO&$6K-IN2<5bR*uqa*o*VNz96F*W>K5I7Sp6lWRnAIz0>W zQiKmG{v+<)TmZzEyU*TT(4pk=3}NTm1g9TI!T>^blo)b}FAAzuokUyRBLE=O9+~>` zd~7@7grynsUQew!i5U<$9V{O0tFT{MY1K4(wW^+`cnE;2#h^_13;#dqeU&d6;I!N! z8xi@4{^~mb2riXO1-Hr4bQ+e`UU*5(sYa*0$rNZ>wuFF=8`nC|RraS+V&*4L&d$!F z(P#(p%_^6AtFfB()Z-WcO7VYV8_wsg4LViNv4?3AwL2q4D?WGiZ% zKq@Xp8%*j;CDFc~otGXVP6{k|zM{?D9tb+iU<4Ghk?y5sAKGw}gbCIU6p~5;7 zXqunLk0vRso}eQbMos5-Y2G^3f91QCH7!Qh9;t}ptQPN|1{mt~0r%K>3G3sAm4kvL z<-;LwWx{{lJ4fH=8o~j9E8uRup+hPjEelL+eAL`rzPz#4;=NM zTh|)mO@@7CaNq1l^G1`7jKja`h;J(AF>nBkFB>(H-9}4coO6hGB!fZtEMVUWmRU0b zFutr*mtSZZbKiN1cUTyqpa{)>#7Q~U7<~=^;jLq~O3S56toKFg1QZD?*6pgfm9w*f zyW|Qm9Bfos`cn5l`!(fqI6l@DP2I#9O$V%}F6@{HK;^wREl9a8CVTjBK-K%96kavm z=D}#&ZB$UY=t;mO04#X=N|=)M@BN%Aujf)geu5l6CKoi;#+@W3@q+5NpM37Wk;)~1 z@X%tB>Sr8ToEH1NlVj(%$QJ+m2f$#1^pZO9%)z!YxifG|k0SCntKyFglk7fik=@9& z6=P;_`_)6v@BWX;5{?lTBQ=W1FFmisl@?>igq_ZYB}9bW-*5w=JHgKHGhr#`VkyGr zyN>2Dh419>buRCVZRC6mtDHr6$vdIi9?*_~_?oNFYPc~U`WEm(c04y?-VInps0?F` zig8USWBFSVMK|7_#jCpjvX?rx>wR?|Hcp{;NCHcAuTbmuxH3=&*U;5HJZ^ykA51;d zt~OJMcjkJ&U9l88TV`HEsUXw?K}YS{AS9BK4*ok&XmhZ@Uu!! z^O(X|f!%OMP%4&LglwbyH2gLU&okJ3J1&=e&&Tdh8vsnYm!+s9mVPG$N4(%V6sL5oY^0#K6drj z6389?jsalp4fW@Zecai{NFFxC?+EDmhOvZjra|1LG6n!tRoWWf65PX8s=8Muplv8i z2*1-{CXfLD(+2jyKCW$8j|k{ymGZs@bIRWp0AN$XdMN|i26NB;IMiwx0DxJOfWEXr z-6x>k!7SDC3Dq(HU_qo)*`!Cc|s983gt5BAUJz642Ts`@E$CInsxO@o3q5@z`_GtLi(MC^)#d~JeYMgoy_TA9GQnE?Ybn0`{tqRJC!m3pv`Pb&BI(9 zhf`M7Qc0h#WI$`P!qpUKDNEDM9RRQqVJ$&D&1fRIHoZ5CtV(9Mv(q$b6U+dBMF;hH z&5HU?L%P*Y%E^p&P(t}*%^mEUhaPeSGXP+bAuZW;Wa@QjZhbgbGJ_r4*UGt0^T1rY zt^)uNk!PvqSytm|2W^G)iv@?XTwwp@_VzaCPXPe1Ol&sY*~j(v_VzdX&p+G8pCX>t zv&(nv^Zv6m6?DyT&dnUUr~?4dQpVNoSJk%}cd+mZx@I`bBqM*d8~$J3asa@JRMWrN z%J^UQKYxl0>2A|Xx^V?vGn}P&_AzfY0APiy={mVL^)=}i4L4HGBK}=tBY)+s1pusg zH9fM`@n`#=e=*_f(sE7ut2}3J6?BcER13Qk2mk;xtfcD0;me>vAzHwBoCT=a|KSeBhz%^$8z$UR7nMGE~dolBX)UBXnx|LrL&H#W7tfVD$VdKMYkaDL6(0RX_W43%EpnP-v8 z2~4&EE8Y);v*6|z006ih7=Kf@^yWTt{g2Q!=##+z?{iOQ007)0P2Yty8Jl1n5%*g-Ab}gI0FDMl~9lF z#};f?Kp!?-IRF5tC~}Q|Ty)PF(0adTU+F#6FS+b71EhWTt{l)g3;=*ugqpd##R@tLtn7y4 z2>?JVLYbQVQ257ggR}>L)_wo}ecu#1t|m!x%2B~O7>~yTTP6Dz*)3MkzUJ+m-rJbt zmvZ*Kec2ium-m5ve7}Z&4l*Y6r0@XN$Wexv7faT(A=I-1Fw2puF z`OI+y7Fs>aXS5SotfR{TSp5pxOs+wPKGY+QBjzYKH7AviSUz8~>iJAR+*#>ZWNY?$ z<+}&#%=`D9Xa#+0JlA)|<8i`q#FAB%-=F*;TWh|*a(%ftkfWS5cmaxZj}0L)nB$@><^1{+*eckSb&hJY)iZUU8TOvQT_8S1g? zdsdB4a~)a(?2~Etnsr)pc?r)eyDhzz-`e*Y*r8!*UB?LkurvYvL&TG5;>J3X>M9fr zuFCWxBKV3y)u+k6P?w6L6?}NLD?}p-XvhJ_? z->)3U{oKrMD&dj7zRczDv!0L?-ybp7J@&O z-?h-vP~4wO^Kgwjcf9^p=~&5hq69RS&eqP(PR3!t2FtZ7mVlD6#RsL1NW(xyYaCT} zOvM}PO^piL7wo>1lgp~>uo{}hpzrCmYuB=Q%ns=~%Ym4-_?}+d*SPR(&vB{n;5!h@ z8PFU8Y$yqdw;IaFp6cx;5SYI38#U>@t-X-DG3(QSE$%~CpC5ZHd_K=0Ov{~5=Qc&D z<5-!hlMZ0f0ZkJ&HqnQeVK$CsGEbmpEmzNV*H@>C<^*ka6+F;RK##{`I)MT4!RM!?kKSGle~doM@T zxDH+3pMAUBk!u^Y$8+&J;I8V#LzkB^$TIo=Wa1aTKY$rl(7;BM4rDfXB>Xy_%C!8u zwue`xI;l$C6Y6Kxz78Lgp6kU>mRY^d&C_wvu8v!mp4Wcw*zQ~(a{N9Qem5Co4Q#q@ zD4>U?x;g9>#}Bx#i1!O&Ssu6B_VB9m`Z{L1PG7sm-5h_WUkq8`#Gt5hoU_gbR(!4m z@>@@}O=S)I@!59TYVu@YgM_C2EDo>ATbOjCt?4hbidKO;y>E2PiG-Y-$eh&&HBKmw zTet=fY=WOd74*n+=G^7@0oBufmhXDiw0d^jo$1-Q-GJiuNVT6<%&3)?KKFa2Me5vz z%XP;p0AXn;pnXFQIy*Z%o$+|gcxh~`z_g#`liQ}ltIF#e1gh6^@XEF1qtg2Njzx=i zfErQp0t-=996vU3hd!88(LnXIpRv<%#@cNd__5=md!;J9iM!aU0KfxV{CYnplYq{r zO?Y5~R89Mtl`7GuVV5-w{NWUz-}}2dX>)xW$L7S<5lkm4kqW;&wwlhUpn7%%^mshZ z182~Dc(Cyt(|#V=u=(Dw+ARlITB<&42fkxGbXw7Cy0}00_hz<_Pv6~smtkJ^aau99 zdf=#_zu09z>GOWqVhYi=CwG{Z}=ec@? zADj55?a45&6Aj*O>7+nT@?H1Jo($!R84c3qy9QLykMd$b`zBV9j$&Mg2K=9syB0cH zwKbl4=v%K=!RKbWVU!)Mgv*t?1pZkd^d~|7(mq~0wv*1N*a&+4*_W%sA4(tS6VJl$ zOueBVz%1?6T)tllgM7-@y)aK_+j`$(^(J1U3OrV!y;4BSsr(t2 z;O*&Le9`0|j?_*ZQu81n7|Gp(NYY_1Ny0j(DxgtIqeUxe0vdwYAgy}d1!cIH_u zm1XR*L*5Sn0M+w-)Am0Ci^*uHU#tG-R^)5Rga&zFnGhYx%U zLRG}$G^9$Z=BQaXYX!8H<1s7V*9`>#U=zaGbwPiJ#@Nsu zN%)#@J3Ao_09f~Mj%hKL>(0N_S@+ho8)aWedUcN?7Nxlx0I-hXd>R?fl9jdZ{+Kk} zxcgq)5tXzUm>O;G001m;I7=|^M=UCtC--?C)qRbmg^i543H6h+24tA8Je%NYvervU&h<&qSQJq_k`%4~W&%TCV8oDayU9*k+pY-BR8 z_ka#%0DviSNJ9CIiJJwi%3L}&Ckr?@Qboty&^jipZ_L94D!sUjTp_B#0+-X)OInpJbJf yv`)_^59vp&p0R{lj)4fZfwJUM}0000= 0) - }; - - Overlays.editOverlay(redirectOopsText, redirectProperties); - Overlays.editOverlay(tryAgainImage, redirectProperties); - Overlays.editOverlay(backImage, redirectProperties); - if ((physicsEnabled && (currentProgress >= (TOTAL_LOADING_PROGRESS - EPSILON)))) { updateOverlays((physicsEnabled || connectionToDomainFailed)); endAudio(); @@ -468,9 +457,6 @@ Overlays.deleteOverlay(loadingBarPlacard); Overlays.deleteOverlay(loadingBarProgress); Overlays.deleteOverlay(anchorOverlay); - Overlays.deleteOverlay(redirectOopsText); - Overlays.deleteOverlay(tryAgainImage); - Overlays.deleteOverlay(backImage); if (DEBUG) { tablet.removeButton(button); diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index b0caba7c52..5d37078a26 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -33,7 +33,7 @@ text: getOopsText(), textAlpha: 1, backgroundAlpha: 0, - lineHeight: 0.13, + lineHeight: 0.10, visible: false, emissive: true, ignoreRayIntersection: false, @@ -43,11 +43,10 @@ parentID: MyAvatar.SELF_ID, parentJointIndex: MyAvatar.getJointIndex("Head") }); - print("redirect oops text = " + redirectOopsText); var tryAgainImage = Overlays.addOverlay("image3d", { name: "tryAgainImage", - localPosition: { x: -0.15, y: -0.4, z: 0.0}, + localPosition: {x: -0.15, y: -0.4, z: 0.0}, url: Script.resourcesPath() + "images/interstitialPage/button_tryAgain.png", alpha: 1, visible: false, @@ -58,12 +57,10 @@ orientation: {x: 0.0, y: 0.5, z: 0, w: 0.87}, parentID: redirectOopsText }); - print("try again image = " + tryAgainImage); - Window.copyToClipboard(redirectOopsText); var backImage = Overlays.addOverlay("image3d", { name: "backImage", - localPosition: { x: 1.0, y: -0.4, z: 0.0}, + localPosition: {x: 1.0, y: -0.4, z: 0.0}, url: Script.resourcesPath() + "images/interstitialPage/button_back.png", alpha: 1, visible: false, @@ -74,7 +71,6 @@ orientation: {x: 0.0, y: 0.5, z: 0, w: 0.87}, parentID: redirectOopsText }); - print("back image = " + backImage); var TARGET_UPDATE_HZ = 60; var BASIC_TIMER_INTERVAL_MS = 1000 / TARGET_UPDATE_HZ; @@ -84,7 +80,7 @@ error = Window.getLastDomainConnectionError(); var errorMessageMapIndex = hardRefusalErrors.indexOf(error); var oopsText = ""; - if (error === -1) { + if (error === -1 || !Window.isPhysicsEnabled() || location.isConnected) { overlaysVisible = false; } else if (errorMessageMapIndex >= 0) { overlaysVisible = true; @@ -96,6 +92,7 @@ var properties = { visible: overlaysVisible }; + var oopsTextProperties = { visible: overlaysVisible, text: oopsText @@ -121,6 +118,7 @@ } function cleanup() { + Script.clearInterval(timer); timer = null; Overlays.deleteOverlay(redirectOopsText); Overlays.deleteOverlay(tryAgainImage); @@ -142,8 +140,8 @@ } }); - // timer = Script.setTimeout(update, BASIC_TIMER_INTERVAL_MS); - Script.update.connect(toggleOverlays); + timer = Script.setInterval(toggleOverlays, 500); + // Script.update.connect(toggleOverlays); Script.scriptEnding.connect(cleanup); }()); From be87773b2c9d5e0bcd6cad9cb895217502381219 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 26 Sep 2018 10:46:19 -0700 Subject: [PATCH 09/81] Checkpoint sysTray Installer --- cmake/macros/SetPackagingParameters.cmake | 10 +- cmake/templates/CPackProperties.cmake.in | 2 +- cmake/templates/NSIS.template.in | 173 +++++++++++----------- server-console/CMakeLists.txt | 4 +- server-console/src/main.js | 76 +++++----- server-console/src/modules/hf-app.js | 2 +- 6 files changed, 127 insertions(+), 140 deletions(-) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 0f8975e9b5..164d326b20 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -18,7 +18,7 @@ macro(SET_PACKAGING_PARAMETERS) set(BUILD_GLOBAL_SERVICES "DEVELOPMENT") set(USE_STABLE_GLOBAL_SERVICES 0) set(BUILD_NUMBER 0) - set(APP_USER_MODEL_ID "com.highfidelity.sandbox-dev") + set(APP_USER_MODEL_ID "com.highfidelity.console") set_from_env(RELEASE_TYPE RELEASE_TYPE "DEV") set_from_env(RELEASE_NUMBER RELEASE_NUMBER "") @@ -176,15 +176,15 @@ macro(SET_PACKAGING_PARAMETERS) # shortcut names if (PRODUCTION_BUILD) set(INTERFACE_SHORTCUT_NAME "High Fidelity Interface") - set(CONSOLE_SHORTCUT_NAME "Sandbox") - set(APP_USER_MODEL_ID "com.highfidelity.sandbox") + set(CONSOLE_SHORTCUT_NAME "High Fidelity Console") + set(APP_USER_MODEL_ID "com.highfidelity.console") else () set(INTERFACE_SHORTCUT_NAME "High Fidelity Interface - ${BUILD_VERSION_NO_SHA}") - set(CONSOLE_SHORTCUT_NAME "Sandbox - ${BUILD_VERSION_NO_SHA}") + set(CONSOLE_SHORTCUT_NAME "High Fidelity Console - ${BUILD_VERSION_NO_SHA}") endif () set(INTERFACE_HF_SHORTCUT_NAME "${INTERFACE_SHORTCUT_NAME}") - set(CONSOLE_HF_SHORTCUT_NAME "High Fidelity ${CONSOLE_SHORTCUT_NAME}") + set(CONSOLE_HF_SHORTCUT_NAME "${CONSOLE_SHORTCUT_NAME}") set(PRE_SANDBOX_INTERFACE_SHORTCUT_NAME "High Fidelity") set(PRE_SANDBOX_CONSOLE_SHORTCUT_NAME "Server Console") diff --git a/cmake/templates/CPackProperties.cmake.in b/cmake/templates/CPackProperties.cmake.in index 1d7effd18f..0a56181138 100644 --- a/cmake/templates/CPackProperties.cmake.in +++ b/cmake/templates/CPackProperties.cmake.in @@ -13,7 +13,7 @@ set(INTERFACE_DISPLAY_NAME "Interface") set(INTERFACE_SHORTCUT_NAME "@INTERFACE_SHORTCUT_NAME@") set(INTERFACE_HF_SHORTCUT_NAME "@INTERFACE_HF_SHORTCUT_NAME@") set(INTERFACE_WIN_EXEC_NAME "@INTERFACE_EXEC_PREFIX@.exe") -set(CONSOLE_DISPLAY_NAME "Sandbox") +set(CONSOLE_DISPLAY_NAME "Console") set(CONSOLE_INSTALL_SUBDIR "@CONSOLE_INSTALL_DIR@") set(CONSOLE_SHORTCUT_NAME "@CONSOLE_SHORTCUT_NAME@") set(CONSOLE_HF_SHORTCUT_NAME "@CONSOLE_HF_SHORTCUT_NAME@") diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index 7f6884f478..b7564f45e5 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -405,6 +405,14 @@ Var GAClientID Section "-Previous Install Cleanup" ; Remove the resources folder so we don't end up including removed QML files RMDir /r "$INSTDIR\resources" + + ; delete old assignment-client and domain-server so they're no longer present + ; in client only installs. + Delete "$INSTDIR\@DS_EXEC_NAME@" + Delete "$INSTDIR\@AC_EXEC_NAME@" + + ; delete interface so it's not there for server-only installs + Delete "$INSTDIR\@INTERFACE_WIN_EXEC_NAME@" SectionEnd @CPACK_NSIS_INSTALLATION_TYPES@ @@ -532,9 +540,9 @@ SectionEnd Var PostInstallDialog Var DesktopClientCheckbox -Var DesktopServerCheckbox -Var ServerStartupCheckbox -Var LaunchServerNowCheckbox +Var DesktopConsoleCheckbox +Var ConsoleStartupCheckbox +Var LaunchConsoleNowCheckbox Var LaunchClientNowCheckbox Var CleanInstallCheckbox Var CurrentOffset @@ -746,28 +754,8 @@ Function PostInstallOptionsPage !insertmacro SetInstallOption $DesktopClientCheckbox @CLIENT_DESKTOP_SHORTCUT_REG_KEY@ ${BST_CHECKED} ${EndIf} - ${If} @SERVER_COMPONENT_CONDITIONAL@ - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @CONSOLE_HF_SHORTCUT_NAME@" - Pop $DesktopServerCheckbox - IntOp $CurrentOffset $CurrentOffset + 15 - - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $DesktopServerCheckbox @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ ${BST_UNCHECKED} - ${EndIf} - - ${If} @SERVER_COMPONENT_CONDITIONAL@ - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ after install" - Pop $LaunchServerNowCheckbox - - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $LaunchServerNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} - ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE - ${IfNot} $substringResult == "" - ${NSD_SetState} $LaunchServerNowCheckbox ${BST_UNCHECKED} - ${EndIf} - - IntOp $CurrentOffset $CurrentOffset + 15 - ${EndIf} + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $DesktopConsoleCheckbox @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ ${BST_UNCHECKED} ${If} @CLIENT_COMPONENT_CONDITIONAL@ ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @INTERFACE_HF_SHORTCUT_NAME@ after install" @@ -782,28 +770,42 @@ Function PostInstallOptionsPage ${EndIf} ${EndIf} - ${If} @SERVER_COMPONENT_CONDITIONAL@ - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ on startup" - Pop $ServerStartupCheckbox - IntOp $CurrentOffset $CurrentOffset + 15 + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @CONSOLE_HF_SHORTCUT_NAME@" + Pop $DesktopConsoleCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $ServerStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED} + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ after install" + Pop $LaunchConsoleNowCheckbox + + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $LaunchConsoleNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} + ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE + ${IfNot} $substringResult == "" + ${NSD_SetState} $LaunchConsoleNowCheckbox ${BST_UNCHECKED} ${EndIf} + IntOp $CurrentOffset $CurrentOffset + 15 + + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ on startup" + Pop $ConsoleStartupCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 + + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $ConsoleStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED} + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Perform a clean install (Delete older settings and content)" Pop $CleanInstallCheckbox IntOp $CurrentOffset $CurrentOffset + 15 ${If} @PR_BUILD@ == 1 - ; a PR build defaults all install options expect LaunchServerNowCheckbox, LaunchClientNowCheckbox and the settings copy to unchecked + ; a PR build defaults all install options expect LaunchConsoleNowCheckbox, LaunchClientNowCheckbox and the settings copy to unchecked ${If} @CLIENT_COMPONENT_CONDITIONAL@ ${NSD_SetState} $DesktopClientCheckbox ${BST_UNCHECKED} ${EndIf} ${If} @SERVER_COMPONENT_CONDITIONAL@ - ${NSD_SetState} $DesktopServerCheckbox ${BST_UNCHECKED} - ${NSD_SetState} $ServerStartupCheckbox ${BST_UNCHECKED} + ${NSD_SetState} $DesktopConsoleCheckbox ${BST_UNCHECKED} + ${NSD_SetState} $ConsoleStartupCheckbox ${BST_UNCHECKED} ${EndIf} ; push the offset @@ -824,9 +826,9 @@ FunctionEnd !macroend Var DesktopClientState -Var DesktopServerState -Var ServerStartupState -Var LaunchServerNowState +Var DesktopConsoleState +Var ConsoleStartupState +Var LaunchConsoleNowState Var LaunchClientNowState Var CopyFromProductionState Var CleanInstallState @@ -842,11 +844,11 @@ Function ReadInstallTypes StrCpy $Express "1" StrCpy $DesktopClientState ${BST_CHECKED} - StrCpy $ServerStartupState ${BST_CHECKED} - StrCpy $LaunchServerNowState ${BST_CHECKED} + StrCpy $ConsoleStartupState ${BST_CHECKED} + StrCpy $LaunchConsoleNowState ${BST_CHECKED} StrCpy $LaunchClientNowState ${BST_CHECKED} StrCpy $CleanInstallState ${BST_UNCHECKED} - StrCpy $DesktopServerState ${BST_UNCHECKED} + StrCpy $DesktopConsoleState ${BST_UNCHECKED} ${If} @PR_BUILD@ == 1 StrCpy $CopyFromProductionState ${BST_UNCHECKED} @@ -860,28 +862,25 @@ Function ReadInstallTypes FunctionEnd Function ReadPostInstallOptions + + ; check if the user asked for a desktop shortcut to console + ${NSD_GetState} $DesktopConsoleCheckbox $DesktopConsoleState + + ; check if the user asked to have console launched every startup + ${NSD_GetState} $ConsoleStartupCheckbox $ConsoleStartupState + ${If} @CLIENT_COMPONENT_CONDITIONAL@ ; check if the user asked for a desktop shortcut to High Fidelity ${NSD_GetState} $DesktopClientCheckbox $DesktopClientState ${EndIf} - ${If} @SERVER_COMPONENT_CONDITIONAL@ - ; check if the user asked for a desktop shortcut to Sandbox - ${NSD_GetState} $DesktopServerCheckbox $DesktopServerState - - ; check if the user asked to have Sandbox launched every startup - ${NSD_GetState} $ServerStartupCheckbox $ServerStartupState - ${EndIf} - ${If} @PR_BUILD@ == 1 ; check if we need to copy settings/content from production for this PR build ${NSD_GetState} $CopyFromProductionCheckbox $CopyFromProductionState ${EndIf} - ${If} @SERVER_COMPONENT_CONDITIONAL@ - ; check if we need to launch the server post-install - ${NSD_GetState} $LaunchServerNowCheckbox $LaunchServerNowState - ${EndIf} + ; check if we need to launch the console post-install + ${NSD_GetState} $LaunchConsoleNowCheckbox $LaunchConsoleNowState ${If} @CLIENT_COMPONENT_CONDITIONAL@ ; check if we need to launch the client post-install @@ -893,6 +892,17 @@ Function ReadPostInstallOptions FunctionEnd Function HandlePostInstallOptions + + ; check if the user asked for a desktop shortcut to the console + ${If} $DesktopConsoleState == ${BST_CHECKED} + CreateShortCut "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" + !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ YES + ; Set appUserModelId + ApplicationID::Set "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" + ${Else} + !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ NO + ${EndIf} + ${If} @CLIENT_COMPONENT_CONDITIONAL@ ; check if the user asked for a desktop shortcut to High Fidelity ${If} $DesktopClientState == ${BST_CHECKED} @@ -901,38 +911,24 @@ Function HandlePostInstallOptions ${Else} !insertmacro WriteInstallOption @CLIENT_DESKTOP_SHORTCUT_REG_KEY@ NO ${EndIf} - ${EndIf} - ${If} @SERVER_COMPONENT_CONDITIONAL@ - ; check if the user asked for a desktop shortcut to Sandbox - ${If} $DesktopServerState == ${BST_CHECKED} - CreateShortCut "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" - !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ YES - ; Set appUserModelId - ApplicationID::Set "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" - ${Else} - !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ NO - ${EndIf} + ; check if the user asked to have Console launched every startup + ${If} $ConsoleStartupState == ${BST_CHECKED} + ; in case we added a shortcut in the global context, pull that now + SetShellVarContext all + Delete "$SMSTARTUP\@PRE_SANDBOX_CONSOLE_SHORTCUT_NAME@.lnk" + ; make a startup shortcut in this user's current context + SetShellVarContext current + CreateShortCut "$SMSTARTUP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" - ; check if the user asked to have Sandbox launched every startup - ${If} $ServerStartupState == ${BST_CHECKED} - ; in case we added a shortcut in the global context, pull that now - SetShellVarContext all - Delete "$SMSTARTUP\@PRE_SANDBOX_CONSOLE_SHORTCUT_NAME@.lnk" + ; reset the shell var context back + SetShellVarContext all - ; make a startup shortcut in this user's current context - SetShellVarContext current - CreateShortCut "$SMSTARTUP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" - - ; reset the shell var context back - SetShellVarContext all - - !insertmacro WriteInstallOption @CONSOLE_STARTUP_REG_KEY@ YES - ${Else} - !insertmacro WriteInstallOption @CONSOLE_STARTUP_REG_KEY@ NO - ${EndIf} + !insertmacro WriteInstallOption @CONSOLE_STARTUP_REG_KEY@ YES + ${Else} + !insertmacro WriteInstallOption @CONSOLE_STARTUP_REG_KEY@ NO ${EndIf} ; check if the user asked for a clean install @@ -982,16 +978,15 @@ Function HandlePostInstallOptions ${EndIf} ${EndIf} - ${If} @SERVER_COMPONENT_CONDITIONAL@ - ${AndIf} $LaunchServerNowState == ${BST_CHECKED} + ${If} $LaunchConsoleNowState == ${BST_CHECKED} !insertmacro WriteInstallOption @SERVER_LAUNCH_NOW_REG_KEY@ YES ; both launches use the explorer trick in case the user has elevated permissions for the installer ${If} $LaunchClientNowState == ${BST_CHECKED} !insertmacro WriteInstallOption @CLIENT_LAUNCH_NOW_REG_KEY@ YES ; create shortcut with ARGUMENTS - CreateShortCut "$TEMP\SandboxShortcut.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" "-- --launchInterface" - Exec '"$WINDIR\explorer.exe" "$TEMP\SandboxShortcut.lnk"' + CreateShortCut "$TEMP\ConsoleShortcut.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" "-- --launchInterface" + Exec '"$WINDIR\explorer.exe" "$TEMP\ConsoleShortcut.lnk"' ${Else} !insertmacro WriteInstallOption @CLIENT_LAUNCH_NOW_REG_KEY@ NO Exec '"$WINDIR\explorer.exe" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@"' @@ -1164,13 +1159,11 @@ Section "-Core installation" ${EndIf} - ; Conditional handling for server console shortcut - ${If} @SERVER_COMPONENT_CONDITIONAL@ - CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" \ - "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" - ; Set appUserModelId - ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" - ${EndIf} + ; handling for server console shortcut + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" \ + "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" + ; Set appUserModelId + ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\@UNINSTALLER_NAME@" diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index 1c6e40c582..bdcefda5d8 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -19,7 +19,7 @@ set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Server Console") set_target_properties(${TARGET_NAME}-npm-install PROPERTIES FOLDER "hidden/Server Console") # add a dependency from the package target to the server components -add_dependencies(${TARGET_NAME} assignment-client domain-server) +add_dependencies(${TARGET_NAME} assignment-client domain-server interface) # set the packaged console folder depending on platform, so we can copy it if (APPLE) @@ -36,6 +36,7 @@ if (APPLE) PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${SERVER_COMPONENT} + COMPONENT ${CLIENT_COMPONENT} ) elseif (WIN32) set(CONSOLE_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}") @@ -44,6 +45,7 @@ elseif (WIN32) DIRECTORY "${CONSOLE_DESTINATION}/" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${SERVER_COMPONENT} + COMPONENT ${CLIENT_COMPONENT} ) # sign the copied server console executable after install diff --git a/server-console/src/main.js b/server-console/src/main.js index 95b5935255..08692fbd50 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -104,12 +104,12 @@ userConfig.load(configPath); const ipcMain = electron.ipcMain; -function isServerInstalled() { - return interfacePath && userConfig.get("serverInstalled", true); +function isInterfaceInstalled() { + return interfacePath; } -function isInterfaceInstalled() { - return dsPath && acPath && userConfig.get("interfaceInstalled", true); +function isServerInstalled() { + return dsPath && acPath; } var isShuttingDown = false; @@ -263,6 +263,10 @@ interfacePath = pathFinder.discoveredPath("Interface", binaryType, buildInfo.rel dsPath = pathFinder.discoveredPath("domain-server", binaryType, buildInfo.releaseType); acPath = pathFinder.discoveredPath("assignment-client", binaryType, buildInfo.releaseType); +console.log("Domain Server Path: " + dsPath); +console.log("Assignment Client Path: " + acPath); +console.log("Interface Path: " + interfacePath); + function binaryMissingMessage(displayName, executableName, required) { var message = "The " + displayName + " executable was not found.\n"; @@ -286,18 +290,6 @@ function binaryMissingMessage(displayName, executableName, required) { return message; } -// if at this point any of the paths are null, we're missing something we wanted to find - -if (!dsPath) { - dialog.showErrorBox("Domain Server Not Found", binaryMissingMessage("domain-server", "domain-server", true)); - app.exit(0); -} - -if (!acPath) { - dialog.showErrorBox("Assignment Client Not Found", binaryMissingMessage("assignment-client", "assignment-client", true)); - app.exit(0); -} - function openFileBrowser(path) { // Add quotes around path path = '"' + path + '"'; @@ -815,33 +807,33 @@ function onContentLoaded() { // Disable splash window for now. // maybeShowSplash(); - if (buildInfo.releaseType == 'PRODUCTION' && !argv.noUpdater) { - - const CHECK_FOR_UPDATES_INTERVAL_SECONDS = 60 * 30; - var hasShownUpdateNotification = false; - const updateChecker = new updater.UpdateChecker(buildInfo, CHECK_FOR_UPDATES_INTERVAL_SECONDS); - updateChecker.on('update-available', function(latestVersion, url) { - if (!hasShownUpdateNotification) { - notifier.notify({ - icon: notificationIcon, - title: 'An update is available!', - message: 'High Fidelity version ' + latestVersion + ' is available', - wait: true, - appID: buildInfo.appUserModelId, - url: url - }); - hasShownUpdateNotification = true; - } - }); - notifier.on('click', function(notifierObject, options) { - log.debug("Got click", options.url); - shell.openExternal(options.url); - }); - } - - deleteOldFiles(logPath, DELETE_LOG_FILES_OLDER_THAN_X_SECONDS, LOG_FILE_REGEX); - if (isServerInstalled()) { + if (buildInfo.releaseType == 'PRODUCTION' && !argv.noUpdater) { + + const CHECK_FOR_UPDATES_INTERVAL_SECONDS = 60 * 30; + var hasShownUpdateNotification = false; + const updateChecker = new updater.UpdateChecker(buildInfo, CHECK_FOR_UPDATES_INTERVAL_SECONDS); + updateChecker.on('update-available', function(latestVersion, url) { + if (!hasShownUpdateNotification) { + notifier.notify({ + icon: notificationIcon, + title: 'An update is available!', + message: 'High Fidelity version ' + latestVersion + ' is available', + wait: true, + appID: buildInfo.appUserModelId, + url: url + }); + hasShownUpdateNotification = true; + } + }); + notifier.on('click', function(notifierObject, options) { + log.debug("Got click", options.url); + shell.openExternal(options.url); + }); + } + + deleteOldFiles(logPath, DELETE_LOG_FILES_OLDER_THAN_X_SECONDS, LOG_FILE_REGEX); + var dsArguments = ['--get-temp-name', '--parent-pid', process.pid]; domainServer = new Process('domain-server', dsPath, dsArguments, logPath); diff --git a/server-console/src/modules/hf-app.js b/server-console/src/modules/hf-app.js index 625715b392..1b1171baef 100644 --- a/server-console/src/modules/hf-app.js +++ b/server-console/src/modules/hf-app.js @@ -34,7 +34,7 @@ exports.getBuildInfo = function() { buildNumber: "0", stableBuild: "0", organization: "High Fidelity - dev", - appUserModelId: "com.highfidelity.sandbox-dev" + appUserModelId: "com.highfidelity.console" }; var buildInfo = DEFAULT_BUILD_INFO; From 7e138ebfff00edee42a2f3f4868bc3769ed62a9d Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 26 Sep 2018 10:52:45 -0700 Subject: [PATCH 10/81] update to new enabling method --- interface/src/Application.cpp | 15 ++++++++++----- interface/src/octree/SafeLanding.cpp | 3 +-- scripts/defaultScripts.js | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index e0d2ab2586..e6a3ca30f3 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6240,14 +6240,19 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType) { const bool isModifiedQuery = !_physicsEnabled; if (isModifiedQuery) { // Create modified view that is a simple sphere. + bool interstitialModeEnabled = DependencyManager::get()->getDomainHandler().getInterstitialModeEnabled(); ConicalViewFrustum sphericalView; - ConicalViewFrustum farView; - - farView.set(_viewFrustum); - sphericalView.setSimpleRadius(INITIAL_QUERY_RADIUS); - _octreeQuery.setConicalViews({ sphericalView, farView }); + + if (interstitialModeEnabled) { + ConicalViewFrustum farView; + farView.set(_viewFrustum); + _octreeQuery.setConicalViews({ sphericalView, farView }); + } else { + _octreeQuery.setConicalViews({ sphericalView }); + } + _octreeQuery.setOctreeSizeScale(DEFAULT_OCTREE_SIZE_SCALE); static constexpr float MIN_LOD_ADJUST = -20.0f; _octreeQuery.setBoundaryLevelAdjust(MIN_LOD_ADJUST); diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index ba6e1dac8a..5c11c3251f 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -181,8 +181,7 @@ bool SafeLanding::isEntityLoadingComplete() { auto entityTree = qApp->getEntities(); auto entityMapIter = _trackedEntities.begin(); - Settings settings; - bool enableInterstitial = settings.value("enableIntersitialMode", false).toBool(); + bool enableInterstitial = DependencyManager::get()->getDomainHandler().getInterstitialModeEnabled(); while (entityMapIter != _trackedEntities.end()) { auto entity = entityMapIter->second; diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index aaf5ca7260..3f015930f4 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -38,7 +38,7 @@ var DEFAULT_SCRIPTS_SEPARATE = [ //"system/chat.js" ]; -if (Settings.getValue("enableInterstitialMode", false)) { +if (Window.interstitialModeEnabled) { DEFAULT_SCRIPTS_SEPARATE.push("system/interstitialPage.js"); } From 2c6e9349ebd87c775fd58e63582015ab3bbbe595 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 26 Sep 2018 12:59:15 -0700 Subject: [PATCH 11/81] SysTray Setup. server-console.exe should be included in client-only installs. By default, on new install, tray notifier should be enabled. --- server-console/CMakeLists.txt | 12 ++++++++++-- server-console/src/main.js | 16 +++++++--------- server-console/src/modules/hf-notifications.js | 4 ++-- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index bdcefda5d8..16189dff9d 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -36,7 +36,11 @@ if (APPLE) PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${SERVER_COMPONENT} - COMPONENT ${CLIENT_COMPONENT} + ) + install( + PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + DESTINATION ${CONSOLE_INSTALL_DIR} + COMPONENT ${CLIENT_COMPONENT} ) elseif (WIN32) set(CONSOLE_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}") @@ -45,7 +49,11 @@ elseif (WIN32) DIRECTORY "${CONSOLE_DESTINATION}/" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${SERVER_COMPONENT} - COMPONENT ${CLIENT_COMPONENT} + ) + install( + DIRECTORY "${CONSOLE_DESTINATION}/" + DESTINATION ${CONSOLE_INSTALL_DIR} + COMPONENT ${CLIENT_COMPONENT} ) # sign the copied server console executable after install diff --git a/server-console/src/main.js b/server-console/src/main.js index 08692fbd50..cfde72e3bc 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -509,11 +509,13 @@ function buildMenuArray(serverState) { menuArray.push(labels.share); menuArray.push(separator); if (isInterfaceInstalled()) { - menuArray.push(labels.goto); - menuArray.push(labels.people); - menuArray.push(labels.wallet); - menuArray.push(labels.marketplace); - menuArray.push(separator); + if(trayNotifications.enabled()) { + menuArray.push(labels.goto); + menuArray.push(labels.people); + menuArray.push(labels.wallet); + menuArray.push(labels.marketplace); + menuArray.push(separator); + } menuArray.push(labels.showNotifications); menuArray.push(separator); } @@ -545,10 +547,6 @@ function updateLabels(serverState) { } labels.showNotifications.checked = trayNotifications.enabled(); - labels.people.visible = trayNotifications.enabled(); - labels.goto.visible = trayNotifications.enabled(); - labels.wallet.visible = trayNotifications.enabled(); - labels.marketplace.visible = trayNotifications.enabled(); labels.goto.icon = pendingNotifications[HifiNotificationType.GOTO] ? menuNotificationIcon : null; labels.people.icon = pendingNotifications[HifiNotificationType.PEOPLE] ? menuNotificationIcon : null; labels.wallet.icon = pendingNotifications[HifiNotificationType.WALLET] ? menuNotificationIcon : null; diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index a9ee2489a9..a95a553631 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -139,7 +139,7 @@ function HifiNotifications(config, menuNotificationCallback) { HifiNotifications.prototype = { enable: function (enabled) { - this.config.set("enableTrayNotifications", enabled); + this.config.set("disableTrayNotifications", !enabled); if (enabled) { var _this = this; this.storiesPollTimer = setInterval(function () { @@ -185,7 +185,7 @@ HifiNotifications.prototype = { } }, enabled: function () { - return this.config.get("enableTrayNotifications", true); + return !this.config.get("disableTrayNotifications", false); }, stopPolling: function () { this.config.set("storiesNotifySince", this.storiesSince.toISOString()); From 5949679c0a25769267e70bc01bf5b58b5e77514b Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 26 Sep 2018 13:00:37 -0700 Subject: [PATCH 12/81] Add mac interface-run detection to server-console --- server-console/src/modules/hf-process.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server-console/src/modules/hf-process.js b/server-console/src/modules/hf-process.js index cf94ec6b29..35da07af9c 100644 --- a/server-console/src/modules/hf-process.js +++ b/server-console/src/modules/hf-process.js @@ -275,6 +275,9 @@ Process.prototype = extend(Process.prototype, { }); } else if (os.type == 'Darwin') { console.log("TODO IsRunning Darwin"); + childProcess.exec('ps cax | grep interface', function (err, stdout, stderr) { + done(stdout.length > 0); + }); } }, From db41a1c16b22f42ae9f827f58ded23f5ed7e64e0 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Wed, 26 Sep 2018 13:48:15 -0700 Subject: [PATCH 13/81] error state signal for 404/interstitial --- interface/src/octree/SafeLanding.cpp | 2 +- .../scripting/WindowScriptingInterface.cpp | 1 + .../src/scripting/WindowScriptingInterface.h | 8 +++ libraries/networking/src/DomainHandler.cpp | 2 + libraries/networking/src/DomainHandler.h | 3 +- scripts/defaultScripts.js | 2 +- scripts/system/interstitialPage.js | 38 +++++++++++-- scripts/system/redirectOverlays.js | 55 +++++++++++-------- 8 files changed, 78 insertions(+), 33 deletions(-) diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index 5d4ebe9853..333d76be66 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -172,7 +172,7 @@ bool SafeLanding::isEntityLoadingComplete() { bool isVisuallyReady = true; Settings settings; - bool enableInterstitial = settings.value("enableIntersitialMode", false).toBool(); + bool enableInterstitial = DependencyManager::get()->getDomainHandler().getInterstitialModeEnabled(); if (enableInterstitial) { isVisuallyReady = (entity->isVisuallyReady() || !entityTree->renderableForEntityId(entityMapIter->first)); diff --git a/interface/src/scripting/WindowScriptingInterface.cpp b/interface/src/scripting/WindowScriptingInterface.cpp index d4eb37e0aa..4ebfc6411a 100644 --- a/interface/src/scripting/WindowScriptingInterface.cpp +++ b/interface/src/scripting/WindowScriptingInterface.cpp @@ -39,6 +39,7 @@ WindowScriptingInterface::WindowScriptingInterface() { connect(&domainHandler, &DomainHandler::disconnectedFromDomain, this, &WindowScriptingInterface::disconnectedFromDomain); connect(&domainHandler, &DomainHandler::domainConnectionRefused, this, &WindowScriptingInterface::domainConnectionRefused); + connect(&domainHandler, &DomainHandler::redirectErrorStateChanged, this, &WindowScriptingInterface::redirectErrorStateChanged); connect(qApp, &Application::svoImportRequested, [this](const QString& urlString) { static const QMetaMethod svoImportRequestedSignal = diff --git a/interface/src/scripting/WindowScriptingInterface.h b/interface/src/scripting/WindowScriptingInterface.h index ddd7159f23..f6a5a5ef74 100644 --- a/interface/src/scripting/WindowScriptingInterface.h +++ b/interface/src/scripting/WindowScriptingInterface.h @@ -611,6 +611,14 @@ signals: */ void domainConnectionRefused(const QString& reasonMessage, int reasonCode, const QString& extraInfo); + /**jsdoc + * Triggered when you try to visit a domain but are redirected into the error state. + * @function Window.redirectErrorStateChanged + * @param {boolean} isInErrorState - If true, the user has been redirected to the error URL. + * @returns {Signal} + */ + void redirectErrorStateChanged(bool isInErrorState); + /**jsdoc * Triggered when a still snapshot has been taken by calling {@link Window.takeSnapshot|takeSnapshot} with * includeAnimated = false or {@link Window.takeSecondaryCameraSnapshot|takeSecondaryCameraSnapshot}. diff --git a/libraries/networking/src/DomainHandler.cpp b/libraries/networking/src/DomainHandler.cpp index 043465d18e..3ff8f29cd0 100644 --- a/libraries/networking/src/DomainHandler.cpp +++ b/libraries/networking/src/DomainHandler.cpp @@ -123,6 +123,7 @@ void DomainHandler::hardReset() { softReset(); _isInErrorState = false; + emit redirectErrorStateChanged(_isInErrorState); qCDebug(networking) << "Hard reset in NodeList DomainHandler."; _pendingDomainID = QUuid(); @@ -362,6 +363,7 @@ void DomainHandler::setRedirectErrorState(QUrl errorUrl, QString reasonMessage, if (getInterstitialModeEnabled()) { _errorDomainURL = errorUrl; _isInErrorState = true; + emit redirectErrorStateChanged(_isInErrorState); emit redirectToErrorDomainURL(_errorDomainURL); } else { emit domainConnectionRefused(reasonMessage, reasonCode, extraInfo); diff --git a/libraries/networking/src/DomainHandler.h b/libraries/networking/src/DomainHandler.h index e9ec20ba2e..8cf84b602a 100644 --- a/libraries/networking/src/DomainHandler.h +++ b/libraries/networking/src/DomainHandler.h @@ -187,8 +187,6 @@ private slots: signals: void domainURLChanged(QUrl domainURL); - void domainConnectionErrorChanged(int reasonCode); - // NOTE: the emission of completedSocketDiscovery does not mean a connection to DS is established // It means that, either from DNS lookup or ICE, we think we have a socket we can talk to DS on void completedSocketDiscovery(); @@ -205,6 +203,7 @@ signals: void domainConnectionRefused(QString reasonMessage, int reason, const QString& extraInfo); void redirectToErrorDomainURL(QUrl errorDomainURL); + void redirectErrorStateChanged(bool isInErrorState); void limitOfSilentDomainCheckInsReached(); diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index e11891bb33..42341a8484 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -38,7 +38,7 @@ var DEFAULT_SCRIPTS_SEPARATE = [ //"system/chat.js" ]; -if (Settings.getValue("enableInterstitialMode", false)) { +if (Window.interstitialModeEnabled) { DEFAULT_SCRIPTS_SEPARATE.push("system/interstitialPage.js"); DEFAULT_SCRIPTS_SEPARATE.push("system/redirectOverlays.js"); } diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index 49708c44fe..218aafea2b 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -37,6 +37,8 @@ var tablet = null; var button = null; + var errorConnectingToDomain = false; + // Tips have a character limit of 69 var userTips = [ "Tip: Visit TheSpot to explore featured domains!", @@ -188,6 +190,16 @@ var connectionToDomainFailed = false; + function getOopsText() { + var error = Window.getLastDomainConnectionError(); + var errorMessageMapIndex = hardRefusalErrors.indexOf(error); + if (errorMessageMapIndex >= 0) { + return ERROR_MESSAGE_MAP[errorMessageMapIndex]; + } else { + // some other text. + return ERROR_MESSAGE_MAP[4]; + } + } function getAnchorLocalYOffset() { var loadingSpherePosition = Overlays.getProperty(loadingSphereID, "position"); @@ -235,6 +247,13 @@ } } + function toggleInterstitialPage(isInErrorState) { + errorConnectingToDomain = isInErrorState; + if (!errorConnectingToDomain) { + domainChanged(location); + } + } + function startAudio() { sample = Audio.playSound(tune, { localOnly: true, @@ -347,9 +366,11 @@ Overlays.editOverlay(loadingBarPlacard, properties); Overlays.editOverlay(loadingBarProgress, loadingBarProperties); - Menu.setIsOptionChecked("Show Overlays", physicsEnabled); - if (!HMD.active) { - toolbar.writeProperty("visible", physicsEnabled); + if (errorConnectingToDomain) { + Menu.setIsOptionChecked("Show Overlays", physicsEnabled); + if (!HMD.active) { + toolbar.writeProperty("visible", physicsEnabled); + } } resetValues(); @@ -359,7 +380,6 @@ } } - function scaleInterstitialPage(sensorToWorldScale) { var yOffset = getAnchorLocalYOffset(); var localPosition = { @@ -399,14 +419,19 @@ Overlays.editOverlay(loadingBarProgress, properties); - if ((physicsEnabled && (currentProgress >= (TOTAL_LOADING_PROGRESS - EPSILON)))) { + if (errorConnectingToDomain) { + updateOverlays(errorConnectingToDomain); + endAudio(); + currentDomain = "no domain"; + timer = null; + return; + } else if ((physicsEnabled && (currentProgress >= (TOTAL_LOADING_PROGRESS - EPSILON)))) { updateOverlays((physicsEnabled || connectionToDomainFailed)); endAudio(); currentDomain = "no domain"; timer = null; return; } - timer = Script.setTimeout(update, BASIC_TIMER_INTERVAL_MS); } var whiteColor = {red: 255, green: 255, blue: 255}; @@ -430,6 +455,7 @@ connectionToDomainFailed = !location.isConnected; }, 1200); }); + Window.redirectErrorStateChanged.connect(toggleInterstitialPage); MyAvatar.sensorToWorldScaleChanged.connect(scaleInterstitialPage); MyAvatar.sessionUUIDChanged.connect(function() { diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index 5d37078a26..5264112476 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -13,11 +13,10 @@ var TIMEOUT = 5; var hardRefusalErrors = [PROTOCOL_VERSION_MISMATCH, NOT_AUTHORIZED, TIMEOUT]; - var error = -1; var timer = null; function getOopsText() { - error = Window.getLastDomainConnectionError(); + var error = Window.getLastDomainConnectionError(); var errorMessageMapIndex = hardRefusalErrors.indexOf(error); if (errorMessageMapIndex >= 0) { return ERROR_MESSAGE_MAP[errorMessageMapIndex]; @@ -29,58 +28,68 @@ var redirectOopsText = Overlays.addOverlay("text3d", { name: "oopsText", - localPosition: {x: 0.5691902160644531, y: 0.6403706073760986, z: 6.68358039855957}, + localPosition: {x: 0.2691902160644531, y: 0.6403706073760986, z: 3.18358039855957}, + localRotation: Quat.fromPitchYawRollDegrees(0.0, 180.0, 0.0), text: getOopsText(), textAlpha: 1, backgroundAlpha: 0, + color: {x: 255, y: 255, z: 255}, lineHeight: 0.10, + leftMargin: 0.538373570564886, visible: false, emissive: true, ignoreRayIntersection: false, - drawInFront: true, + dimensions: {x: 4.2, y: 1}, grabbable: false, - orientation: {x: 0.0, y: 0.5, z: 0.0, w: 0.87}, parentID: MyAvatar.SELF_ID, parentJointIndex: MyAvatar.getJointIndex("Head") }); var tryAgainImage = Overlays.addOverlay("image3d", { name: "tryAgainImage", - localPosition: {x: -0.15, y: -0.4, z: 0.0}, + localPosition: {x: -0.6, y: -0.4, z: 0.0}, url: Script.resourcesPath() + "images/interstitialPage/button_tryAgain.png", alpha: 1, visible: false, emissive: true, ignoreRayIntersection: false, - drawInFront: true, grabbable: false, - orientation: {x: 0.0, y: 0.5, z: 0, w: 0.87}, + orientation: Overlays.getProperty(redirectOopsText, "orientation"), parentID: redirectOopsText }); var backImage = Overlays.addOverlay("image3d", { name: "backImage", - localPosition: {x: 1.0, y: -0.4, z: 0.0}, + localPosition: {x: 0.6, y: -0.4, z: 0.0}, url: Script.resourcesPath() + "images/interstitialPage/button_back.png", alpha: 1, visible: false, emissive: true, ignoreRayIntersection: false, - drawInFront: true, grabbable: false, - orientation: {x: 0.0, y: 0.5, z: 0, w: 0.87}, + orientation: Overlays.getProperty(redirectOopsText, "orientation"), parentID: redirectOopsText }); var TARGET_UPDATE_HZ = 60; var BASIC_TIMER_INTERVAL_MS = 1000 / TARGET_UPDATE_HZ; - function toggleOverlays() { + function toggleOverlays(isInErrorState) { + if (!isInErrorState) { + var properties = { + visible: false + }; + + Overlays.editOverlay(redirectOopsText, properties); + Overlays.editOverlay(tryAgainImage, properties); + Overlays.editOverlay(backImage, properties); + return; + } var overlaysVisible = false; - error = Window.getLastDomainConnectionError(); + var error = Window.getLastDomainConnectionError(); var errorMessageMapIndex = hardRefusalErrors.indexOf(error); var oopsText = ""; - if (error === -1 || !Window.isPhysicsEnabled() || location.isConnected) { + if (error === -1) { overlaysVisible = false; } else if (errorMessageMapIndex >= 0) { overlaysVisible = true; @@ -93,28 +102,27 @@ visible: overlaysVisible }; + var textWidth = Overlays.textSize(redirectOopsText, oopsText).width; + var textOverlayWidth = Overlays.getProperty(redirectOopsText, "dimensions").x; + var oopsTextProperties = { visible: overlaysVisible, - text: oopsText + text: oopsText, + leftMargin: (textOverlayWidth - textWidth) / 2 }; Overlays.editOverlay(redirectOopsText, oopsTextProperties); Overlays.editOverlay(tryAgainImage, properties); Overlays.editOverlay(backImage, properties); + } function clickedOnOverlay(overlayID, event) { - var properties = { - visible: false - }; if (tryAgainImage === overlayID) { location.goToLastAddress(); } else if (backImage === overlayID) { location.goBack(); } - Overlays.editOverlay(redirectOopsText, properties); - Overlays.editOverlay(tryAgainImage, properties); - Overlays.editOverlay(backImage, properties); } function cleanup() { @@ -125,6 +133,8 @@ Overlays.deleteOverlay(backImage); } + toggleOverlays(true); + var whiteColor = {red: 255, green: 255, blue: 255}; var greyColor = {red: 125, green: 125, blue: 125}; Overlays.mouseReleaseOnOverlay.connect(clickedOnOverlay); @@ -140,8 +150,7 @@ } }); - timer = Script.setInterval(toggleOverlays, 500); - // Script.update.connect(toggleOverlays); + Window.redirectErrorStateChanged.connect(toggleOverlays); Script.scriptEnding.connect(cleanup); }()); From db77cbcbc1281b0026ed34c0a6eefd32c980684a Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Wed, 26 Sep 2018 15:12:48 -0700 Subject: [PATCH 14/81] new location drop - unparent overlays --- interface/resources/serverless/redirect.json | 2 +- scripts/system/interstitialPage.js | 32 ++++++++++---------- scripts/system/redirectOverlays.js | 16 +++++----- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/interface/resources/serverless/redirect.json b/interface/resources/serverless/redirect.json index b40b3867b3..0b96bad961 100644 --- a/interface/resources/serverless/redirect.json +++ b/interface/resources/serverless/redirect.json @@ -2,7 +2,7 @@ "DataVersion": 0, "Paths": { - "/": "/5.77,1.4,4.96/0,0.49544,0,0.868645" + "/": "/2.3,0.4,2.89/0,0.49544,0,0.868645" }, "Entities": [ { diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index 218aafea2b..22ff6eb4b4 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -38,6 +38,7 @@ var button = null; var errorConnectingToDomain = false; + var resettingError = false; // Tips have a character limit of 69 var userTips = [ @@ -190,17 +191,6 @@ var connectionToDomainFailed = false; - function getOopsText() { - var error = Window.getLastDomainConnectionError(); - var errorMessageMapIndex = hardRefusalErrors.indexOf(error); - if (errorMessageMapIndex >= 0) { - return ERROR_MESSAGE_MAP[errorMessageMapIndex]; - } else { - // some other text. - return ERROR_MESSAGE_MAP[4]; - } - } - function getAnchorLocalYOffset() { var loadingSpherePosition = Overlays.getProperty(loadingSphereID, "position"); var loadingSphereOrientation = Overlays.getProperty(loadingSphereID, "rotation"); @@ -366,11 +356,10 @@ Overlays.editOverlay(loadingBarPlacard, properties); Overlays.editOverlay(loadingBarProgress, loadingBarProperties); - if (errorConnectingToDomain) { - Menu.setIsOptionChecked("Show Overlays", physicsEnabled); - if (!HMD.active) { - toolbar.writeProperty("visible", physicsEnabled); - } + Menu.setIsOptionChecked("Show Overlays", physicsEnabled); + if (!HMD.active) { + print("Show toolbar: " + physicsEnabled); + toolbar.writeProperty("visible", physicsEnabled); } resetValues(); @@ -391,6 +380,15 @@ Overlays.editOverlay(anchorOverlay, { localPosition: localPosition }); } + function sleep(milliseconds) { + var start = new Date().getTime(); + for (var i = 0; i < 1e7; i++) { + if ((new Date().getTime() - start) > milliseconds){ + break; + } + } + } + function update() { var physicsEnabled = Window.isPhysicsEnabled(); var thisInterval = Date.now(); @@ -424,6 +422,8 @@ endAudio(); currentDomain = "no domain"; timer = null; + sleep(300); + toolbar.writeProperty("visible", true); return; } else if ((physicsEnabled && (currentProgress >= (TOTAL_LOADING_PROGRESS - EPSILON)))) { updateOverlays((physicsEnabled || connectionToDomainFailed)); diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index 5264112476..165e8ae27a 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -26,10 +26,12 @@ } }; + var oopsDimensions = {x: 4.2, y: 1}; + var redirectOopsText = Overlays.addOverlay("text3d", { name: "oopsText", - localPosition: {x: 0.2691902160644531, y: 0.6403706073760986, z: 3.18358039855957}, - localRotation: Quat.fromPitchYawRollDegrees(0.0, 180.0, 0.0), + position: {x: 0, y: 1.6763916015625, z: 1.45927095413208}, + rotation: {x: -4.57763671875e-05, y: 0.4957197904586792, z: -7.62939453125e-05, w: 0.8684672117233276}, text: getOopsText(), textAlpha: 1, backgroundAlpha: 0, @@ -39,15 +41,13 @@ visible: false, emissive: true, ignoreRayIntersection: false, - dimensions: {x: 4.2, y: 1}, + dimensions: oopsDimensions, grabbable: false, - parentID: MyAvatar.SELF_ID, - parentJointIndex: MyAvatar.getJointIndex("Head") }); var tryAgainImage = Overlays.addOverlay("image3d", { name: "tryAgainImage", - localPosition: {x: -0.6, y: -0.4, z: 0.0}, + localPosition: {x: -0.6, y: -0.6, z: 0.0}, url: Script.resourcesPath() + "images/interstitialPage/button_tryAgain.png", alpha: 1, visible: false, @@ -60,7 +60,7 @@ var backImage = Overlays.addOverlay("image3d", { name: "backImage", - localPosition: {x: 0.6, y: -0.4, z: 0.0}, + localPosition: {x: 0.6, y: -0.6, z: 0.0}, url: Script.resourcesPath() + "images/interstitialPage/button_back.png", alpha: 1, visible: false, @@ -103,7 +103,7 @@ }; var textWidth = Overlays.textSize(redirectOopsText, oopsText).width; - var textOverlayWidth = Overlays.getProperty(redirectOopsText, "dimensions").x; + var textOverlayWidth = oopsDimensions.x; var oopsTextProperties = { visible: overlaysVisible, From afae4f3b9682e723380481e781f9f5c8dc04ec0d Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Wed, 26 Sep 2018 15:33:57 -0700 Subject: [PATCH 15/81] adding toolbar reappearing --- scripts/system/interstitialPage.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index 22ff6eb4b4..4b48ce66d4 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -422,8 +422,14 @@ endAudio(); currentDomain = "no domain"; timer = null; + // The toolbar doesn't become visible in time to match the speed of + // the signal handling of redirectErrorStateChanged in both this script + // and the redirectOverlays.js script. Use a sleep function to ensure + // the toolbar becomes visible again. sleep(300); - toolbar.writeProperty("visible", true); + if (!HMD.active) { + toolbar.writeProperty("visible", true); + } return; } else if ((physicsEnabled && (currentProgress >= (TOTAL_LOADING_PROGRESS - EPSILON)))) { updateOverlays((physicsEnabled || connectionToDomainFailed)); From db772fc3fecd2b0c6df65a1a84c0546bb1dbd503 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 26 Sep 2018 15:39:45 -0700 Subject: [PATCH 16/81] Update console name for osx build --- cmake/macros/GenerateInstallers.cmake | 6 +++--- cmake/macros/InstallBesideConsole.cmake | 4 ++-- cmake/macros/SetPackagingParameters.cmake | 2 +- server-console/CMakeLists.txt | 2 +- server-console/package.json | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmake/macros/GenerateInstallers.cmake b/cmake/macros/GenerateInstallers.cmake index acafd9b6c7..64919172f7 100644 --- a/cmake/macros/GenerateInstallers.cmake +++ b/cmake/macros/GenerateInstallers.cmake @@ -20,9 +20,9 @@ macro(GENERATE_INSTALLERS) set(INSTALLER_TYPE "client_only") string(REGEX REPLACE "High Fidelity" "High Fidelity Interface" _DISPLAY_NAME ${BUILD_ORGANIZATION}) elseif (SERVER_ONLY) - set(_PACKAGE_NAME_EXTRA "-Sandbox") + set(_PACKAGE_NAME_EXTRA "-Console") set(INSTALLER_TYPE "server_only") - string(REGEX REPLACE "High Fidelity" "High Fidelity Sandbox" _DISPLAY_NAME ${BUILD_ORGANIZATION}) + string(REGEX REPLACE "High Fidelity" "High Fidelity Console" _DISPLAY_NAME ${BUILD_ORGANIZATION}) else () set(_DISPLAY_NAME ${BUILD_ORGANIZATION}) set(INSTALLER_TYPE "full") @@ -122,7 +122,7 @@ macro(GENERATE_INSTALLERS) endif () if (BUILD_SERVER) - cpack_add_component(${SERVER_COMPONENT} DISPLAY_NAME "High Fidelity Sandbox") + cpack_add_component(${SERVER_COMPONENT} DISPLAY_NAME "High Fidelity Console") endif () include(CPack) diff --git a/cmake/macros/InstallBesideConsole.cmake b/cmake/macros/InstallBesideConsole.cmake index 3c991acf86..e3186501f4 100644 --- a/cmake/macros/InstallBesideConsole.cmake +++ b/cmake/macros/InstallBesideConsole.cmake @@ -66,8 +66,8 @@ macro(install_beside_console) install(CODE " set(MACOSX_BUNDLE_EXECUTABLE_NAME domain-server) set(MACOSX_BUNDLE_GUI_IDENTIFIER com.highfidelity.server-components) - set(MACOSX_BUNDLE_BUNDLE_NAME Sandbox\\ Components) - configure_file(${HF_CMAKE_DIR}/templates/MacOSXBundleSandboxComponentsInfo.plist.in ${ESCAPED_BUNDLE_NAME}/Contents/Info.plist) + set(MACOSX_BUNDLE_BUNDLE_NAME Console\\ Components) + configure_file(${HF_CMAKE_DIR}/templates/MacOSXBundleConsoleComponentsInfo.plist.in ${ESCAPED_BUNDLE_NAME}/Contents/Info.plist) execute_process(COMMAND ${MACDEPLOYQT_COMMAND} ${ESCAPED_BUNDLE_NAME} -verbose=2 -executable=${ESCAPED_EXECUTABLE_NAME})" COMPONENT ${SERVER_COMPONENT} ) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 164d326b20..aaba3bc201 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -142,7 +142,7 @@ macro(SET_PACKAGING_PARAMETERS) set(CONSOLE_INSTALL_DIR ${DMG_SUBFOLDER_NAME}) set(INTERFACE_INSTALL_DIR ${DMG_SUBFOLDER_NAME}) - set(CONSOLE_EXEC_NAME "Sandbox.app") + set(CONSOLE_EXEC_NAME "Console.app") set(CONSOLE_INSTALL_APP_PATH "${CONSOLE_INSTALL_DIR}/${CONSOLE_EXEC_NAME}") set(CONSOLE_APP_CONTENTS "${CONSOLE_INSTALL_APP_PATH}/Contents") diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index 16189dff9d..df51409151 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -23,7 +23,7 @@ add_dependencies(${TARGET_NAME} assignment-client domain-server interface) # set the packaged console folder depending on platform, so we can copy it if (APPLE) - set(PACKAGED_CONSOLE_FOLDER "Sandbox-darwin-x64/${CONSOLE_EXEC_NAME}") + set(PACKAGED_CONSOLE_FOLDER "Console-darwin-x64/${CONSOLE_EXEC_NAME}") elseif (WIN32) set(PACKAGED_CONSOLE_FOLDER "server-console-win32-x64") elseif (UNIX) diff --git a/server-console/package.json b/server-console/package.json index 565658702b..b0d181c65a 100644 --- a/server-console/package.json +++ b/server-console/package.json @@ -1,6 +1,6 @@ { - "name": "HighFidelitySandbox", - "description": "High Fidelity Sandbox", + "name": "HighFidelityConsole", + "description": "High Fidelity Console", "author": "High Fidelity", "license": "Apache-2.0", "version": "1.0.0", From fda3ec87ceb59c6f341e0c05a5a4f239d83f9d8e Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Wed, 26 Sep 2018 15:57:57 -0700 Subject: [PATCH 17/81] removing lingering print statement --- scripts/system/interstitialPage.js | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index 4b48ce66d4..36184ef3cc 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -358,7 +358,6 @@ Menu.setIsOptionChecked("Show Overlays", physicsEnabled); if (!HMD.active) { - print("Show toolbar: " + physicsEnabled); toolbar.writeProperty("visible", physicsEnabled); } From 33db8e1f24128018046e5f3411214326d821c71c Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Wed, 26 Sep 2018 16:40:43 -0700 Subject: [PATCH 18/81] only allow right-click for buttons --- scripts/system/redirectOverlays.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index 165e8ae27a..66b338e49c 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -118,6 +118,10 @@ } function clickedOnOverlay(overlayID, event) { + if (event.isRightButton) { + // don't allow right-clicks. + return; + } if (tryAgainImage === overlayID) { location.goToLastAddress(); } else if (backImage === overlayID) { From ba1bae6408b82a5b8d230f442249b9e4467e5d58 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 26 Sep 2018 17:43:04 -0700 Subject: [PATCH 19/81] OSX Build fix --- ...fo.plist.in => MacOSXBundleConsoleComponentsInfo.plist.in} | 0 server-console/packager.js | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename cmake/templates/{MacOSXBundleSandboxComponentsInfo.plist.in => MacOSXBundleConsoleComponentsInfo.plist.in} (100%) diff --git a/cmake/templates/MacOSXBundleSandboxComponentsInfo.plist.in b/cmake/templates/MacOSXBundleConsoleComponentsInfo.plist.in similarity index 100% rename from cmake/templates/MacOSXBundleSandboxComponentsInfo.plist.in rename to cmake/templates/MacOSXBundleConsoleComponentsInfo.plist.in diff --git a/server-console/packager.js b/server-console/packager.js index 89bcd7cb71..5e4fbfe568 100644 --- a/server-console/packager.js +++ b/server-console/packager.js @@ -27,8 +27,8 @@ var options = { } const EXEC_NAME = "server-console"; -const SHORT_NAME = "Sandbox"; -const FULL_NAME = "High Fidelity Sandbox"; +const SHORT_NAME = "Console"; +const FULL_NAME = "High Fidelity Console"; // setup per OS options if (osType == "Darwin") { From b6fd302a837f7de0fe58bba1b62f974f6ee4efc2 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 26 Sep 2018 18:40:54 -0700 Subject: [PATCH 20/81] OSX Interface-running detection fixes --- server-console/src/modules/hf-app.js | 6 +++++- server-console/src/modules/hf-process.js | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/server-console/src/modules/hf-app.js b/server-console/src/modules/hf-app.js index 1b1171baef..d7c54d3e4d 100644 --- a/server-console/src/modules/hf-app.js +++ b/server-console/src/modules/hf-app.js @@ -67,7 +67,11 @@ exports.startInterface = function(url) { } exports.isInterfaceRunning = function(done) { - var pInterface = new Process('interface', 'interface.exe'); + if (osType == 'Windows_NT') { + var pInterface = new Process('interface', 'interface.exe'); + } else if (osType == 'Darwin') { + var pInterface = new Process('interface', 'Interface'); + } return pInterface.isRunning(done); } diff --git a/server-console/src/modules/hf-process.js b/server-console/src/modules/hf-process.js index 35da07af9c..7736de0e55 100644 --- a/server-console/src/modules/hf-process.js +++ b/server-console/src/modules/hf-process.js @@ -274,8 +274,7 @@ Process.prototype = extend(Process.prototype, { done(running); }); } else if (os.type == 'Darwin') { - console.log("TODO IsRunning Darwin"); - childProcess.exec('ps cax | grep interface', function (err, stdout, stderr) { + childProcess.exec('ps cax | grep ' + _command, function (err, stdout, stderr) { done(stdout.length > 0); }); } From 747aab2097326e78c76bb105d1ccf0f40982648e Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Thu, 27 Sep 2018 10:16:11 -0700 Subject: [PATCH 21/81] persisting signed values --- interface/src/Application.cpp | 5 ++--- interface/src/Application.h | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 2ffd49a0b7..69f2445dd3 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -365,7 +365,6 @@ static const int THROTTLED_SIM_FRAME_PERIOD_MS = MSECS_PER_SECOND / THROTTLED_SI static const uint32_t INVALID_FRAME = UINT32_MAX; -static const float PHYSICS_READY_RANGE = 3.0f; // how far from avatar to check for entities that aren't ready for simulation static const float INITIAL_QUERY_RADIUS = 10.0f; // priority radius for entities before physics enabled static const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); @@ -6569,8 +6568,8 @@ bool Application::gpuTextureMemSizeStable() { auto renderConfig = qApp->getRenderEngine()->getConfiguration(); auto renderStats = renderConfig->getConfig("Stats"); - quint64 textureResourceGPUMemSize = renderStats->textureResourceGPUMemSize; - quint64 texturePopulatedGPUMemSize = renderStats->textureResourcePopulatedGPUMemSize; + qint64 textureResourceGPUMemSize = renderStats->textureResourceGPUMemSize; + qint64 texturePopulatedGPUMemSize = renderStats->textureResourcePopulatedGPUMemSize; if (_gpuTextureMemSizeAtLastCheck == textureResourceGPUMemSize) { _gpuTextureMemSizeStabilityCount++; diff --git a/interface/src/Application.h b/interface/src/Application.h index d9fff89915..cb37e655fc 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -730,8 +730,8 @@ private: std::atomic _fullSceneReceivedCounter { 0 }; // how many times have we received a full-scene octree stats packet uint32_t _fullSceneCounterAtLastPhysicsCheck { 0 }; // _fullSceneReceivedCounter last time we checked physics ready - quint64 _gpuTextureMemSizeStabilityCount { 0 }; - quint64 _gpuTextureMemSizeAtLastCheck { 0 }; + qint64 _gpuTextureMemSizeStabilityCount { 0 }; + qint64 _gpuTextureMemSizeAtLastCheck { 0 }; quint64 _lastPhysicsCheckTime { usecTimestampNow() }; // when did we last check to see if physics was ready From 61aef14c64cfb2cf40858ff2df03c6a36991c2b3 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 27 Sep 2018 10:16:21 -0700 Subject: [PATCH 22/81] OSX notifications dismiss the previous notifications immediately when sent, preventing 'click' behavior --- .../src/modules/hf-notifications.js | 63 +++++++++++++++---- 1 file changed, 52 insertions(+), 11 deletions(-) diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index a95a553631..c7f4e24a17 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -7,12 +7,14 @@ const path = require('path'); const AccountInfo = require('./hf-acctinfo').AccountInfo; const GetBuildInfo = hfApp.getBuildInfo; const buildInfo = GetBuildInfo(); +const osType = os.type(); const notificationIcon = path.join(__dirname, '../../resources/console-notification.png'); const STORIES_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 120 * 1000; const PEOPLE_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 120 * 1000; const WALLET_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 600 * 1000; const MARKETPLACE_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 600 * 1000; +const OSX_CLICK_DELAY_TIMEOUT = 500; const METAVERSE_SERVER_URL= process.env.HIFI_METAVERSE_URL ? process.env.HIFI_METAVERSE_URL : 'https://metaverse.highfidelity.com' const STORIES_URL= '/api/v1/user_stories'; @@ -33,13 +35,15 @@ const NotificationType = { MARKETPLACE: 'marketplace' }; + function HifiNotification(notificationType, notificationData, menuNotificationCallback) { this.type = notificationType; this.data = notificationData; } HifiNotification.prototype = { - show: function () { + show: function (finished) { + var _finished = finished; var text = ""; var message = ""; var url = null; @@ -114,8 +118,16 @@ HifiNotification.prototype = { message: message, wait: true, appID: buildInfo.appUserModelId, - url: url - }); + url: url, + timeout: 5 + }, + function (error, reason, metadata) { + if (osType == 'Darwin') { + setTimeout(_finished, OSX_CLICK_DELAY_TIMEOUT); + } else { + _finished(); + } + }); } } @@ -129,9 +141,12 @@ function HifiNotifications(config, menuNotificationCallback) { this.marketplaceSince = new Date(this.config.get("marketplaceNotifySince", "1970-01-01T00:00:00.000Z")); this.enable(this.enabled()); + this.pendingNotifications = []; + var _menuNotificationCallback = menuNotificationCallback; notifier.on('click', function (notifierObject, options) { + console.log("click."); StartInterface(options.url); _menuNotificationCallback(options.notificationType, false); }); @@ -195,6 +210,36 @@ HifiNotifications.prototype = { this.enable(false); }, + _showNotification: function () { + var _this = this; + + if (osType == 'Darwin') { + this.pendingNotifications[0].show(function () { + // For OSX + // don't attempt to show the next notification + // until the current is clicked or times out + // as the OSX Notifier stuff will dismiss + // the previous notification immediately + // when a new one is submitted + _this.pendingNotifications.shift(); + if(_this.pendingNotifications.length > 0) { + _this._showNotification(); + } + }); + } else { + // For Windows + // All notifications are sent immediately as they are queued + // by windows in Tray Notifications and can be bulk seen and + // dismissed + _this._showNotification(_this.pendingNotifications.shift()); + } + }, + _addNotification: function (notification) { + this.pendingNotifications.push(notification); + if(this.pendingNotifications.length == 1) { + this._showNotification(); + } + }, _pollToDisableHighlight: function (notifyType, error, data) { if (error || !data.body) { console.log("Error: unable to get " + url); @@ -248,8 +293,7 @@ HifiNotifications.prototype = { } _this.menuNotificationCallback(notifyType, true); if (content.total_entries >= maxNotificationItemCount) { - var notification = new HifiNotification(notifyType, content.total_entries); - notification.show(); + _this._addNotification(new HifiNotification(notifyType, content.total_entries)); } else { var notifyData = [] switch (notifyType) { @@ -268,8 +312,7 @@ HifiNotifications.prototype = { } notifyData.forEach(function (notifyDataEntry) { - var notification = new HifiNotification(notifyType, notifyDataEntry); - notification.show(); + _this._addNotification(new HifiNotification(notifyType, notifyDataEntry)); }); } finished(true, token); @@ -376,13 +419,11 @@ HifiNotifications.prototype = { } if (newUsers.size >= maxNotificationItemCount) { - var notification = new HifiNotification(NotificationType.PEOPLE, newUsers.size); - notification.show(); + _this._addNotification(new HifiNotification(NotificationType.PEOPLE, newUsers.size)); return; } newUsers.forEach(function (user) { - var notification = new HifiNotification(NotificationType.PEOPLE, user); - notification.show(); + _this._addNotification(new HifiNotification(NotificationType.PEOPLE, user)); }); }); }); From 9079c8a6b76c94cf395cb13e44589ae359703b1c Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Thu, 27 Sep 2018 10:42:21 -0700 Subject: [PATCH 23/81] adding log for redirect cases --- libraries/networking/src/DomainHandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/networking/src/DomainHandler.cpp b/libraries/networking/src/DomainHandler.cpp index 3ff8f29cd0..3a8253bfc6 100644 --- a/libraries/networking/src/DomainHandler.cpp +++ b/libraries/networking/src/DomainHandler.cpp @@ -363,6 +363,7 @@ void DomainHandler::setRedirectErrorState(QUrl errorUrl, QString reasonMessage, if (getInterstitialModeEnabled()) { _errorDomainURL = errorUrl; _isInErrorState = true; + qCDebug(networking) << "Error connecting to domain: " << reasonMessage; emit redirectErrorStateChanged(_isInErrorState); emit redirectToErrorDomainURL(_errorDomainURL); } else { From d851e3994e78df3492a3740124c92bd908e89d8a Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 27 Sep 2018 11:10:51 -0700 Subject: [PATCH 24/81] Search for interface should check peer package Also, retain enabled/disabled state for notifications across restarts --- .../src/modules/hf-notifications.js | 27 +++++++++---------- server-console/src/modules/path-finder.js | 3 +++ 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index c7f4e24a17..d487462ba5 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -146,7 +146,6 @@ function HifiNotifications(config, menuNotificationCallback) { var _menuNotificationCallback = menuNotificationCallback; notifier.on('click', function (notifierObject, options) { - console.log("click."); StartInterface(options.url); _menuNotificationCallback(options.notificationType, false); }); @@ -185,18 +184,7 @@ HifiNotifications.prototype = { }, MARKETPLACE_NOTIFICATION_POLL_TIME_MS); } else { - if (this.storiesPollTimer) { - clearInterval(this.storiesPollTimer); - } - if (this.peoplePollTimer) { - clearInterval(this.peoplePollTimer); - } - if (this.walletPollTimer) { - clearInterval(this.walletPollTimer); - } - if (this.marketplacePollTimer) { - clearInterval(this.marketplacePollTimer); - } + this.stopPolling(); } }, enabled: function () { @@ -208,7 +196,18 @@ HifiNotifications.prototype = { this.config.set("walletNotifySince", this.walletSince.toISOString()); this.config.set("marketplaceNotifySince", this.marketplaceSince.toISOString()); - this.enable(false); + if (this.storiesPollTimer) { + clearInterval(this.storiesPollTimer); + } + if (this.peoplePollTimer) { + clearInterval(this.peoplePollTimer); + } + if (this.walletPollTimer) { + clearInterval(this.walletPollTimer); + } + if (this.marketplacePollTimer) { + clearInterval(this.marketplacePollTimer); + } }, _showNotification: function () { var _this = this; diff --git a/server-console/src/modules/path-finder.js b/server-console/src/modules/path-finder.js index 5ecd2c74ff..e9e7e48a5f 100644 --- a/server-console/src/modules/path-finder.js +++ b/server-console/src/modules/path-finder.js @@ -55,6 +55,9 @@ exports.searchPaths = function(name, binaryType, releaseType) { // check beside the app bundle for the binaries paths.push(path.join(path.dirname(appPath), name + extension)); + + // check in the peer bundle for the binaries + paths.push(path.join("..", name + extension)); } } } From 6a3b286a074ec28693a684200eb4e0771b39aea3 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 27 Sep 2018 11:44:00 -0700 Subject: [PATCH 25/81] Fix windows notification popups:w --- .../src/modules/hf-notifications.js | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index c7f4e24a17..b089e16983 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -10,10 +10,10 @@ const buildInfo = GetBuildInfo(); const osType = os.type(); const notificationIcon = path.join(__dirname, '../../resources/console-notification.png'); -const STORIES_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 120 * 1000; -const PEOPLE_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 120 * 1000; -const WALLET_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 600 * 1000; -const MARKETPLACE_NOTIFICATION_POLL_TIME_MS = 15 * 1000; // 600 * 1000; +const STORIES_NOTIFICATION_POLL_TIME_MS = 120 * 1000; +const PEOPLE_NOTIFICATION_POLL_TIME_MS = 120 * 1000; +const WALLET_NOTIFICATION_POLL_TIME_MS = 600 * 1000; +const MARKETPLACE_NOTIFICATION_POLL_TIME_MS = 600 * 1000; const OSX_CLICK_DELAY_TIMEOUT = 500; const METAVERSE_SERVER_URL= process.env.HIFI_METAVERSE_URL ? process.env.HIFI_METAVERSE_URL : 'https://metaverse.highfidelity.com' @@ -122,10 +122,12 @@ HifiNotification.prototype = { timeout: 5 }, function (error, reason, metadata) { - if (osType == 'Darwin') { - setTimeout(_finished, OSX_CLICK_DELAY_TIMEOUT); - } else { - _finished(); + if(_finished) { + if (osType == 'Darwin') { + setTimeout(_finished, OSX_CLICK_DELAY_TIMEOUT); + } else { + _finished(); + } } }); } @@ -231,7 +233,7 @@ HifiNotifications.prototype = { // All notifications are sent immediately as they are queued // by windows in Tray Notifications and can be bulk seen and // dismissed - _this._showNotification(_this.pendingNotifications.shift()); + _this.pendingNotifications.shift().show(); } }, _addNotification: function (notification) { From b0b2c6f3ee88372883fc9d80c470b28f8c53ba2b Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 27 Sep 2018 13:31:28 -0700 Subject: [PATCH 26/81] Fixup path finding for interface --- server-console/src/modules/path-finder.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/server-console/src/modules/path-finder.js b/server-console/src/modules/path-finder.js index e9e7e48a5f..3fab8b2808 100644 --- a/server-console/src/modules/path-finder.js +++ b/server-console/src/modules/path-finder.js @@ -1,5 +1,6 @@ var fs = require('fs'); var path = require('path'); +const { app } = require('electron'); function platformExtension(name) { if (name == "Interface") { @@ -53,12 +54,9 @@ exports.searchPaths = function(name, binaryType, releaseType) { var componentsPath = appPath + "/Contents/MacOS/Components.app/Contents/MacOS/"; paths.push(componentsPath + name + extension); - // check beside the app bundle for the binaries - paths.push(path.join(path.dirname(appPath), name + extension)); - - // check in the peer bundle for the binaries - paths.push(path.join("..", name + extension)); } + // check beside the app bundle for the binaries + paths.push(path.join(path.dirname(app.getAppPath()), "../../..", name + extension)); } } From c3e956932bc652acb0081694a4ad0d2bcf2ca4b9 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 27 Sep 2018 15:22:04 -0700 Subject: [PATCH 27/81] Fix OSX Build --- server-console/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index df51409151..b47a46e596 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -33,12 +33,12 @@ endif () # install the packaged Server Console in our install directory if (APPLE) install( - PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${SERVER_COMPONENT} ) install( - PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${CLIENT_COMPONENT} ) From 6d0996c254298c78809299cbdc0e9c6c03568729 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 27 Sep 2018 16:52:03 -0700 Subject: [PATCH 28/81] Show "Sandbox" as the server component for server installs, show "Console" for client-only installs --- cmake/macros/GenerateInstallers.cmake | 6 +- cmake/macros/SetPackagingParameters.cmake | 5 +- cmake/templates/NSIS.template.in | 91 ++++++++++++++++------- 3 files changed, 72 insertions(+), 30 deletions(-) diff --git a/cmake/macros/GenerateInstallers.cmake b/cmake/macros/GenerateInstallers.cmake index 64919172f7..acafd9b6c7 100644 --- a/cmake/macros/GenerateInstallers.cmake +++ b/cmake/macros/GenerateInstallers.cmake @@ -20,9 +20,9 @@ macro(GENERATE_INSTALLERS) set(INSTALLER_TYPE "client_only") string(REGEX REPLACE "High Fidelity" "High Fidelity Interface" _DISPLAY_NAME ${BUILD_ORGANIZATION}) elseif (SERVER_ONLY) - set(_PACKAGE_NAME_EXTRA "-Console") + set(_PACKAGE_NAME_EXTRA "-Sandbox") set(INSTALLER_TYPE "server_only") - string(REGEX REPLACE "High Fidelity" "High Fidelity Console" _DISPLAY_NAME ${BUILD_ORGANIZATION}) + string(REGEX REPLACE "High Fidelity" "High Fidelity Sandbox" _DISPLAY_NAME ${BUILD_ORGANIZATION}) else () set(_DISPLAY_NAME ${BUILD_ORGANIZATION}) set(INSTALLER_TYPE "full") @@ -122,7 +122,7 @@ macro(GENERATE_INSTALLERS) endif () if (BUILD_SERVER) - cpack_add_component(${SERVER_COMPONENT} DISPLAY_NAME "High Fidelity Console") + cpack_add_component(${SERVER_COMPONENT} DISPLAY_NAME "High Fidelity Sandbox") endif () include(CPack) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index aaba3bc201..f67f6526cf 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -177,15 +177,18 @@ macro(SET_PACKAGING_PARAMETERS) if (PRODUCTION_BUILD) set(INTERFACE_SHORTCUT_NAME "High Fidelity Interface") set(CONSOLE_SHORTCUT_NAME "High Fidelity Console") + set(SANDBOX_SHORTCUT_NAME "High Fidelity Sandbox") set(APP_USER_MODEL_ID "com.highfidelity.console") else () set(INTERFACE_SHORTCUT_NAME "High Fidelity Interface - ${BUILD_VERSION_NO_SHA}") set(CONSOLE_SHORTCUT_NAME "High Fidelity Console - ${BUILD_VERSION_NO_SHA}") + set(SANDBOX_SHORTCUT_NAME "High Fidelity Sandbox - ${BUILD_VERSION_NO_SHA}") endif () set(INTERFACE_HF_SHORTCUT_NAME "${INTERFACE_SHORTCUT_NAME}") set(CONSOLE_HF_SHORTCUT_NAME "${CONSOLE_SHORTCUT_NAME}") - + set(SANDBOX_HF_SHORTCUT_NAME "${SANDBOX_SHORTCUT_NAME}") + set(PRE_SANDBOX_INTERFACE_SHORTCUT_NAME "High Fidelity") set(PRE_SANDBOX_CONSOLE_SHORTCUT_NAME "Server Console") diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index b7564f45e5..d1a32245bb 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -770,29 +770,54 @@ Function PostInstallOptionsPage ${EndIf} ${EndIf} - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @CONSOLE_HF_SHORTCUT_NAME@" - Pop $DesktopConsoleCheckbox - IntOp $CurrentOffset $CurrentOffset + 15 + ${If} @SERVER_COMPONENT_CONDITIONAL@ + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @SANDBOX_HF_SHORTCUT_NAME@" + Pop $DesktopConsoleCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ after install" - Pop $LaunchConsoleNowCheckbox + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @SANDBOX_HF_SHORTCUT_NAME@ after install" + Pop $LaunchConsoleNowCheckbox - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $LaunchConsoleNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} - ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE - ${IfNot} $substringResult == "" - ${NSD_SetState} $LaunchConsoleNowCheckbox ${BST_UNCHECKED} + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $LaunchConsoleNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} + ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE + ${IfNot} $substringResult == "" + ${NSD_SetState} $LaunchConsoleNowCheckbox ${BST_UNCHECKED} + ${EndIf} + + IntOp $CurrentOffset $CurrentOffset + 15 + + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @SANDBOX_HF_SHORTCUT_NAME@ on startup" + Pop $ConsoleStartupCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 + + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $ConsoleStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED} + ${Else} + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @CONSOLE_HF_SHORTCUT_NAME@" + Pop $DesktopConsoleCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 + + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ after install" + Pop $LaunchConsoleNowCheckbox + + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $LaunchConsoleNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} + ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE + ${IfNot} $substringResult == "" + ${NSD_SetState} $LaunchConsoleNowCheckbox ${BST_UNCHECKED} + ${EndIf} + + IntOp $CurrentOffset $CurrentOffset + 15 + + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ on startup" + Pop $ConsoleStartupCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 + + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $ConsoleStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED} ${EndIf} - IntOp $CurrentOffset $CurrentOffset + 15 - - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ on startup" - Pop $ConsoleStartupCheckbox - IntOp $CurrentOffset $CurrentOffset + 15 - - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $ConsoleStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED} - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Perform a clean install (Delete older settings and content)" Pop $CleanInstallCheckbox IntOp $CurrentOffset $CurrentOffset + 15 @@ -893,14 +918,26 @@ FunctionEnd Function HandlePostInstallOptions - ; check if the user asked for a desktop shortcut to the console - ${If} $DesktopConsoleState == ${BST_CHECKED} - CreateShortCut "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" - !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ YES - ; Set appUserModelId - ApplicationID::Set "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" + ${If} @SERVER_COMPONENT_CONDITIONAL@ + ; check if the user asked for a desktop shortcut to the console + ${If} $DesktopConsoleState == ${BST_CHECKED} + CreateShortCut "$DESKTOP\@SANDBOX_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" + !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ YES + ; Set appUserModelId + ApplicationID::Set "$DESKTOP\@SANDBOX_HF_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" + ${Else} + !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ NO + ${EndIf} ${Else} - !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ NO + ; check if the user asked for a desktop shortcut to the console + ${If} $DesktopConsoleState == ${BST_CHECKED} + CreateShortCut "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" + !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ YES + ; Set appUserModelId + ApplicationID::Set "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" + ${Else} + !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ NO + ${EndIf} ${EndIf} ${If} @CLIENT_COMPONENT_CONDITIONAL@ @@ -1371,10 +1408,12 @@ Section "Uninstall" Delete "$SMPROGRAMS\$MUI_TEMP\@CONSOLE_SHORTCUT_NAME@.lnk" Delete "$DESKTOP\@INTERFACE_HF_SHORTCUT_NAME@.lnk" Delete "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" + Delete "$DESKTOP\@SANDBOX_HF_SHORTCUT_NAME@.lnk" ; if it exists, delete the startup shortcut for the current user SetShellVarContext current Delete "$SMSTARTUP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" + Delete "$SMSTARTUP\@SANDBOX_HF_SHORTCUT_NAME@.lnk" SetShellVarContext all @CPACK_NSIS_DELETE_ICONS@ From 8b29f7c2944d45c742eece967ab58e362cdc9bf2 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Thu, 27 Sep 2018 16:56:45 -0700 Subject: [PATCH 29/81] making text box smaller for no occlusion --- scripts/system/redirectOverlays.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index 66b338e49c..4de9ee354c 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -26,7 +26,7 @@ } }; - var oopsDimensions = {x: 4.2, y: 1}; + var oopsDimensions = {x: 4.2, y: 0.8}; var redirectOopsText = Overlays.addOverlay("text3d", { name: "oopsText", From 5d27cddab5d42801b390ab1e5730381424469233 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Thu, 27 Sep 2018 17:16:18 -0700 Subject: [PATCH 30/81] consolidating getting oops message --- scripts/system/redirectOverlays.js | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index 4de9ee354c..b4a89a7a4e 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -18,7 +18,10 @@ function getOopsText() { var error = Window.getLastDomainConnectionError(); var errorMessageMapIndex = hardRefusalErrors.indexOf(error); - if (errorMessageMapIndex >= 0) { + if (error === -1) { + // not an error. + return ""; + } else if (errorMessageMapIndex >= 0) { return ERROR_MESSAGE_MAP[errorMessageMapIndex]; } else { // some other text. @@ -71,9 +74,6 @@ parentID: redirectOopsText }); - var TARGET_UPDATE_HZ = 60; - var BASIC_TIMER_INTERVAL_MS = 1000 / TARGET_UPDATE_HZ; - function toggleOverlays(isInErrorState) { if (!isInErrorState) { var properties = { @@ -85,19 +85,9 @@ Overlays.editOverlay(backImage, properties); return; } - var overlaysVisible = false; - var error = Window.getLastDomainConnectionError(); - var errorMessageMapIndex = hardRefusalErrors.indexOf(error); - var oopsText = ""; - if (error === -1) { - overlaysVisible = false; - } else if (errorMessageMapIndex >= 0) { - overlaysVisible = true; - oopsText = ERROR_MESSAGE_MAP[errorMessageMapIndex]; - } else { - overlaysVisible = true; - oopsText = ERROR_MESSAGE_MAP[4]; - } + var oopsText = getOopsText(); + // if oopsText === "", it was a success. + var overlaysVisible = (oopsText !== ""); var properties = { visible: overlaysVisible }; From 308deeaa8d976cbe8c50a3660fa68154c4e60358 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 27 Sep 2018 19:54:42 -0700 Subject: [PATCH 31/81] Refactoring of NSIS setup files with respect to Sandbox vs Console --- cmake/macros/SetPackagingParameters.cmake | 12 +-- cmake/templates/CPackProperties.cmake.in | 2 + cmake/templates/NSIS.template.in | 97 ++++++++++++----------- server-console/CMakeLists.txt | 5 +- 4 files changed, 59 insertions(+), 57 deletions(-) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index f67f6526cf..30fa37ea14 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -176,18 +176,18 @@ macro(SET_PACKAGING_PARAMETERS) # shortcut names if (PRODUCTION_BUILD) set(INTERFACE_SHORTCUT_NAME "High Fidelity Interface") - set(CONSOLE_SHORTCUT_NAME "High Fidelity Console") - set(SANDBOX_SHORTCUT_NAME "High Fidelity Sandbox") + set(CONSOLE_SHORTCUT_NAME "Console") + set(SANDBOX_SHORTCUT_NAME "Sandbox") set(APP_USER_MODEL_ID "com.highfidelity.console") else () set(INTERFACE_SHORTCUT_NAME "High Fidelity Interface - ${BUILD_VERSION_NO_SHA}") - set(CONSOLE_SHORTCUT_NAME "High Fidelity Console - ${BUILD_VERSION_NO_SHA}") - set(SANDBOX_SHORTCUT_NAME "High Fidelity Sandbox - ${BUILD_VERSION_NO_SHA}") + set(CONSOLE_SHORTCUT_NAME "Console - ${BUILD_VERSION_NO_SHA}") + set(SANDBOX_SHORTCUT_NAME "Sandbox - ${BUILD_VERSION_NO_SHA}") endif () set(INTERFACE_HF_SHORTCUT_NAME "${INTERFACE_SHORTCUT_NAME}") - set(CONSOLE_HF_SHORTCUT_NAME "${CONSOLE_SHORTCUT_NAME}") - set(SANDBOX_HF_SHORTCUT_NAME "${SANDBOX_SHORTCUT_NAME}") + set(CONSOLE_HF_SHORTCUT_NAME "High Fidelity ${CONSOLE_SHORTCUT_NAME}") + set(SANDBOX_HF_SHORTCUT_NAME "High Fidelity ${SANDBOX_SHORTCUT_NAME}") set(PRE_SANDBOX_INTERFACE_SHORTCUT_NAME "High Fidelity") set(PRE_SANDBOX_CONSOLE_SHORTCUT_NAME "Server Console") diff --git a/cmake/templates/CPackProperties.cmake.in b/cmake/templates/CPackProperties.cmake.in index 0a56181138..a38c3d5361 100644 --- a/cmake/templates/CPackProperties.cmake.in +++ b/cmake/templates/CPackProperties.cmake.in @@ -17,6 +17,8 @@ set(CONSOLE_DISPLAY_NAME "Console") set(CONSOLE_INSTALL_SUBDIR "@CONSOLE_INSTALL_DIR@") set(CONSOLE_SHORTCUT_NAME "@CONSOLE_SHORTCUT_NAME@") set(CONSOLE_HF_SHORTCUT_NAME "@CONSOLE_HF_SHORTCUT_NAME@") +set(SANDBOX_SHORTCUT_NAME "@SANDBOX_SHORTCUT_NAME@") +set(SANDBOX_HF_SHORTCUT_NAME "@SANDBOX_HF_SHORTCUT_NAME@") set(CONSOLE_WIN_EXEC_NAME "@CONSOLE_EXEC_NAME@") set(PRE_SANDBOX_INTERFACE_SHORTCUT_NAME "@PRE_SANDBOX_INTERFACE_SHORTCUT_NAME@") set(PRE_SANDBOX_CONSOLE_SHORTCUT_NAME "@PRE_SANDBOX_CONSOLE_SHORTCUT_NAME@") diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index d1a32245bb..b67cdf3eea 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -754,13 +754,21 @@ Function PostInstallOptionsPage !insertmacro SetInstallOption $DesktopClientCheckbox @CLIENT_DESKTOP_SHORTCUT_REG_KEY@ ${BST_CHECKED} ${EndIf} + ${If} @SERVER_COMPONENT_CONDITIONAL@ + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @SANDBOX_HF_SHORTCUT_NAME@" + ${Else} + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @CONSOLE_HF_SHORTCUT_NAME@" + ${EndIf} + + Pop $DesktopConsoleCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 ; set the checkbox state depending on what is present in the registry !insertmacro SetInstallOption $DesktopConsoleCheckbox @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ ${BST_UNCHECKED} ${If} @CLIENT_COMPONENT_CONDITIONAL@ ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @INTERFACE_HF_SHORTCUT_NAME@ after install" Pop $LaunchClientNowCheckbox - IntOp $CurrentOffset $CurrentOffset + 30 + IntOp $CurrentOffset $CurrentOffset + 15 ; set the checkbox state depending on what is present in the registry !insertmacro SetInstallOption $LaunchClientNowCheckbox @CLIENT_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} @@ -771,52 +779,30 @@ Function PostInstallOptionsPage ${EndIf} ${If} @SERVER_COMPONENT_CONDITIONAL@ - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @SANDBOX_HF_SHORTCUT_NAME@" - Pop $DesktopConsoleCheckbox - IntOp $CurrentOffset $CurrentOffset + 15 - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @SANDBOX_HF_SHORTCUT_NAME@ after install" - Pop $LaunchConsoleNowCheckbox - - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $LaunchConsoleNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} - ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE - ${IfNot} $substringResult == "" - ${NSD_SetState} $LaunchConsoleNowCheckbox ${BST_UNCHECKED} - ${EndIf} - - IntOp $CurrentOffset $CurrentOffset + 15 - - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @SANDBOX_HF_SHORTCUT_NAME@ on startup" - Pop $ConsoleStartupCheckbox - IntOp $CurrentOffset $CurrentOffset + 15 - - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $ConsoleStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED} ${Else} - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Create a desktop shortcut for @CONSOLE_HF_SHORTCUT_NAME@" - Pop $DesktopConsoleCheckbox - IntOp $CurrentOffset $CurrentOffset + 15 - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ after install" - Pop $LaunchConsoleNowCheckbox - - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $LaunchConsoleNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} - ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE - ${IfNot} $substringResult == "" - ${NSD_SetState} $LaunchConsoleNowCheckbox ${BST_UNCHECKED} - ${EndIf} - - IntOp $CurrentOffset $CurrentOffset + 15 - - ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ on startup" - Pop $ConsoleStartupCheckbox - IntOp $CurrentOffset $CurrentOffset + 15 - - ; set the checkbox state depending on what is present in the registry - !insertmacro SetInstallOption $ConsoleStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED} ${EndIf} + Pop $LaunchConsoleNowCheckbox + + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $LaunchConsoleNowCheckbox @SERVER_LAUNCH_NOW_REG_KEY@ ${BST_CHECKED} + ${StrContains} $substringResult "/forceNoLaunchServer" $CMDLINE + ${IfNot} $substringResult == "" + ${NSD_SetState} $LaunchConsoleNowCheckbox ${BST_UNCHECKED} + ${EndIf} + IntOp $CurrentOffset $CurrentOffset + 30 + + ${If} @SERVER_COMPONENT_CONDITIONAL@ + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @SANDBOX_HF_SHORTCUT_NAME@ on startup" + ${Else} + ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Launch @CONSOLE_HF_SHORTCUT_NAME@ on startup" + ${EndIf} + Pop $ConsoleStartupCheckbox + IntOp $CurrentOffset $CurrentOffset + 15 + + ; set the checkbox state depending on what is present in the registry + !insertmacro SetInstallOption $ConsoleStartupCheckbox @CONSOLE_STARTUP_REG_KEY@ ${BST_CHECKED} ${NSD_CreateCheckbox} 0 $CurrentOffset$OffsetUnits 100% 10u "&Perform a clean install (Delete older settings and content)" Pop $CleanInstallCheckbox @@ -921,6 +907,7 @@ Function HandlePostInstallOptions ${If} @SERVER_COMPONENT_CONDITIONAL@ ; check if the user asked for a desktop shortcut to the console ${If} $DesktopConsoleState == ${BST_CHECKED} + Delete "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" CreateShortCut "$DESKTOP\@SANDBOX_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ YES ; Set appUserModelId @@ -931,6 +918,7 @@ Function HandlePostInstallOptions ${Else} ; check if the user asked for a desktop shortcut to the console ${If} $DesktopConsoleState == ${BST_CHECKED} + Delete "$DESKTOP\@SANDBOX_HF_SHORTCUT_NAME@.lnk" CreateShortCut "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" !insertmacro WriteInstallOption @CONSOLE_DESKTOP_SHORTCUT_REG_KEY@ YES ; Set appUserModelId @@ -957,6 +945,7 @@ Function HandlePostInstallOptions Delete "$SMSTARTUP\@PRE_SANDBOX_CONSOLE_SHORTCUT_NAME@.lnk" ; make a startup shortcut in this user's current context + ; use the console shortcut name regardless of server/interface install SetShellVarContext current CreateShortCut "$SMSTARTUP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" @@ -1196,11 +1185,21 @@ Section "-Core installation" ${EndIf} - ; handling for server console shortcut - CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" \ - "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" - ; Set appUserModelId - ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" + ${If} @SERVER_COMPONENT_CONDITIONAL@ + ; handling for server console shortcut + Delete "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\@SANDBOX_SHORTCUT_NAME@.lnk" \ + "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" + ; Set appUserModelId + ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@SANDBOX_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" + ${Else} + ; handling for interface only console shortcut + Delete "$SMPROGRAMS\$STARTMENU_FOLDER\@SANDBOX_SHORTCUT_NAME@.lnk" + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" \ + "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" + ; Set appUserModelId + ApplicationID::Set "$SMPROGRAMS\$STARTMENU_FOLDER\@CONSOLE_SHORTCUT_NAME@.lnk" "@APP_USER_MODEL_ID@" + ${EndIf} CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\@UNINSTALLER_NAME@" @@ -1406,6 +1405,7 @@ Section "Uninstall" Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\@INTERFACE_SHORTCUT_NAME@.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\@CONSOLE_SHORTCUT_NAME@.lnk" + Delete "$SMPROGRAMS\$MUI_TEMP\@SANDBOX_SHORTCUT_NAME@.lnk" Delete "$DESKTOP\@INTERFACE_HF_SHORTCUT_NAME@.lnk" Delete "$DESKTOP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" Delete "$DESKTOP\@SANDBOX_HF_SHORTCUT_NAME@.lnk" @@ -1446,6 +1446,7 @@ Section "Uninstall" Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\@INTERFACE_SHORTCUT_NAME@.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\@CONSOLE_SHORTCUT_NAME@.lnk" + Delete "$SMPROGRAMS\$MUI_TEMP\@SANDBOX_SHORTCUT_NAME@.lnk" @CPACK_NSIS_DELETE_ICONS_EXTRA@ ;Delete empty start menu parent diretories diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index 982f142e64..e8d61e77f7 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -33,13 +33,12 @@ endif () # install the packaged Server Console in our install directory if (APPLE) install( - DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${SERVER_COMPONENT} - COMPONENT ${CLIENT_COMPONENT} ) install( - DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${CLIENT_COMPONENT} ) From d5950db2a4f1ab48ab7d108214fa512bd9e96f6f Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Thu, 27 Sep 2018 21:20:06 -0700 Subject: [PATCH 32/81] fix for showing the text overlay in mac --- scripts/system/redirectOverlays.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index b4a89a7a4e..4d6d185adc 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -37,8 +37,8 @@ rotation: {x: -4.57763671875e-05, y: 0.4957197904586792, z: -7.62939453125e-05, w: 0.8684672117233276}, text: getOopsText(), textAlpha: 1, + backgroundColor: {x: 0, y: 0, z:0}, backgroundAlpha: 0, - color: {x: 255, y: 255, z: 255}, lineHeight: 0.10, leftMargin: 0.538373570564886, visible: false, @@ -98,10 +98,15 @@ var oopsTextProperties = { visible: overlaysVisible, text: oopsText, + textAlpha: overlaysVisible, + // either visible or invisible. 0 doesn't work in Mac. + backgroundAlpha: overlaysVisible * 0.00393, leftMargin: (textOverlayWidth - textWidth) / 2 }; + Window.copyToClipboard(redirectOopsText); Overlays.editOverlay(redirectOopsText, oopsTextProperties); + print("toggleOverlays: setting alpha to " + Overlays.getProperty(redirectOopsText, "alpha")); Overlays.editOverlay(tryAgainImage, properties); Overlays.editOverlay(backImage, properties); From 5c9094d81f32128847582cbcaddc0f9bd6bd7232 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Thu, 27 Sep 2018 21:24:04 -0700 Subject: [PATCH 33/81] removing debug print statement --- scripts/system/redirectOverlays.js | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index 4d6d185adc..307bd2b95f 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -106,7 +106,6 @@ Window.copyToClipboard(redirectOopsText); Overlays.editOverlay(redirectOopsText, oopsTextProperties); - print("toggleOverlays: setting alpha to " + Overlays.getProperty(redirectOopsText, "alpha")); Overlays.editOverlay(tryAgainImage, properties); Overlays.editOverlay(backImage, properties); From 4257a4dfdd6b9f132be8b988926f36e1176f7b44 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 27 Sep 2018 23:12:24 -0700 Subject: [PATCH 34/81] Try fixing binary name for 'running process' detection of interface --- server-console/src/modules/hf-app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server-console/src/modules/hf-app.js b/server-console/src/modules/hf-app.js index d7c54d3e4d..3c9505abdd 100644 --- a/server-console/src/modules/hf-app.js +++ b/server-console/src/modules/hf-app.js @@ -50,7 +50,7 @@ exports.getBuildInfo = function() { } const buildInfo = exports.getBuildInfo(); -const interfacePath = pathFinder.discoveredPath("Interface", binaryType, buildInfo.releaseType); +const interfacePath = pathFinder.discoveredPath("interface", binaryType, buildInfo.releaseType); exports.startInterface = function(url) { var argArray = []; @@ -70,7 +70,7 @@ exports.isInterfaceRunning = function(done) { if (osType == 'Windows_NT') { var pInterface = new Process('interface', 'interface.exe'); } else if (osType == 'Darwin') { - var pInterface = new Process('interface', 'Interface'); + var pInterface = new Process('interface', 'interface'); } return pInterface.isRunning(done); } From a8b86bd555c1fbf17a2cfd63ca1e3bb7c0c916f5 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Fri, 28 Sep 2018 08:44:49 -0700 Subject: [PATCH 35/81] removing debug statement --- scripts/system/redirectOverlays.js | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index 307bd2b95f..8dd7d0d26a 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -103,7 +103,6 @@ backgroundAlpha: overlaysVisible * 0.00393, leftMargin: (textOverlayWidth - textWidth) / 2 }; - Window.copyToClipboard(redirectOopsText); Overlays.editOverlay(redirectOopsText, oopsTextProperties); Overlays.editOverlay(tryAgainImage, properties); From dde106e42ef6cf358c59e8e715d51cd3b1fc58cf Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 09:24:00 -0700 Subject: [PATCH 36/81] Make tray icon light map to notification status of various menus --- server-console/src/main.js | 41 ++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/server-console/src/main.js b/server-console/src/main.js index cfde72e3bc..771c2736dd 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -60,7 +60,10 @@ const HOME_CONTENT_URL = "http://cdn.highfidelity.com/content-sets/home-tutorial const buildInfo = GetBuildInfo(); - +const NotificationState = { + UNNOTIFIED: 'unnotified', + NOTIFIED: 'notified' +}; // Update lock filepath const UPDATER_LOCK_FILENAME = ".updating"; @@ -324,12 +327,21 @@ const HifiNotifications = hfNotifications.HifiNotifications; const HifiNotificationType = hfNotifications.NotificationType; var pendingNotifications = {} -function notificationCallback(notificationType, pending = true) { +var notificationState = NotificationState.UNNOTIFIED; + +function setNotificationState(notificationType, pending = true) { pendingNotifications[notificationType] = pending; + notificationState = NotificationState.UNNOTIFIED; + for (var key in pendingNotifications) { + if (pendingNotifications[key]) { + notificationState = NotificationState.NOTIFIED; + break; + } + } updateTrayMenu(homeServer ? homeServer.state : ProcessGroupStates.STOPPED); } -var trayNotifications = new HifiNotifications(userConfig, notificationCallback); +var trayNotifications = new HifiNotifications(userConfig, setNotificationState); var LogWindow = function(ac, ds) { this.ac = ac; @@ -389,7 +401,7 @@ var labels = { type: 'checkbox', checked: true, click: function () { - trayNotifications.enable(!trayNotifications.enabled(), notificationCallback); + trayNotifications.enable(!trayNotifications.enabled(), setNotificationState); userConfig.save(configPath); updateTrayMenu(homeServer ? homeServer.state : ProcessGroupStates.STOPPED); } @@ -398,32 +410,28 @@ var labels = { label: 'GoTo', click: function () { StartInterface("hifiapp:GOTO"); - pendingNotifications[HifiNotificationType.GOTO] = false; - updateTrayMenu(homeServer ? homeServer.state : ProcessGroupStates.STOPPED); + setNotificationState(HifiNotificationType.GOTO, false); } }, people: { label: 'People', click: function () { StartInterface("hifiapp:PEOPLE"); - pendingNotifications[HifiNotificationType.PEOPLE] = false; - updateTrayMenu(homeServer ? homeServer.state : ProcessGroupStates.STOPPED); + setNotificationState(HifiNotificationType.PEOPLE, false); } }, wallet: { label: 'Wallet', click: function () { StartInterface("hifiapp:WALLET"); - pendingNotifications[HifiNotificationType.WALLET] = false; - updateTrayMenu(homeServer ? homeServer.state : ProcessGroupStates.STOPPED); + setNotificationState(HifiNotificationType.WALLET, false); } }, marketplace: { label: 'Market', click: function () { StartInterface("hifiapp:MARKET"); - pendingNotifications[HifiNotificationType.MARKETPLACE] = false; - updateTrayMenu(homeServer ? homeServer.state : ProcessGroupStates.STOPPED); + setNotificationState(HifiNotificationType.MARKETPLACE, false); } }, restart: { @@ -557,7 +565,7 @@ function updateLabels(serverState) { function updateTrayMenu(serverState) { if (tray) { var menuArray = buildMenuArray(isShuttingDown ? null : serverState); - tray.setImage(trayIcons[serverState]); + tray.setImage(trayIcons[notificationState]); tray.setContextMenu(Menu.buildFromTemplate(menuArray)); if (isShuttingDown) { tray.setToolTip('High Fidelity - Shutting Down'); @@ -777,9 +785,8 @@ function maybeShowSplash() { const trayIconOS = (osType == "Darwin") ? "osx" : "win"; var trayIcons = {}; -trayIcons[ProcessGroupStates.STARTED] = "console-tray-" + trayIconOS + ".png"; -trayIcons[ProcessGroupStates.STOPPED] = "console-tray-" + trayIconOS + "-stopped.png"; -trayIcons[ProcessGroupStates.STOPPING] = "console-tray-" + trayIconOS + "-stopping.png"; +trayIcons[NotificationState.UNNOTIFIED] = "console-tray-" + trayIconOS + ".png"; +trayIcons[NotificationState.NOTIFIED] = "console-tray-" + trayIconOS + "-stopped.png"; for (var key in trayIcons) { var fullPath = path.join(__dirname, '../resources/' + trayIcons[key]); var img = nativeImage.createFromPath(fullPath); @@ -892,7 +899,7 @@ app.on('ready', function() { } // Create tray icon - tray = new Tray(trayIcons[ProcessGroupStates.STOPPED]); + tray = new Tray(trayIcons[NotificationState.UNNOTIFIED]); tray.setToolTip('High Fidelity'); tray.on('click', function() { From fb3205a847755811bc2b77faa3091c78e35fab0f Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 10:02:03 -0700 Subject: [PATCH 37/81] More OSX Path fixes --- server-console/src/main.js | 2 +- server-console/src/modules/path-finder.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server-console/src/main.js b/server-console/src/main.js index cfde72e3bc..6abac30344 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -259,7 +259,7 @@ var debug = argv.debug; var binaryType = argv.binaryType; -interfacePath = pathFinder.discoveredPath("Interface", binaryType, buildInfo.releaseType); +interfacePath = pathFinder.discoveredPath("interface", binaryType, buildInfo.releaseType); dsPath = pathFinder.discoveredPath("domain-server", binaryType, buildInfo.releaseType); acPath = pathFinder.discoveredPath("assignment-client", binaryType, buildInfo.releaseType); diff --git a/server-console/src/modules/path-finder.js b/server-console/src/modules/path-finder.js index 3fab8b2808..a7ccee2631 100644 --- a/server-console/src/modules/path-finder.js +++ b/server-console/src/modules/path-finder.js @@ -3,7 +3,7 @@ var path = require('path'); const { app } = require('electron'); function platformExtension(name) { - if (name == "Interface") { + if (name == "interface") { if (process.platform == "darwin") { return ".app/Contents/MacOS/" + name } else if (process.platform == "win32") { From 1aaaca4e6c97a6403709327511c0a363d7815fd6 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 10:48:20 -0700 Subject: [PATCH 38/81] Code review changes --- cmake/templates/NSIS.template.in | 2 +- server-console/src/modules/hf-acctinfo.js | 6 ++--- server-console/src/modules/hf-app.js | 12 +++++----- .../src/modules/hf-notifications.js | 22 +++++++++---------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index b67cdf3eea..3226712519 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -945,7 +945,7 @@ Function HandlePostInstallOptions Delete "$SMSTARTUP\@PRE_SANDBOX_CONSOLE_SHORTCUT_NAME@.lnk" ; make a startup shortcut in this user's current context - ; use the console shortcut name regardless of server/interface install + ; use the console shortcut name regardless of server/interface install SetShellVarContext current CreateShortCut "$SMSTARTUP\@CONSOLE_HF_SHORTCUT_NAME@.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" diff --git a/server-console/src/modules/hf-acctinfo.js b/server-console/src/modules/hf-acctinfo.js index 828bc781b8..d20748544f 100644 --- a/server-console/src/modules/hf-acctinfo.js +++ b/server-console/src/modules/hf-acctinfo.js @@ -66,7 +66,7 @@ AccountInfo.prototype = { case VariantTypes.USER_TYPE: //user type var userTypeName = this._parseByteArray().toString('ascii').slice(0,-1); - if (userTypeName == "DataServerAccountInfo") { + if (userTypeName === "DataServerAccountInfo") { return this._parseDataServerAccountInfo(); } else { @@ -77,7 +77,7 @@ AccountInfo.prototype = { }, _parseByteArray: function () { var length = this._parseUInt32(); - if (length == 0xffffffff) { + if (length === 0xffffffff) { return null; } var result = this.rawData.slice(this.parseOffset, this.parseOffset+length); @@ -91,7 +91,7 @@ AccountInfo.prototype = { } // length in bytes; var length = this._parseUInt32(); - if (length == 0xFFFFFFFF) { + if (length === 0xFFFFFFFF) { return null; } diff --git a/server-console/src/modules/hf-app.js b/server-console/src/modules/hf-app.js index 3c9505abdd..3db48bd9c4 100644 --- a/server-console/src/modules/hf-app.js +++ b/server-console/src/modules/hf-app.js @@ -15,9 +15,9 @@ const osType = os.type(); exports.getBuildInfo = function() { var buildInfoPath = null; - if (osType == 'Windows_NT') { + if (osType === 'Windows_NT') { buildInfoPath = path.join(path.dirname(process.execPath), 'build-info.json'); - } else if (osType == 'Darwin') { + } else if (osType === 'Darwin') { var contentPath = ".app/Contents/"; var contentEndIndex = __dirname.indexOf(contentPath); @@ -67,9 +67,9 @@ exports.startInterface = function(url) { } exports.isInterfaceRunning = function(done) { - if (osType == 'Windows_NT') { + if (osType === 'Windows_NT') { var pInterface = new Process('interface', 'interface.exe'); - } else if (osType == 'Darwin') { + } else if (osType === 'Darwin') { var pInterface = new Process('interface', 'interface'); } return pInterface.isRunning(done); @@ -78,13 +78,13 @@ exports.isInterfaceRunning = function(done) { exports.getRootHifiDataDirectory = function(local) { var organization = buildInfo.organization; - if (osType == 'Windows_NT') { + if (osType === 'Windows_NT') { if (local) { return path.resolve(osHomeDir(), 'AppData/Local', organization); } else { return path.resolve(osHomeDir(), 'AppData/Roaming', organization); } - } else if (osType == 'Darwin') { + } else if (osType === 'Darwin') { return path.resolve(osHomeDir(), 'Library/Application Support', organization); } else { return path.resolve(osHomeDir(), '.local/share/', organization); diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index 2953075523..0cc4da02c0 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -51,8 +51,8 @@ HifiNotification.prototype = { var app = null; switch (this.type) { case NotificationType.GOTO: - if (typeof(this.data) == "number") { - if (this.data == 1) { + if (typeof(this.data) === "number") { + if (this.data === 1) { text = "You have " + this.data + " event invitation pending." } else { text = "You have " + this.data + " event invitations pending." @@ -67,8 +67,8 @@ HifiNotification.prototype = { break; case NotificationType.PEOPLE: - if (typeof(this.data) == "number") { - if (this.data == 1) { + if (typeof(this.data) === "number") { + if (this.data === 1) { text = this.data + " of your connections is online." } else { text = this.data + " of your connections are online." @@ -83,8 +83,8 @@ HifiNotification.prototype = { break; case NotificationType.WALLET: - if (typeof(this.data) == "number") { - if (this.data == 1) { + if (typeof(this.data) === "number") { + if (this.data === 1) { text = "You have " + this.data + " unread Wallet transaction."; } else { text = "You have " + this.data + " unread Wallet transactions."; @@ -99,8 +99,8 @@ HifiNotification.prototype = { break; case NotificationType.MARKETPLACE: - if (typeof(this.data) == "number") { - if (this.data == 1) { + if (typeof(this.data) === "number") { + if (this.data === 1) { text = this.data + " of your purchased items has an update available."; } else { text = this.data + " of your purchased items have updates available."; @@ -124,7 +124,7 @@ HifiNotification.prototype = { }, function (error, reason, metadata) { if(_finished) { - if (osType == 'Darwin') { + if (osType === 'Darwin') { setTimeout(_finished, OSX_CLICK_DELAY_TIMEOUT); } else { _finished(); @@ -215,7 +215,7 @@ HifiNotifications.prototype = { _showNotification: function () { var _this = this; - if (osType == 'Darwin') { + if (osType === 'Darwin') { this.pendingNotifications[0].show(function () { // For OSX // don't attempt to show the next notification @@ -238,7 +238,7 @@ HifiNotifications.prototype = { }, _addNotification: function (notification) { this.pendingNotifications.push(notification); - if(this.pendingNotifications.length == 1) { + if(this.pendingNotifications.length === 1) { this._showNotification(); } }, From ee8290f71cd62a34f2ccbb5a713283595fd685c5 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 11:10:42 -0700 Subject: [PATCH 39/81] Fix comment --- server-console/src/modules/hf-notifications.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index 0cc4da02c0..c69c81aff2 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -218,11 +218,11 @@ HifiNotifications.prototype = { if (osType === 'Darwin') { this.pendingNotifications[0].show(function () { // For OSX - // don't attempt to show the next notification + // Don't attempt to show the next notification // until the current is clicked or times out - // as the OSX Notifier stuff will dismiss - // the previous notification immediately - // when a new one is submitted + // as the OSX Notifier stuff will dismiss the + // previous notification immediately when a + // new one is submitted _this.pendingNotifications.shift(); if(_this.pendingNotifications.length > 0) { _this._showNotification(); From 6393f907b87afadaec07c42b3c7d00cfb19e526b Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 12:33:38 -0700 Subject: [PATCH 40/81] Add temporary code to test for interface paths --- server-console/src/main.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server-console/src/main.js b/server-console/src/main.js index 6abac30344..e92749908c 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -885,6 +885,9 @@ function onContentLoaded() { // This method will be called when Electron has finished // initialization and is ready to create browser windows. app.on('ready', function() { + var paths = pathFinder.searchPaths("interface", binaryType, buildInfo.releaseType); + dialog.showMessageBox({type: 'question', buttons: ['Yes', 'No'], title: "Paths", message: paths.join(", ")}, function () {}); + if (app.dock) { // hide the dock icon on OS X @@ -902,4 +905,5 @@ app.on('ready', function() { updateTrayMenu(ProcessGroupStates.STOPPED); maybeInstallDefaultContentSet(onContentLoaded); + }); From 537c0aaf2590f18331a2f3aa84cde34289a3d520 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 13:15:04 -0700 Subject: [PATCH 41/81] Revert "Add temporary code to test for interface paths" This reverts commit 6393f907b87afadaec07c42b3c7d00cfb19e526b. --- server-console/src/main.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/server-console/src/main.js b/server-console/src/main.js index e92749908c..6abac30344 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -885,9 +885,6 @@ function onContentLoaded() { // This method will be called when Electron has finished // initialization and is ready to create browser windows. app.on('ready', function() { - var paths = pathFinder.searchPaths("interface", binaryType, buildInfo.releaseType); - dialog.showMessageBox({type: 'question', buttons: ['Yes', 'No'], title: "Paths", message: paths.join(", ")}, function () {}); - if (app.dock) { // hide the dock icon on OS X @@ -905,5 +902,4 @@ app.on('ready', function() { updateTrayMenu(ProcessGroupStates.STOPPED); maybeInstallDefaultContentSet(onContentLoaded); - }); From 42cdf24f5bbd2dcb0037bed184c3ae6405988df8 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 14:52:21 -0700 Subject: [PATCH 42/81] Move OSX Back to Sandbox.app --- cmake/macros/SetPackagingParameters.cmake | 2 +- server-console/CMakeLists.txt | 2 +- server-console/packager.js | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 30fa37ea14..dce419a0e4 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -142,7 +142,7 @@ macro(SET_PACKAGING_PARAMETERS) set(CONSOLE_INSTALL_DIR ${DMG_SUBFOLDER_NAME}) set(INTERFACE_INSTALL_DIR ${DMG_SUBFOLDER_NAME}) - set(CONSOLE_EXEC_NAME "Console.app") + set(CONSOLE_EXEC_NAME "Sandbox.app") set(CONSOLE_INSTALL_APP_PATH "${CONSOLE_INSTALL_DIR}/${CONSOLE_EXEC_NAME}") set(CONSOLE_APP_CONTENTS "${CONSOLE_INSTALL_APP_PATH}/Contents") diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index e8d61e77f7..420230c33c 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -23,7 +23,7 @@ add_dependencies(${TARGET_NAME} assignment-client domain-server interface) # set the packaged console folder depending on platform, so we can copy it if (APPLE) - set(PACKAGED_CONSOLE_FOLDER "Console-darwin-x64/${CONSOLE_EXEC_NAME}") + set(PACKAGED_CONSOLE_FOLDER "Sandbox-darwin-x64/${CONSOLE_EXEC_NAME}") elseif (WIN32) set(PACKAGED_CONSOLE_FOLDER "server-console-win32-x64") elseif (UNIX) diff --git a/server-console/packager.js b/server-console/packager.js index 5e4fbfe568..31655fe565 100644 --- a/server-console/packager.js +++ b/server-console/packager.js @@ -28,12 +28,13 @@ var options = { const EXEC_NAME = "server-console"; const SHORT_NAME = "Console"; +const OSX_SHORT_NAME = "Sandbox"; const FULL_NAME = "High Fidelity Console"; // setup per OS options if (osType == "Darwin") { options["app-bundle-id"] = "com.highfidelity.server-console" + (argv.production ? "" : "-dev") - options["name"] = SHORT_NAME + options["name"] = OSX_SHORT_NAME } else if (osType == "Windows_NT") { options["version-string"] = { CompanyName: "High Fidelity, Inc.", From edd354d109551b84e3aef190b6bd75ec8e8e4762 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 14:52:50 -0700 Subject: [PATCH 43/81] "Add temporary code to test for interface paths"" --- server-console/src/main.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server-console/src/main.js b/server-console/src/main.js index d1b3dd2dd3..f0d6ae13ae 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -892,6 +892,9 @@ function onContentLoaded() { // This method will be called when Electron has finished // initialization and is ready to create browser windows. app.on('ready', function() { + var paths = pathFinder.searchPaths("interface", binaryType, buildInfo.releaseType); + dialog.showMessageBox({type: 'question', buttons: ['Yes', 'No'], title: "Paths", message: paths.join(", ")}, function () {}); + if (app.dock) { // hide the dock icon on OS X @@ -909,4 +912,5 @@ app.on('ready', function() { updateTrayMenu(ProcessGroupStates.STOPPED); maybeInstallDefaultContentSet(onContentLoaded); + }); From b6877bca5787efc79bc21d29095e42dbdd86592a Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Fri, 28 Sep 2018 16:26:44 -0700 Subject: [PATCH 44/81] Revert ""Add temporary code to test for interface paths""" This reverts commit edd354d109551b84e3aef190b6bd75ec8e8e4762. --- server-console/src/main.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/server-console/src/main.js b/server-console/src/main.js index f0d6ae13ae..d1b3dd2dd3 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -892,9 +892,6 @@ function onContentLoaded() { // This method will be called when Electron has finished // initialization and is ready to create browser windows. app.on('ready', function() { - var paths = pathFinder.searchPaths("interface", binaryType, buildInfo.releaseType); - dialog.showMessageBox({type: 'question', buttons: ['Yes', 'No'], title: "Paths", message: paths.join(", ")}, function () {}); - if (app.dock) { // hide the dock icon on OS X @@ -912,5 +909,4 @@ app.on('ready', function() { updateTrayMenu(ProcessGroupStates.STOPPED); maybeInstallDefaultContentSet(onContentLoaded); - }); From 113ad3d9170d2e1f1b7c9a6b8c5e03a04cd9ccbc Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Sun, 30 Sep 2018 13:11:15 -0700 Subject: [PATCH 45/81] Fixes for OSX App Translocation makes it nearly impossible to find the interface executable from the running server-console, specifically in downloaded builds launched from the Finder. To enable OSX detection and and launch of the interface, the code has been changed to: * Assume interface is installed on OSX as we don't produce a server-only build. * Launch the interface by using 'open' with the appid. NOTE: This may launch the wrong version of the app if multiple instances of the app are installed, but this is the best we can do for now. For most users, the behavior should be as expected. Second, polling was happening even if interface couldn't be detected if it was previously enabled. --- cmake/macros/SetPackagingParameters.cmake | 1 + cmake/modules/MacOSXBundleInfo.plist.in | 8 ++++ cmake/templates/CPackProperties.cmake.in | 1 + server-console/src/main.js | 16 +++++++- server-console/src/modules/hf-app.js | 37 ++++++++++++++----- .../src/modules/hf-notifications.js | 4 +- 6 files changed, 55 insertions(+), 12 deletions(-) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index dce419a0e4..297382b4e5 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -37,6 +37,7 @@ macro(SET_PACKAGING_PARAMETERS) set(BUILD_VERSION ${RELEASE_NUMBER}) set(BUILD_ORGANIZATION "High Fidelity") set(HIGH_FIDELITY_PROTOCOL "hifi") + set(HIGH_FIDELITY_APP_PROTOCOL "hifiapp") set(INTERFACE_BUNDLE_NAME "Interface") set(INTERFACE_ICON_PREFIX "interface") diff --git a/cmake/modules/MacOSXBundleInfo.plist.in b/cmake/modules/MacOSXBundleInfo.plist.in index a06fac092f..b9558cf361 100644 --- a/cmake/modules/MacOSXBundleInfo.plist.in +++ b/cmake/modules/MacOSXBundleInfo.plist.in @@ -42,6 +42,14 @@ hifi + + CFBundleURLName + ${MACOSX_BUNDLE_BUNDLE_NAME} APP URL + CFBundleURLSchemes + + hifiapp + + NSHighResolutionCapable diff --git a/cmake/templates/CPackProperties.cmake.in b/cmake/templates/CPackProperties.cmake.in index a38c3d5361..cb6474b010 100644 --- a/cmake/templates/CPackProperties.cmake.in +++ b/cmake/templates/CPackProperties.cmake.in @@ -27,6 +27,7 @@ set(DS_EXEC_NAME "@DS_EXEC_NAME@") set(AC_DISPLAY_NAME "Assignment Client") set(AC_EXEC_NAME "@AC_EXEC_NAME@") set(HIGH_FIDELITY_PROTOCOL "@HIGH_FIDELITY_PROTOCOL@") +set(HIGH_FIDELITY_APP_PROTOCOL "@HIGH_FIDELITY_APP_PROTOCOL@") set(PRODUCTION_BUILD "@PRODUCTION_BUILD@") set(PR_BUILD "@PR_BUILD@") set(BUILD_ORGANIZATION "@BUILD_ORGANIZATION@") diff --git a/server-console/src/main.js b/server-console/src/main.js index d1b3dd2dd3..04e77315bc 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -108,7 +108,16 @@ const ipcMain = electron.ipcMain; function isInterfaceInstalled() { - return interfacePath; + if (osType == "Darwin") { + // In OSX Sierra, the app translocation process moves + // the executable to a random location before starting it + // which makes finding the interface near impossible using + // relative paths. For now, as there are no server-only + // installs, we just assume the interface is installed here + return true; + } else { + return interfacePath; + } } function isServerInstalled() { @@ -377,7 +386,7 @@ LogWindow.prototype = { }; function visitSandboxClicked() { - if (interfacePath) { + if (isInterfaceInstalled()) { StartInterface('hifi://localhost'); } else { // show an error to say that we can't go home without an interface instance @@ -906,6 +915,9 @@ app.on('ready', function() { tray.popUpContextMenu(tray.menu); }); + if (isInterfaceInstalled()) { + trayNotifications.startPolling(); + } updateTrayMenu(ProcessGroupStates.STOPPED); maybeInstallDefaultContentSet(onContentLoaded); diff --git a/server-console/src/modules/hf-app.js b/server-console/src/modules/hf-app.js index 3db48bd9c4..af6c38cdb3 100644 --- a/server-console/src/modules/hf-app.js +++ b/server-console/src/modules/hf-app.js @@ -7,6 +7,7 @@ const path = require('path'); const argv = require('yargs').argv; const hfprocess = require('./hf-process'); const osHomeDir = require('os-homedir'); +const childProcess = require('child_process'); const Process = hfprocess.Process; const binaryType = argv.binaryType; @@ -53,17 +54,35 @@ const buildInfo = exports.getBuildInfo(); const interfacePath = pathFinder.discoveredPath("interface", binaryType, buildInfo.releaseType); exports.startInterface = function(url) { - var argArray = []; - // check if we have a url parameter to include - if (url) { - argArray = ["--url", url]; + if (osType === 'Darwin') { + if (!url) { + log.debug("No URL given for startInterface"); + return; + } + + // do this as a workaround for app translocation on osx, which makes + // it nearly impossible to find the interface executable + var bundle_id = 'com.highfidelity.interface-dev'; + if (buildInfo.releaseType == 'PR') { + bundle_id = 'com.highfidelity.interface-pr'; + } else if (buildInfo.releaseType == 'PRODUCTION') { + bundle_id = 'com.highfidelity.interface'; + } + childProcess.exec('open -b ' + bundle_id + ' --args --url ' + url); + } else { + var argArray = []; + + // check if we have a url parameter to include + if (url) { + argArray = ["--url", url]; + } + console.log("Starting with " + url); + // create a new Interface instance - Interface makes sure only one is running at a time + var pInterface = new Process('Interface', interfacePath, argArray); + pInterface.detached = true; + pInterface.start(); } - console.log("Starting with " + url); - // create a new Interface instance - Interface makes sure only one is running at a time - var pInterface = new Process('Interface', interfacePath, argArray); - pInterface.detached = true; - pInterface.start(); } exports.isInterfaceRunning = function(done) { diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index c69c81aff2..13c5a6d8fa 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -143,7 +143,6 @@ function HifiNotifications(config, menuNotificationCallback) { this.walletSince = new Date(this.config.get("walletNotifySince", "1970-01-01T00:00:00.000Z")); this.marketplaceSince = new Date(this.config.get("marketplaceNotifySince", "1970-01-01T00:00:00.000Z")); - this.enable(this.enabled()); this.pendingNotifications = []; @@ -193,6 +192,9 @@ HifiNotifications.prototype = { enabled: function () { return !this.config.get("disableTrayNotifications", false); }, + startPolling: function () { + this.enable(this.enabled()); + }, stopPolling: function () { this.config.set("storiesNotifySince", this.storiesSince.toISOString()); this.config.set("peopleNotifySince", this.peopleSince.toISOString()); From 5f05be554f3d079a52c36b30adc7f6733847d555 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Mon, 1 Oct 2018 10:06:13 -0700 Subject: [PATCH 46/81] check for hard refusal to 404 --- libraries/networking/src/DomainHandler.cpp | 7 ++++++- libraries/networking/src/DomainHandler.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/libraries/networking/src/DomainHandler.cpp b/libraries/networking/src/DomainHandler.cpp index 3a8253bfc6..615546b410 100644 --- a/libraries/networking/src/DomainHandler.cpp +++ b/libraries/networking/src/DomainHandler.cpp @@ -139,6 +139,11 @@ void DomainHandler::hardReset() { _pendingPath.clear(); } +bool DomainHandler::isHardRefusal(int reasonCode) { + return (reasonCode == (int)ConnectionRefusedReason::ProtocolMismatch || reasonCode == (int)ConnectionRefusedReason::NotAuthorized || + reasonCode == (int)ConnectionRefusedReason::TimedOut); +} + bool DomainHandler::getInterstitialModeEnabled() const { return _interstitialModeSettingLock.resultWithReadLock([&] { return _enableInterstitialMode.get(); @@ -360,7 +365,7 @@ void DomainHandler::loadedErrorDomain(std::map namedPaths) { void DomainHandler::setRedirectErrorState(QUrl errorUrl, QString reasonMessage, int reasonCode, const QString& extraInfo) { _lastDomainConnectionError = reasonCode; - if (getInterstitialModeEnabled()) { + if (getInterstitialModeEnabled() && isHardRefusal(reasonCode)) { _errorDomainURL = errorUrl; _isInErrorState = true; qCDebug(networking) << "Error connecting to domain: " << reasonMessage; diff --git a/libraries/networking/src/DomainHandler.h b/libraries/networking/src/DomainHandler.h index 8cf84b602a..1ff88b425d 100644 --- a/libraries/networking/src/DomainHandler.h +++ b/libraries/networking/src/DomainHandler.h @@ -212,6 +212,8 @@ private: void sendDisconnectPacket(); void hardReset(); + bool isHardRefusal(int reasonCode); + QUuid _uuid; Node::LocalID _localID; QUrl _domainURL; From f8409b39770a496fff348684eead2cff29db18b5 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Mon, 1 Oct 2018 11:29:55 -0700 Subject: [PATCH 47/81] dd server-console to client build --- CMakeLists.txt | 3 ++- server-console/CMakeLists.txt | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a01b18a57..a887a35fcc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,7 @@ if (USE_GLES AND (NOT ANDROID)) set(DISABLE_QML_OPTION ON) endif() + option(BUILD_CLIENT "Build client components" ${BUILD_CLIENT_OPTION}) option(BUILD_SERVER "Build server components" ${BUILD_SERVER_OPTION}) option(BUILD_TESTS "Build tests" ${BUILD_TESTS_OPTION}) @@ -162,7 +163,6 @@ if (BUILD_SERVER) set_target_properties(domain-server PROPERTIES FOLDER "Apps") add_subdirectory(ice-server) set_target_properties(ice-server PROPERTIES FOLDER "Apps") - add_subdirectory(server-console) endif() if (BUILD_CLIENT) @@ -174,6 +174,7 @@ endif() if (BUILD_CLIENT OR BUILD_SERVER) add_subdirectory(plugins) + add_subdirectory(server-console) endif() # BUILD_TOOLS option will be handled inside the tools's CMakeLists.txt because 'scribe' tool is required for build anyway diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index e8d61e77f7..df51409151 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -49,7 +49,6 @@ elseif (WIN32) DIRECTORY "${CONSOLE_DESTINATION}/" DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${SERVER_COMPONENT} - COMPONENT ${CLIENT_COMPONENT} ) install( DIRECTORY "${CONSOLE_DESTINATION}/" From fbaac4254e9002d5233ae3428a800612bc6a02c1 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Mon, 1 Oct 2018 12:45:56 -0700 Subject: [PATCH 48/81] Set build targets properly for client-only install of console --- server-console/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index df51409151..fc6238bd9a 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -19,7 +19,13 @@ set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "Server Console") set_target_properties(${TARGET_NAME}-npm-install PROPERTIES FOLDER "hidden/Server Console") # add a dependency from the package target to the server components -add_dependencies(${TARGET_NAME} assignment-client domain-server interface) +if (BUILD_CLIENT) + add_dependencies(${TARGET_NAME} interface) +endif() + +if (BUILD_SERVER) + add_dependencies(${TARGET_NAME} assignment-client domain-server interface) +endif() # set the packaged console folder depending on platform, so we can copy it if (APPLE) From 652ec2210d927fbd3b911eebb0b066f42fe8ef42 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Mon, 1 Oct 2018 13:58:14 -0700 Subject: [PATCH 49/81] fixing loading issues --- interface/src/octree/SafeLanding.cpp | 32 +++++++++++++------ .../src/RenderableModelEntityItem.cpp | 9 +++++- .../src/RenderableModelEntityItem.h | 1 + .../src/model-networking/ModelCache.cpp | 5 +++ 4 files changed, 36 insertions(+), 11 deletions(-) diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index d181348276..6f341c1990 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -14,7 +14,7 @@ #include #include "EntityTreeRenderer.h" -#include "ModelEntityItem.h" +#include "RenderableModelEntityItem.h" #include "InterfaceLogging.h" #include "Application.h" @@ -124,18 +124,30 @@ bool SafeLanding::isLoadSequenceComplete() { float SafeLanding::loadingProgressPercentage() { Locker lock(_lock); + float sequencePercentage = 0.0f; + + if (_initialStart != INVALID_SEQUENCE && _initialEnd != 0) { + int sequenceSize = _initialStart <= _initialEnd ? _initialEnd - _initialStart: + _initialEnd + SEQUENCE_MODULO - _initialStart; + + auto startIter = _sequenceNumbers.find(_initialStart); + auto endIter = _sequenceNumbers.find(_initialEnd - 1); + + sequencePercentage = (distance(startIter, endIter) / (sequenceSize - 1)); + } + static const int MINIMUM_TRACKED_ENTITY_STABILITY_COUNT = 15; - float percentage = 0.0f; + float entityReadyPercentage = 0.0f; if (_maxTrackedEntityCount > 0) { - percentage = ((_maxTrackedEntityCount - _trackedEntities.size()) / (float)_maxTrackedEntityCount); + entityReadyPercentage = ((_maxTrackedEntityCount - _trackedEntities.size()) / (float)_maxTrackedEntityCount); } if (_trackedEntityStabilityCount < MINIMUM_TRACKED_ENTITY_STABILITY_COUNT) { - percentage *= 0.20f; + entityReadyPercentage *= 0.20f; } - return percentage; + return ((sequencePercentage *= 0.50f) + (entityReadyPercentage *= 0.50f)); } bool SafeLanding::isSequenceNumbersComplete() { @@ -148,7 +160,7 @@ bool SafeLanding::isSequenceNumbersComplete() { if (sequenceSize == 0 || (startIter != _sequenceNumbers.end() && endIter != _sequenceNumbers.end() - && distance(startIter, endIter) == sequenceSize - 1) ) { + && distance(startIter, endIter) == sequenceSize - 1)) { _trackingEntities = false; // Don't track anything else that comes in. return true; } @@ -160,13 +172,13 @@ bool isEntityPhysicsReady(const EntityItemPointer& entity) { if (entity && !entity->getCollisionless()) { const auto& entityType = entity->getType(); if (entityType == EntityTypes::Model) { - ModelEntityItem * modelEntity = std::dynamic_pointer_cast(entity).get(); + RenderableModelEntityItem * modelEntity = std::dynamic_pointer_cast(entity).get(); static const std::set downloadedCollisionTypes { SHAPE_TYPE_COMPOUND, SHAPE_TYPE_SIMPLE_COMPOUND, SHAPE_TYPE_STATIC_MESH, SHAPE_TYPE_SIMPLE_HULL }; bool hasAABox; entity->getAABox(hasAABox); if (hasAABox && downloadedCollisionTypes.count(modelEntity->getShapeType()) != 0) { - return (!entity->shouldBePhysical() || entity->isReadyToComputeShape()); + return (!entity->shouldBePhysical() || entity->isReadyToComputeShape() || modelEntity->computeShapeFailedToLoad()); } } } @@ -193,7 +205,7 @@ bool SafeLanding::isEntityLoadingComplete() { if (enableInterstitial) { isVisuallyReady = (entity->isVisuallyReady() || !entityTree->renderableForEntityId(entityMapIter->first)); - qDebug() << "EntityTpye" << EntityTypes::getEntityTypeName(entity->getType()) << entity->getEntityItemID() << isVisuallyReady; + //qDebug() << "EntityTpye" << EntityTypes::getEntityTypeName(entity->getType()) << entity->getEntityItemID() << isVisuallyReady; } if (isEntityPhysicsReady(entity) && isVisuallyReady) { @@ -209,7 +221,7 @@ bool SafeLanding::isEntityLoadingComplete() { if (enableInterstitial) { _trackedEntityStabilityCount++; - qDebug() << "EntityList size" << _trackedEntities.size() << "\n"; + //qDebug() << "EntityList size" << _trackedEntities.size() << "\n"; } diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp index 3a01650a04..7df9762158 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.cpp @@ -314,6 +314,14 @@ void RenderableModelEntityItem::getCollisionGeometryResource() { _compoundShapeResource = DependencyManager::get()->getCollisionGeometryResource(hullURL); } +bool RenderableModelEntityItem::computeShapeFailedToLoad() { + if (!_compoundShapeResource) { + getCollisionGeometryResource(); + } + + return (_compoundShapeResource && _compoundShapeResource->isFailed()); +} + void RenderableModelEntityItem::setShapeType(ShapeType type) { ModelEntityItem::setShapeType(type); if (getShapeType() == SHAPE_TYPE_COMPOUND) { @@ -342,7 +350,6 @@ void RenderableModelEntityItem::setCompoundShapeURL(const QString& url) { bool RenderableModelEntityItem::isReadyToComputeShape() const { ShapeType type = getShapeType(); - auto model = getModel(); if (type == SHAPE_TYPE_COMPOUND) { if (!model || getCompoundShapeURL().isEmpty()) { diff --git a/libraries/entities-renderer/src/RenderableModelEntityItem.h b/libraries/entities-renderer/src/RenderableModelEntityItem.h index 75f35fae9c..6fcfa04a1d 100644 --- a/libraries/entities-renderer/src/RenderableModelEntityItem.h +++ b/libraries/entities-renderer/src/RenderableModelEntityItem.h @@ -81,6 +81,7 @@ public: virtual bool isReadyToComputeShape() const override; virtual void computeShapeInfo(ShapeInfo& shapeInfo) override; + bool computeShapeFailedToLoad(); virtual bool contains(const glm::vec3& point) const override; void stopModelOverrideIfNoParent(); diff --git a/libraries/model-networking/src/model-networking/ModelCache.cpp b/libraries/model-networking/src/model-networking/ModelCache.cpp index f669e8aaef..4d6297303b 100644 --- a/libraries/model-networking/src/model-networking/ModelCache.cpp +++ b/libraries/model-networking/src/model-networking/ModelCache.cpp @@ -551,6 +551,11 @@ QUrl NetworkMaterial::getTextureUrl(const QUrl& baseUrl, const FBXTexture& textu graphics::TextureMapPointer NetworkMaterial::fetchTextureMap(const QUrl& baseUrl, const FBXTexture& fbxTexture, image::TextureUsage::Type type, MapChannel channel) { + + if (baseUrl.isEmpty()) { + return nullptr; + } + const auto url = getTextureUrl(baseUrl, fbxTexture); const auto texture = DependencyManager::get()->getTexture(url, type, fbxTexture.content, fbxTexture.maxNumPixels); _textures[channel] = Texture { fbxTexture.name, texture }; From 010e2091fad99a9a547b917231247e63924b3ad5 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Mon, 1 Oct 2018 14:35:47 -0700 Subject: [PATCH 50/81] Fixup CPack install items for OSX to hopefully properly handle OSX .app directories --- server-console/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index 1b6a644e7c..a30027989e 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -39,12 +39,14 @@ endif () # install the packaged Server Console in our install directory if (APPLE) install( - PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + USE_SOURCE_PERMISSIONS DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${SERVER_COMPONENT} ) install( - PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + USE_SOURCE_PERMISSIONS DESTINATION ${CONSOLE_INSTALL_DIR} COMPONENT ${CLIENT_COMPONENT} ) From 66bb5f68d28d2455001266b2ef96d3e086cc1395 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Mon, 1 Oct 2018 15:26:56 -0700 Subject: [PATCH 51/81] updating interstitialmode --- interface/src/octree/SafeLanding.cpp | 18 +----------------- scripts/system/interstitialPage.js | 1 + 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index 6f341c1990..6b28d9c713 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -123,19 +123,6 @@ bool SafeLanding::isLoadSequenceComplete() { float SafeLanding::loadingProgressPercentage() { Locker lock(_lock); - - float sequencePercentage = 0.0f; - - if (_initialStart != INVALID_SEQUENCE && _initialEnd != 0) { - int sequenceSize = _initialStart <= _initialEnd ? _initialEnd - _initialStart: - _initialEnd + SEQUENCE_MODULO - _initialStart; - - auto startIter = _sequenceNumbers.find(_initialStart); - auto endIter = _sequenceNumbers.find(_initialEnd - 1); - - sequencePercentage = (distance(startIter, endIter) / (sequenceSize - 1)); - } - static const int MINIMUM_TRACKED_ENTITY_STABILITY_COUNT = 15; float entityReadyPercentage = 0.0f; @@ -147,7 +134,7 @@ float SafeLanding::loadingProgressPercentage() { entityReadyPercentage *= 0.20f; } - return ((sequencePercentage *= 0.50f) + (entityReadyPercentage *= 0.50f)); + return entityReadyPercentage; } bool SafeLanding::isSequenceNumbersComplete() { @@ -204,8 +191,6 @@ bool SafeLanding::isEntityLoadingComplete() { if (enableInterstitial) { isVisuallyReady = (entity->isVisuallyReady() || !entityTree->renderableForEntityId(entityMapIter->first)); - - //qDebug() << "EntityTpye" << EntityTypes::getEntityTypeName(entity->getType()) << entity->getEntityItemID() << isVisuallyReady; } if (isEntityPhysicsReady(entity) && isVisuallyReady) { @@ -221,7 +206,6 @@ bool SafeLanding::isEntityLoadingComplete() { if (enableInterstitial) { _trackedEntityStabilityCount++; - //qDebug() << "EntityList size" << _trackedEntities.size() << "\n"; } diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index 00d62d7fc6..f066529375 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -264,6 +264,7 @@ function domainChanged(domain) { if (domain !== currentDomain) { MyAvatar.restoreAnimation(); + resetValues(); var name = location.placename; domainName = name.charAt(0).toUpperCase() + name.slice(1); var doRequest = true; From 69b547a9fe16cfe7422ab8ec4095cb353d06362c Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Mon, 1 Oct 2018 16:11:27 -0700 Subject: [PATCH 52/81] text overlays for consistency --- scripts/system/interstitialPage.js | 64 +++++++++++--- scripts/system/redirectOverlays.js | 132 ++++++++++++++++++++++++----- 2 files changed, 164 insertions(+), 32 deletions(-) diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index 00d62d7fc6..38521208c7 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -38,7 +38,6 @@ var button = null; var errorConnectingToDomain = false; - var resettingError = false; // Tips have a character limit of 69 var userTips = [ @@ -128,7 +127,7 @@ localPosition: { x: 0.0 , y: -1.6, z: 0.0 }, text: toolTip, textAlpha: 1, - backgroundAlpha: 1, + backgroundAlpha: 0.00393, lineHeight: 0.13, visible: isVisible, ignoreRayIntersection: true, @@ -138,17 +137,47 @@ parentID: anchorOverlay }); - var loadingToTheSpotID = Overlays.addOverlay("image3d", { + var loadingToTheSpotText = Overlays.addOverlay("text3d", { name: "Loading-Destination-Card-Text", - localPosition: { x: 0.0 , y: -1.5, z: -0.3 }, - url: Script.resourcesPath() + "images/interstitialPage/goTo_button.png", + localPosition: { x: 0.0 , y: -1.687, z: -0.3 }, + text: "Go To TheSpot", + textAlpha: 1, + backgroundAlpha: 0.00393, + lineHeight: 0.10, + visible: isVisible, + ignoreRayIntersection: true, + dimensions: {x: 1, y: 0.17}, + drawInFront: true, + grabbable: false, + localOrientation: Quat.fromVec3Degrees({ x: 0, y: 180, z: 0 }), + parentID: anchorOverlay + }); + + var loadingToTheSpotID = Overlays.addOverlay("image3d", { + name: "Loading-Destination-Card-GoTo-Image", + localPosition: { x: 0.0 , y: -1.75, z: -0.3 }, + url: Script.resourcesPath() + "images/interstitialPage/button.png", alpha: 1, visible: isVisible, emissive: true, ignoreRayIntersection: false, drawInFront: true, grabbable: false, - localOrientation: Quat.fromVec3Degrees({ x: 0.0, y: 180.0, z: 0.0 }), + localOrientation: Quat.fromVec3Degrees({ x: 0, y: 180, z: 0 }), + parentID: anchorOverlay + }); + + var loadingToTheSpotHoverID = Overlays.addOverlay("image3d", { + name: "Loading-Destination-Card-GoTo-Image-Hover", + localPosition: { x: 0.0 , y: -1.75, z: -0.3 }, + url: Script.resourcesPath() + "images/interstitialPage/button_hover.png", + alpha: 1, + visible: false, + emissive: true, + ignoreRayIntersection: false, + drawInFront: true, + grabbable: false, + localOrientation: Quat.fromVec3Degrees({ x: 0, y: 180, z: 0 }), parentID: anchorOverlay }); @@ -268,7 +297,7 @@ domainName = name.charAt(0).toUpperCase() + name.slice(1); var doRequest = true; if (name.length === 0 && location.href === "file:///~/serverless/tutorial.json") { - domainName = "Serveless Domain (Tutorial)"; + domainName = "Serverless Domain (Tutorial)"; doRequest = false; } var domainNameLeftMargin = getLeftMargin(domainNameTextID, domainName); @@ -319,8 +348,10 @@ var THE_PLACE = (HifiAbout.buildVersion === "dev") ? "hifi://TheSpot-dev": "hifi://TheSpot"; function clickedOnOverlay(overlayID, event) { - if (loadingToTheSpotID === overlayID) { + if (loadingToTheSpotHoverID === overlayID) { location.handleLookupString(THE_PLACE); + Overlays.editOverlay(loadingToTheSpotHoverID, {visible: false}); + Overlays.editOverlay(loadingToTheSpotID, {visible: true}); } } @@ -353,6 +384,7 @@ renderViewTask.getConfig("LightingModel")["enableDirectionalLight"] = physicsEnabled; renderViewTask.getConfig("LightingModel")["enablePointLight"] = physicsEnabled; Overlays.editOverlay(loadingSphereID, mainSphereProperties); + Overlays.editOverlay(loadingToTheSpotText, properties); Overlays.editOverlay(loadingToTheSpotID, properties); Overlays.editOverlay(domainNameTextID, properties); Overlays.editOverlay(domainDescription, domainTextProperties); @@ -475,13 +507,15 @@ Overlays.mouseReleaseOnOverlay.connect(clickedOnOverlay); Overlays.hoverEnterOverlay.connect(function(overlayID, event) { if (overlayID === loadingToTheSpotID) { - Overlays.editOverlay(loadingToTheSpotID, { color: greyColor }); + Overlays.editOverlay(loadingToTheSpotID, {visible: false}); + Overlays.editOverlay(loadingToTheSpotHoverID, {visible: true}); } }); Overlays.hoverLeaveOverlay.connect(function(overlayID, event) { - if (overlayID === loadingToTheSpotID) { - Overlays.editOverlay(loadingToTheSpotID, { color: whiteColor }); + if (overlayID === loadingToTheSpotHoverID) { + Overlays.editOverlay(loadingToTheSpotHoverID, {visible: false}); + Overlays.editOverlay(loadingToTheSpotID, {visible: true}); } }); @@ -510,9 +544,17 @@ }); } + // set left margin of text. + var loadingTextProperties = { + leftMargin: getLeftMargin(loadingToTheSpotText, "Go To TheSpot") + 0.045 + }; + + Overlays.editOverlay(loadingToTheSpotText, loadingTextProperties); + function cleanup() { Overlays.deleteOverlay(loadingSphereID); Overlays.deleteOverlay(loadingToTheSpotID); + Overlays.deleteOverlay(loadingToTheSpotHoverID); Overlays.deleteOverlay(domainNameTextID); Overlays.deleteOverlay(domainDescription); Overlays.deleteOverlay(domainToolTip); diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index 8dd7d0d26a..49844db5b0 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -43,15 +43,15 @@ leftMargin: 0.538373570564886, visible: false, emissive: true, - ignoreRayIntersection: false, + ignoreRayIntersection: true, dimensions: oopsDimensions, grabbable: false, }); - var tryAgainImage = Overlays.addOverlay("image3d", { + var tryAgainImageNeutral = Overlays.addOverlay("image3d", { name: "tryAgainImage", localPosition: {x: -0.6, y: -0.6, z: 0.0}, - url: Script.resourcesPath() + "images/interstitialPage/button_tryAgain.png", + url: Script.resourcesPath() + "images/interstitialPage/button.png", alpha: 1, visible: false, emissive: true, @@ -61,10 +61,10 @@ parentID: redirectOopsText }); - var backImage = Overlays.addOverlay("image3d", { - name: "backImage", - localPosition: {x: 0.6, y: -0.6, z: 0.0}, - url: Script.resourcesPath() + "images/interstitialPage/button_back.png", + var tryAgainImageHover = Overlays.addOverlay("image3d", { + name: "tryAgainImageHover", + localPosition: {x: -0.6, y: -0.6, z: 0.0}, + url: Script.resourcesPath() + "images/interstitialPage/button_hover.png", alpha: 1, visible: false, emissive: true, @@ -74,6 +74,62 @@ parentID: redirectOopsText }); + var tryAgainText = Overlays.addOverlay("text3d", { + name: "tryAgainText", + localPosition: {x: -0.6, y: -0.962, z: 0.0}, + text: "Try Again", + textAlpha: 1, + backgroundAlpha: 0.00393, + lineHeight: 0.08, + visible: false, + emissive: true, + ignoreRayIntersection: true, + grabbable: false, + orientation: Overlays.getProperty(redirectOopsText, "orientation"), + parentID: redirectOopsText + }); + + var backImageNeutral = Overlays.addOverlay("image3d", { + name: "backImage", + localPosition: {x: 0.6, y: -0.6, z: 0.0}, + url: Script.resourcesPath() + "images/interstitialPage/button.png", + alpha: 1, + visible: false, + emissive: true, + ignoreRayIntersection: false, + grabbable: false, + orientation: Overlays.getProperty(redirectOopsText, "orientation"), + parentID: redirectOopsText + }); + + var backImageHover = Overlays.addOverlay("image3d", { + name: "backImageHover", + localPosition: {x: 0.6, y: -0.6, z: 0.0}, + url: Script.resourcesPath() + "images/interstitialPage/button_hover.png", + alpha: 1, + visible: false, + emissive: true, + ignoreRayIntersection: false, + grabbable: false, + orientation: Overlays.getProperty(redirectOopsText, "orientation"), + parentID: redirectOopsText + }); + + var backText = Overlays.addOverlay("text3d", { + name: "backText", + localPosition: {x: 0.6, y: -0.962, z: 0.0}, + text: "Back", + textAlpha: 1, + backgroundAlpha: 0.00393, + lineHeight: 0.08, + visible: false, + emissive: true, + ignoreRayIntersection: true, + grabbable: false, + orientation: Overlays.getProperty(redirectOopsText, "orientation"), + parentID: redirectOopsText + }); + function toggleOverlays(isInErrorState) { if (!isInErrorState) { var properties = { @@ -81,8 +137,10 @@ }; Overlays.editOverlay(redirectOopsText, properties); - Overlays.editOverlay(tryAgainImage, properties); - Overlays.editOverlay(backImage, properties); + Overlays.editOverlay(tryAgainImageNeutral, properties); + Overlays.editOverlay(tryAgainImageHover, properties); + Overlays.editOverlay(backImageNeutral, properties); + Overlays.editOverlay(backImageHover, properties); return; } var oopsText = getOopsText(); @@ -104,9 +162,29 @@ leftMargin: (textOverlayWidth - textWidth) / 2 }; + var tryAgainTextWidth = Overlays.textSize(tryAgainText, "Try Again").width; + var tryAgainImageWidth = Overlays.getProperty(tryAgainImageNeutral, "dimensions").x; + + var tryAgainTextProperties = { + visible: overlaysVisible, + leftMargin: (tryAgainImageWidth - tryAgainTextWidth) / 2 + }; + + var backTextWidth = Overlays.textSize(backText, "Back").width; + var backImageWidth = Overlays.getProperty(backImageNeutral, "dimensions").x; + + var backTextProperties = { + visible: overlaysVisible, + leftMargin: (backImageWidth - backTextWidth) / 2 + }; + Overlays.editOverlay(redirectOopsText, oopsTextProperties); - Overlays.editOverlay(tryAgainImage, properties); - Overlays.editOverlay(backImage, properties); + Overlays.editOverlay(tryAgainImageNeutral, properties); + Overlays.editOverlay(backImageNeutral, properties); + Overlays.editOverlay(tryAgainImageHover, {visible: false}); + Overlays.editOverlay(backImageHover, {visible: false}); + Overlays.editOverlay(tryAgainText, tryAgainTextProperties); + Overlays.editOverlay(backText, backTextProperties); } @@ -115,9 +193,9 @@ // don't allow right-clicks. return; } - if (tryAgainImage === overlayID) { + if (tryAgainImageHover === overlayID) { location.goToLastAddress(); - } else if (backImage === overlayID) { + } else if (backImageHover === overlayID) { location.goBack(); } } @@ -126,24 +204,36 @@ Script.clearInterval(timer); timer = null; Overlays.deleteOverlay(redirectOopsText); - Overlays.deleteOverlay(tryAgainImage); - Overlays.deleteOverlay(backImage); + Overlays.deleteOverlay(tryAgainImageNeutral); + Overlays.deleteOverlay(backImageNeutral); + Overlays.deleteOverlay(tryAgainImageHover); + Overlays.deleteOverlay(backImageHover); + Overlays.deleteOverlay(tryAgainText); + Overlays.deleteOverlay(backText); } toggleOverlays(true); - var whiteColor = {red: 255, green: 255, blue: 255}; - var greyColor = {red: 125, green: 125, blue: 125}; Overlays.mouseReleaseOnOverlay.connect(clickedOnOverlay); Overlays.hoverEnterOverlay.connect(function(overlayID, event) { - if (overlayID === backImage || overlayID === tryAgainImage) { - Overlays.editOverlay(overlayID, { color: greyColor }); + if (overlayID === backImageNeutral) { + Overlays.editOverlay(backImageNeutral, {visible: false}); + Overlays.editOverlay(backImageHover, {visible: true}); + } + if (overlayID === tryAgainImageNeutral) { + Overlays.editOverlay(tryAgainImageNeutral, {visible: false}); + Overlays.editOverlay(tryAgainImageHover, {visible: true}); } }); Overlays.hoverLeaveOverlay.connect(function(overlayID, event) { - if (overlayID === backImage || overlayID === tryAgainImage) { - Overlays.editOverlay(overlayID, { color: whiteColor }); + if (overlayID === backImageHover) { + Overlays.editOverlay(backImageHover, {visible: false}); + Overlays.editOverlay(backImageNeutral, {visible: true}); + } + if (overlayID === tryAgainImageHover) { + Overlays.editOverlay(tryAgainImageHover, {visible: false}); + Overlays.editOverlay(tryAgainImageNeutral, {visible: true}); } }); From 34a7aff2efc33d78d3647341574f70b5779092c8 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Mon, 1 Oct 2018 20:12:00 -0700 Subject: [PATCH 53/81] Differentiate name of Console.app/Sandbox.app depending on client_only build --- cmake/macros/SetPackagingParameters.cmake | 7 ++++++- server-console/CMakeLists.txt | 16 ++++++++++++---- server-console/packager.js | 7 +++---- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 297382b4e5..3bf984534b 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -143,7 +143,12 @@ macro(SET_PACKAGING_PARAMETERS) set(CONSOLE_INSTALL_DIR ${DMG_SUBFOLDER_NAME}) set(INTERFACE_INSTALL_DIR ${DMG_SUBFOLDER_NAME}) - set(CONSOLE_EXEC_NAME "Sandbox.app") + if (CLIENT_ONLY) + set(CONSOLE_EXEC_NAME "Console.app") + else () + set(CONSOLE_EXEC_NAME "Sandbox.app") + endif() + set(CONSOLE_INSTALL_APP_PATH "${CONSOLE_INSTALL_DIR}/${CONSOLE_EXEC_NAME}") set(CONSOLE_APP_CONTENTS "${CONSOLE_INSTALL_APP_PATH}/Contents") diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index a30027989e..150561ffbb 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -4,13 +4,17 @@ if (PRODUCTION_BUILD) set(PRODUCTION_OPTION "--production") endif() +if (CLIENT_ONLY) + set(CLIENT_ONLY_OPTION "--client_only") +endif() + # add a target that will package the console add_custom_target(${TARGET_NAME}-npm-install COMMAND npm install WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) add_custom_target(${TARGET_NAME} - COMMAND npm run packager -- --out ${CMAKE_CURRENT_BINARY_DIR} ${PRODUCTION_OPTION} + COMMAND npm run packager -- --out ${CMAKE_CURRENT_BINARY_DIR} ${PRODUCTION_OPTION} ${CLIENT_ONLY_OPTION} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${TARGET_NAME}-npm-install ) @@ -29,7 +33,11 @@ endif() # set the packaged console folder depending on platform, so we can copy it if (APPLE) - set(PACKAGED_CONSOLE_FOLDER "Sandbox-darwin-x64/${CONSOLE_EXEC_NAME}") + if (CLIENT_ONLY) + set(PACKAGED_CONSOLE_FOLDER "Console-darwin-x64/${CONSOLE_EXEC_NAME}") + else () + set(PACKAGED_CONSOLE_FOLDER "Sandbox-darwin-x64/${CONSOLE_EXEC_NAME}") + endif() elseif (WIN32) set(PACKAGED_CONSOLE_FOLDER "server-console-win32-x64") elseif (UNIX) @@ -45,9 +53,9 @@ if (APPLE) COMPONENT ${SERVER_COMPONENT} ) install( - DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" + DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}/" USE_SOURCE_PERMISSIONS - DESTINATION ${CONSOLE_INSTALL_DIR} + DESTINATION ${CONSOLE_INSTALL_DIR}/${CONSOLE_EXEC_NAME} COMPONENT ${CLIENT_COMPONENT} ) elseif (WIN32) diff --git a/server-console/packager.js b/server-console/packager.js index 31655fe565..00866ee1be 100644 --- a/server-console/packager.js +++ b/server-console/packager.js @@ -27,14 +27,13 @@ var options = { } const EXEC_NAME = "server-console"; -const SHORT_NAME = "Console"; -const OSX_SHORT_NAME = "Sandbox"; -const FULL_NAME = "High Fidelity Console"; +var SHORT_NAME = argv.client_only ? "Console" : "Sandbox"; +var FULL_NAME = argv.client_only ? "High Fidelity Console" : "High Fidelity Sandbox"; // setup per OS options if (osType == "Darwin") { options["app-bundle-id"] = "com.highfidelity.server-console" + (argv.production ? "" : "-dev") - options["name"] = OSX_SHORT_NAME + options["name"] = SHORT_NAME } else if (osType == "Windows_NT") { options["version-string"] = { CompanyName: "High Fidelity, Inc.", From 95ef46d77c35e606a7bd952633e16313833b95d1 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Tue, 2 Oct 2018 10:00:42 -0700 Subject: [PATCH 54/81] fix some coding standards issues --- server-console/src/main.js | 8 ++++---- server-console/src/modules/hf-notifications.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server-console/src/main.js b/server-console/src/main.js index 04e77315bc..c26938745b 100644 --- a/server-console/src/main.js +++ b/server-console/src/main.js @@ -107,7 +107,7 @@ userConfig.load(configPath); const ipcMain = electron.ipcMain; -function isInterfaceInstalled() { +function isInterfaceInstalled () { if (osType == "Darwin") { // In OSX Sierra, the app translocation process moves // the executable to a random location before starting it @@ -120,7 +120,7 @@ function isInterfaceInstalled() { } } -function isServerInstalled() { +function isServerInstalled () { return dsPath && acPath; } @@ -338,7 +338,7 @@ const HifiNotificationType = hfNotifications.NotificationType; var pendingNotifications = {} var notificationState = NotificationState.UNNOTIFIED; -function setNotificationState(notificationType, pending = true) { +function setNotificationState (notificationType, pending = true) { pendingNotifications[notificationType] = pending; notificationState = NotificationState.UNNOTIFIED; for (var key in pendingNotifications) { @@ -526,7 +526,7 @@ function buildMenuArray(serverState) { menuArray.push(labels.share); menuArray.push(separator); if (isInterfaceInstalled()) { - if(trayNotifications.enabled()) { + if (trayNotifications.enabled()) { menuArray.push(labels.goto); menuArray.push(labels.people); menuArray.push(labels.wallet); diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index 13c5a6d8fa..f3b6912c08 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -123,7 +123,7 @@ HifiNotification.prototype = { timeout: 5 }, function (error, reason, metadata) { - if(_finished) { + if (_finished) { if (osType === 'Darwin') { setTimeout(_finished, OSX_CLICK_DELAY_TIMEOUT); } else { From 2d85f882b8b87c69f8bb7cda58b0fcac7eb7fa2d Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Tue, 2 Oct 2018 17:47:09 -0700 Subject: [PATCH 55/81] adding buttons --- .../resources/images/interstitialPage/button.png | Bin 0 -> 2884 bytes .../images/interstitialPage/button_hover.png | Bin 0 -> 2174 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 interface/resources/images/interstitialPage/button.png create mode 100644 interface/resources/images/interstitialPage/button_hover.png diff --git a/interface/resources/images/interstitialPage/button.png b/interface/resources/images/interstitialPage/button.png new file mode 100644 index 0000000000000000000000000000000000000000..064e44758128b86bf7e43f6e280223517b87fd5f GIT binary patch literal 2884 zcmV-K3%m4*P)>C%^e5e6K>Llp?bUM zouRkfrL){6m2sE1GW-SLE}e0gw=z^I4P~kqSD93={1;enmqIgEy0;>@OqX3)81O4@ z_oUM=c%GTFY;!tJE6sfL-P_&kRFA~=_V#9Y=v4qb1mn?YG=9i0u=9WdxE~(6X?vdj zI|lNm&oRJ*H%O14!gdk1VcbH9UkK>MhH(txehT8A${2wAD(w{BF}MfoRCTXSK!;F{ zA^bW8vp@!5+Q2>w+i3{vp@5#PQr=C$-1WHv;IV}DN(OWY=AH1cpQ>d5n70_v$04Xs z1oY%!j@9y8)iMA}5(kwXhwW(D1I$(;panAkf_jAlI(22gpF=PYQ{#S0{~o6efQO@d zD?hHM*Y@WS)Nhv2^}UpUP9w74x73isw8bzUuKK7v02Y!l-4xm}XWE$gGfY7}c(4H- z8t$;V>du};9Ci1xTC+KA04yc2`OAqWA(yvokPa_tFd-JZQI}2)zgX*eFyQvt&C)L%^ca<^#ZDv!qx>{>v zf6A&lR?>%S8PKU);lmW)QdVY|I{=R&tYc75Gn*)0n|?8mtm@41#ZJ?uEtmmVc2K`> zSW#c3kZyI5a%WC2FoyEa4PW3%bu~gxFaxm6kdE1PP&FIS-1>B^&KzFYZmOJ{bPp_a z=sExtRCrb|Jc!B+g^Yinuj{*RzBxKV?*iN^$w!Vgc{xNL7D|p&Y z*ncxT?_VoZK{pKNakYRU>HyGE#x)&RbrLdeZ|N0u!*Gs^jQlyA_`kj70IW$h{cEU< z{}KNBU13P~X04=WuAm!+a~z%h##;@*8duXza&PKu(obeQ$@neepAAm(M{g|vYhFzc zLv{R1`0Jml{B`MgP5M9aISZ?x8%(8I+MPfEV2+h^lPSf|n$DB%OnFk9>7;V~@N=2G z4FGEv(lHOeZ?e|M#+2t&GLlU=1Mr}wjC+wXug-O0TdZ+FryF0CtgZbgbj2wrD)l8>GRrJOT)$_4Y+W=7HUDGOh zGXN~KioVlx-I-85$IAIjrh5KfKm$NC1yh%ARu`L8LFaBIc_N$vU@Ey0-8VhhlLC5w z#)AU@_Y}ER{k-U%i2!Q1xh#D- zDWG3wo^+;N0br&odQjC*xw>0HrwP(^_pUrMI1B(wI2Y?#pWy(^rrR$ zfVucXE})0gl-~frOuD&%uDfH^=JxisDjERV*Uts?Aaej!Gyt?H6u;fNpI-;`c-n*q z0NSmdZvuKW8pVLFTk_LLZUAW4(~=508mgcHU?nQ(@$G>ARI_6oDCRme0JI=of3C~b z!R>$^WRCY*lLElptLMw2`6i%8qfrd#iy00E0F-%|`T5}6mBi|*=w5C}H~>&Dtu3-s zv&%3J-u^bAKW2`*uW12bCOf(6IsWl&K%dQcPynD_ZcNwdZvr}$)EAkM?uOD_NCUtW z(xu{l%`W4R#luMzbflXb0OsRuN%b6c?n(InR`s`;{64Kd1^|>*&oNiOl;-Pw_k%u} z@f!dDaMwX5oX>6-zxM_7apsronsNmIjjHF|CE`2TJ29YBg6Bqbzt`jd&`R|@P78)r zxeB_Zirxv|2>RL_0BWn}Zk4|@{O;TTxHq6vk`GkT05FqWR>tc2q&T4OOZ0EV)&G~cKx;4ASb+?~Q`oTuQ?|75> zc|3s+-Uf6MF^=RN;; z-w!tmf7emi#+iNI8r2PeaNh1!`JUx?d3djGhoXQ^H__ND*!8E>=MDgmF`Tb2`{uIn zUCP$k0y>5CAXUWpsy3Z%6E0g6Ei;=fX7xn$8gR~ zsftzetCHh23g}dhmmGLEohSf2hH#E+g6tOTx|i$PzV@W)Nt~ab|GKrc^`C-o3B9mi zH|+n>TL-`c4(Axme=peeD1`HI>2aS-b21@xhcSGsd_TL82H>HGb4ibJyzcx%lVfj8 zds5*S#ZleEf?aiY1Mm>T`LHmYV^+Rudi>6eCwDn&yP%Se;_WMo``!Uyg~K@p^KQYe zG4o!8>>D=y9i0|VGKTb*DnIAz=39hyy8&3!V2)WA?@`g8XE;Y2vz~0Kh+m`=$%&Qr z=d=VG0IX9uUuM`M!nu`zP9Z&P5Ym_5KEew%R~mqI3Fm_xV>j9l!Op}3Q*W!|A?+hRVV1>f@Fg)y6Wn-*b4d=N8 z^sSICy@-BooI?7<#{z&Q26I1E&D{o18>Vn>tbaM^>SY$B2 zZCG4JCn>jD?FH^E;05ngWw+j%6x7EmY5-O=n5z`bNAozZ&VpWi>?Vj^-n}WFJ`USy z{DxxwGypB-QY;#GQZRR?%%)fK9OT?taDyDC#+X)IjV!L~eP%!z08`{p4CR+q*(zZ7 zS;)ZV&Jr3YR?#Ilv@QwjPu0}|Fe!7osZxGkC;)~mQKsF#Vrn}@2Ri>NN!KR i9mKz{+X7er7hnKB;CO`nlfqa40000g8*F zlCs~f#Nlw56gSh~0JsFZEX#J6{06fN3gB6BlgIIU{NEvvC%(r37jGSJpNjEPj7=Ct zh`$Kv^M-K<;aLpgsmd6D_bTle-XXZxW2(AG6VOE{hYy3bJ zRw*xHFz3Ek09;F04>F*OV4fE@pJTNQ09^|KeOCnaR{{NYFo$aSi)tBwo`j~dyJGyO z?*_9$1hilVKu`}TpyN{ZZ3n@;iIe*j|9ck)0GA^_%8%E>YiAt<^}qU9`tBv5V@LLF zOB17f z=Qf_1^0I!>6yv$Uq&&t6c4jaDn&iUnfoRdY#OFaywcQ15GG*K{mza9ZOH-V0^`29RNs z8V$|+cutSO|N5x9JTUW>0AOHwmd6I=Di%Y1GmER)!4AN+1ochDRpHw)hx1m|48Vv& zx@uq5{TRb}WnVJ@BMj+D?3WrxC0#L`Z+*l7j6A3pgWo3|Oa5{1I0u00`8ThyUwU!w z7ngb{)m}IQaDgFR<&fg(xn9&HacB8>4&DZUZj05)IbP68I0HbXkbds^h1}TZ3;?x4 z`nJm#Ae;f<*NmJcX5_4kCx3P*6#%@OlZ&(Ok4`*s_@j>pfGZE_`?H;CES@kt<@BA- z5C(vdPFr!Fweducy{xGNz&HasPiPw3Hhq%0t5N|#<@~(qG(Y3gb$`co0l;`e`mvLS zvBYk)nU4Sf-ptXIrS4^&4R6oVg$4kZ8`8^GtLTL4d9Q0509q+{m;G!E0IoZr+bMbz zI=5BN0MKp~y-3-}O7#o?XRV^QWgEy<&j8R%6+L_X+YfI%eqOTuuUVG8m}UT|?5^bg zPfgN2H@^T-tAd`C92dQR?}1ZSs{(*dL%Qs0SAVT!|GdOqw!Hn#)B->wWm)>iTd7`l zc`VIg0MNXO-j*$Me>nQ%5WdqB+k4O)1^}&iIB{RtPdzF~z4P8~Lw!1b|kZ zEPh`r=(2#`m`4C;)g~pN^HYD6W!c(10ziA>q076nfc|)58#~ho0G%ie=!t*^fV10_ z1$18L!2m!b-4To!FHHGypKNfVRX90B4pG(5_$w0Ote(K}~fOdUMsi1?63K{?gQ9Tp`#>;V8k)o`AaWbI!C@z1CF{Ig`c zpG_?QG%_!_e_bclx8@Z98dcDbC0RRt?}25@+;h_l0JXw7Pc4Msx|)?`ZUE@Umy-Lx zl_mUMvlsxhT0Kvyc+~N z#a5;q0Fp9w+1gQ3A;}Y}=$UB;fRlNevMRl(y3xm!vz-6{?`G+$^>d6QR?#=69{}FW z(Ru6DbA{yJYZwE7U-C0FhHX1riB4QQfAmoRz~A!ozVlwLgzmFo>Ei%^LJ~XG zgfsw`7|zSY3_O4HbcJ^EL+otR-3`DcgmdaDa%c*h_VprDE<%0$D6b@967J@wH8FwkJm zD=cXbGn|j!OqIs5AJw!5G5`jaXUmE!!~4M(ofUVYzY3N2!dC)-o-=G#aW!~+*P%$f zxW-#=a^@=nKo7zESR=RYN4W|dFIv5?8PqCj0EQaO?O!&shc}q#dY;TMaj!w$mG#lTLuh~ZH3k^9f5Z@eHEk(~-}1E>|1QFLckVZt4PmBZ16T;@ zh3_2z1JGMA4=SL43hEHjpF8|D1ORUdOW6;72lF5U`Y5PFIL~8HYXSqHOCgN!Le*RZ z^UF|PR5tWki&gdK7}&Y*5dbZPa;TQS4YjE_8`EsY4!v11{)o2#kSYZ6pCOpXaHLN* z=9!MiqlFRL>8C1e0HWi=Z`a}9Lt4I0@jn3u0DhI-AzTnMNB{r;07*qoM6N<$f~*Gz AB>(^b literal 0 HcmV?d00001 From b28c375ad3d8d988f2027c53ab965589ebc5ab5c Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 3 Oct 2018 09:56:07 -0700 Subject: [PATCH 56/81] better loading check logic --- interface/src/octree/SafeLanding.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index 6b28d9c713..62bd1b7b89 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -116,9 +116,10 @@ bool SafeLanding::isLoadSequenceComplete() { _initialEnd = INVALID_SEQUENCE; _entityTree = nullptr; EntityTreeRenderer::setEntityLoadingPriorityFunction(StandardPriority); + return true; } - return !_trackingEntities; + return false; } float SafeLanding::loadingProgressPercentage() { @@ -149,10 +150,9 @@ bool SafeLanding::isSequenceNumbersComplete() { && endIter != _sequenceNumbers.end() && distance(startIter, endIter) == sequenceSize - 1)) { _trackingEntities = false; // Don't track anything else that comes in. - return true; } } - return false; + return !_trackingEntities; } bool isEntityPhysicsReady(const EntityItemPointer& entity) { From efeb598495335918561bb8637096d41c0ae33b1d Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Wed, 3 Oct 2018 10:12:07 -0700 Subject: [PATCH 57/81] fixing bug with hover overlay --- scripts/system/interstitialPage.js | 38 ++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index 869c47bd2a..bd542b298d 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -356,6 +356,26 @@ } } + function onEnterOverlay(overlayID, event) { + if (currentDomain === "no domain") { + return; + } + if (overlayID === loadingToTheSpotID) { + Overlays.editOverlay(loadingToTheSpotID, {visible: false}); + Overlays.editOverlay(loadingToTheSpotHoverID, {visible: true}); + } + } + + function onLeaveOverlay(overlayID, event) { + if (currentDomain === "no domain") { + return; + } + if (overlayID === loadingToTheSpotHoverID) { + Overlays.editOverlay(loadingToTheSpotHoverID, {visible: false}); + Overlays.editOverlay(loadingToTheSpotID, {visible: true}); + } + } + var currentProgress = 0.1; function updateOverlays(physicsEnabled) { @@ -482,6 +502,8 @@ if (errorConnectingToDomain) { updateOverlays(errorConnectingToDomain); + // setting hover id to invisible + Overlays.editOverlay(loadingToTheSpotHoverID, {visible: false}); endAudio(); currentDomain = "no domain"; timer = null; @@ -496,6 +518,8 @@ return; } else if ((physicsEnabled && (currentProgress >= (TOTAL_LOADING_PROGRESS - EPSILON)))) { updateOverlays((physicsEnabled || connectionToDomainFailed)); + // setting hover id to invisible + Overlays.editOverlay(loadingToTheSpotHoverID, {visible: false}); endAudio(); currentDomain = "no domain"; timer = null; @@ -506,19 +530,9 @@ var whiteColor = {red: 255, green: 255, blue: 255}; var greyColor = {red: 125, green: 125, blue: 125}; Overlays.mouseReleaseOnOverlay.connect(clickedOnOverlay); - Overlays.hoverEnterOverlay.connect(function(overlayID, event) { - if (overlayID === loadingToTheSpotID) { - Overlays.editOverlay(loadingToTheSpotID, {visible: false}); - Overlays.editOverlay(loadingToTheSpotHoverID, {visible: true}); - } - }); + Overlays.hoverEnterOverlay.connect(onEnterOverlay); - Overlays.hoverLeaveOverlay.connect(function(overlayID, event) { - if (overlayID === loadingToTheSpotHoverID) { - Overlays.editOverlay(loadingToTheSpotHoverID, {visible: false}); - Overlays.editOverlay(loadingToTheSpotID, {visible: true}); - } - }); + Overlays.hoverLeaveOverlay.connect(onLeaveOverlay); location.hostChanged.connect(domainChanged); location.lookupResultsFinished.connect(function() { From 397fe2a5344460f9de8c82866a05d89d008b1dbf Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Wed, 3 Oct 2018 13:53:46 -0700 Subject: [PATCH 58/81] Code Review Fixes --- server-console/src/modules/hf-notifications.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/server-console/src/modules/hf-notifications.js b/server-console/src/modules/hf-notifications.js index f3b6912c08..464d268c5e 100644 --- a/server-console/src/modules/hf-notifications.js +++ b/server-console/src/modules/hf-notifications.js @@ -44,7 +44,6 @@ function HifiNotification(notificationType, notificationData, menuNotificationCa HifiNotification.prototype = { show: function (finished) { - var _finished = finished; var text = ""; var message = ""; var url = null; @@ -123,11 +122,11 @@ HifiNotification.prototype = { timeout: 5 }, function (error, reason, metadata) { - if (_finished) { + if (finished) { if (osType === 'Darwin') { - setTimeout(_finished, OSX_CLICK_DELAY_TIMEOUT); + setTimeout(finished, OSX_CLICK_DELAY_TIMEOUT); } else { - _finished(); + finished(); } } }); @@ -240,7 +239,7 @@ HifiNotifications.prototype = { }, _addNotification: function (notification) { this.pendingNotifications.push(notification); - if(this.pendingNotifications.length === 1) { + if (this.pendingNotifications.length === 1) { this._showNotification(); } }, From 78268001c4c7ca668d473a6df7d9170085f2b6d0 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 3 Oct 2018 15:13:42 -0700 Subject: [PATCH 59/81] reverting logic change --- interface/src/octree/SafeLanding.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index 62bd1b7b89..f1deb06e3b 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -116,10 +116,9 @@ bool SafeLanding::isLoadSequenceComplete() { _initialEnd = INVALID_SEQUENCE; _entityTree = nullptr; EntityTreeRenderer::setEntityLoadingPriorityFunction(StandardPriority); - return true; } - return false; + return !_trackingEntities; } float SafeLanding::loadingProgressPercentage() { @@ -150,9 +149,10 @@ bool SafeLanding::isSequenceNumbersComplete() { && endIter != _sequenceNumbers.end() && distance(startIter, endIter) == sequenceSize - 1)) { _trackingEntities = false; // Don't track anything else that comes in. + returnm true; } } - return !_trackingEntities; + return false; } bool isEntityPhysicsReady(const EntityItemPointer& entity) { From b46d2319b11e77552992186422a11a1beb0906eb Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 3 Oct 2018 15:22:53 -0700 Subject: [PATCH 60/81] fix spelling error --- interface/src/octree/SafeLanding.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index f1deb06e3b..6b28d9c713 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -149,7 +149,7 @@ bool SafeLanding::isSequenceNumbersComplete() { && endIter != _sequenceNumbers.end() && distance(startIter, endIter) == sequenceSize - 1)) { _trackingEntities = false; // Don't track anything else that comes in. - returnm true; + return true; } } return false; From d6af09ca62f8e5d07b66e69499f64691882c714b Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Wed, 3 Oct 2018 17:40:42 -0700 Subject: [PATCH 61/81] ignoring entities in interstitial/saving address on 404 error --- libraries/networking/src/AddressManager.cpp | 12 +++++++- libraries/networking/src/AddressManager.h | 6 ++++ .../controllerModules/farActionGrabEntity.js | 30 +++++++++++++++++++ scripts/system/interstitialPage.js | 2 +- scripts/system/redirectOverlays.js | 4 +-- 5 files changed, 50 insertions(+), 4 deletions(-) diff --git a/libraries/networking/src/AddressManager.cpp b/libraries/networking/src/AddressManager.cpp index 8085039b02..f8ab8ceaec 100644 --- a/libraries/networking/src/AddressManager.cpp +++ b/libraries/networking/src/AddressManager.cpp @@ -161,8 +161,14 @@ void AddressManager::storeCurrentAddress() { // be loaded over http(s) // url.scheme() == URL_SCHEME_HTTP || // url.scheme() == URL_SCHEME_HTTPS || + bool isInErrorState = DependencyManager::get()->getDomainHandler().isInErrorState(); if (isConnected()) { - currentAddressHandle.set(url); + if (isInErrorState) { + // save the last address visited before the problem url. + currentAddressHandle.set(lastAddress()); + } else { + currentAddressHandle.set(url); + } } else { qCWarning(networking) << "Ignoring attempt to save current address because not connected to domain:" << url; } @@ -861,6 +867,10 @@ void AddressManager::goToUser(const QString& username, bool shouldMatchOrientati QByteArray(), nullptr, requestParams); } +bool AddressManager::canGoBack() const { + return (_backStack.size() > 0); +} + void AddressManager::refreshPreviousLookup() { // if we have a non-empty previous lookup, fire it again now (but don't re-store it in the history) if (!_previousAPILookup.isEmpty()) { diff --git a/libraries/networking/src/AddressManager.h b/libraries/networking/src/AddressManager.h index 17041a5fd7..5318822cdc 100644 --- a/libraries/networking/src/AddressManager.h +++ b/libraries/networking/src/AddressManager.h @@ -254,6 +254,12 @@ public slots: */ void goToLastAddress() { handleUrl(_lastVisitedURL, LookupTrigger::AttemptedRefresh); } + /**jsdoc + * Returns if going back is possible. + * @function location.canGoBack + */ + bool canGoBack() const; + /**jsdoc * Refresh the current address, e.g., after connecting to a domain in order to position the user to the desired location. * @function location.refreshPreviousLookup diff --git a/scripts/system/controllers/controllerModules/farActionGrabEntity.js b/scripts/system/controllers/controllerModules/farActionGrabEntity.js index 5e798ed680..2e73526728 100644 --- a/scripts/system/controllers/controllerModules/farActionGrabEntity.js +++ b/scripts/system/controllers/controllerModules/farActionGrabEntity.js @@ -110,6 +110,8 @@ Script.include("/~/system/libraries/Xform.js"); this.reticleMinY = MARGIN; this.reticleMaxY; + this.ignoredEntities = []; + var ACTION_TTL = 15; // seconds var DISTANCE_HOLDING_RADIUS_FACTOR = 3.5; // multiplied by distance between hand and object @@ -314,6 +316,17 @@ Script.include("/~/system/libraries/Xform.js"); return point2d; }; + this.restoreIgnoredEntities = function() { + for (var i = 0; i < this.ignoredEntities; i++) { + var data = { + action: 'remove', + id: this.ignoredEntities[i] + }; + Messages.sendMessage('Hifi-Hand-RayPick-Blacklist', JSON.stringify(data)); + } + this.ignoredEntities = []; + }; + this.notPointingAtEntity = function(controllerData) { var intersection = controllerData.rayPicks[this.hand]; var entityProperty = Entities.getEntityProperties(intersection.objectID); @@ -323,6 +336,15 @@ Script.include("/~/system/libraries/Xform.js"); if ((intersection.type === Picks.INTERSECTED_ENTITY && entityType === "Web") || intersection.type === Picks.INTERSECTED_OVERLAY || Window.isPointOnDesktopWindow(point2d)) { return true; + } else if (intersection.type === Picks.INTERSECTED_ENTITY && !Window.isPhysicsEnabled()) { + // add to ignored items. + var data = { + action: 'add', + id: intersection.objectID + }; + Messages.sendMessage('Hifi-Hand-RayPick-Blacklist', JSON.stringify(data)); + this.ignoredEntities.push(intersection.objectID); + } return false; }; @@ -383,6 +405,7 @@ Script.include("/~/system/libraries/Xform.js"); this.isReady = function (controllerData) { if (HMD.active) { if (this.notPointingAtEntity(controllerData)) { + this.restoreIgnoredEntities(); return makeRunningValues(false, [], []); } @@ -394,9 +417,11 @@ Script.include("/~/system/libraries/Xform.js"); return makeRunningValues(true, [], []); } else { this.destroyContextOverlay(); + this.restoreIgnoredEntities(); return makeRunningValues(false, [], []); } } + this.restoreIgnoredEntities(); return makeRunningValues(false, [], []); }; @@ -407,6 +432,7 @@ Script.include("/~/system/libraries/Xform.js"); Selection.removeFromSelectedItemsList(DISPATCHER_HOVERING_LIST, "entity", this.highlightedEntity); this.highlightedEntity = null; + this.restoreIgnoredEntities(); return makeRunningValues(false, [], []); } this.intersectionDistance = controllerData.rayPicks[this.hand].distance; @@ -437,6 +463,7 @@ Script.include("/~/system/libraries/Xform.js"); if (nearGrabReadiness[k].active && (nearGrabReadiness[k].targets[0] === this.grabbedThingID || HMD.tabletID && nearGrabReadiness[k].targets[0] === HMD.tabletID)) { this.endFarGrabAction(); + this.restoreIgnoredEntities(); return makeRunningValues(false, [], []); } } @@ -448,6 +475,7 @@ Script.include("/~/system/libraries/Xform.js"); for (var j = 0; j < nearGrabReadiness.length; j++) { if (nearGrabReadiness[j].active) { this.endFarGrabAction(); + this.restoreIgnoredEntities(); return makeRunningValues(false, [], []); } } @@ -466,6 +494,7 @@ Script.include("/~/system/libraries/Xform.js"); ]); if (targetProps.href !== "") { AddressManager.handleLookupString(targetProps.href); + this.restoreIgnoredEntities(); return makeRunningValues(false, [], []); } @@ -583,6 +612,7 @@ Script.include("/~/system/libraries/Xform.js"); Selection.removeFromSelectedItemsList(DISPATCHER_HOVERING_LIST, "entity", this.highlightedEntity); this.highlightedEntity = null; + this.restoreIgnoredEntities(); return makeRunningValues(false, [], []); } } diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index bd542b298d..39b4821192 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -475,7 +475,7 @@ if (textureMemSizeStabilityCount >= 15) { if (textureResourceGPUMemSize > 0) { - print((texturePopulatedGPUMemSize / textureResourceGPUMemSize)); + // print((texturePopulatedGPUMemSize / textureResourceGPUMemSize)); var gpuPercantage = (TOTAL_LOADING_PROGRESS * 0.6) * (texturePopulatedGPUMemSize / textureResourceGPUMemSize); var totalProgress = progress + gpuPercantage; if (totalProgress >= target) { diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index 49844db5b0..7f4193e4e9 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -195,7 +195,7 @@ } if (tryAgainImageHover === overlayID) { location.goToLastAddress(); - } else if (backImageHover === overlayID) { + } else if (backImageHover === overlayID && location.canGoBack()) { location.goBack(); } } @@ -216,7 +216,7 @@ Overlays.mouseReleaseOnOverlay.connect(clickedOnOverlay); Overlays.hoverEnterOverlay.connect(function(overlayID, event) { - if (overlayID === backImageNeutral) { + if (overlayID === backImageNeutral && location.canGoBack()) { Overlays.editOverlay(backImageNeutral, {visible: false}); Overlays.editOverlay(backImageHover, {visible: true}); } From 22a9030fb50b1cb5367ebe7390cc3e3795212866 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Wed, 3 Oct 2018 17:54:46 -0700 Subject: [PATCH 62/81] hiding text overlays when out of error state --- scripts/system/redirectOverlays.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index 7f4193e4e9..eeccb25334 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -141,6 +141,8 @@ Overlays.editOverlay(tryAgainImageHover, properties); Overlays.editOverlay(backImageNeutral, properties); Overlays.editOverlay(backImageHover, properties); + Overlays.editOverlay(tryAgainText, properties); + Overlays.editOverlay(backText, properties); return; } var oopsText = getOopsText(); From c785efec844f80e9dee9e88739643b6f5c5d9d7b Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Thu, 4 Oct 2018 10:56:04 -0700 Subject: [PATCH 63/81] removing extraneous bool --- interface/src/octree/SafeLanding.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index 6b28d9c713..62fbe12acb 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -187,8 +187,6 @@ bool SafeLanding::isEntityLoadingComplete() { bool isVisuallyReady = true; - bool enableInterstitial = DependencyManager::get()->getDomainHandler().getInterstitialModeEnabled(); - if (enableInterstitial) { isVisuallyReady = (entity->isVisuallyReady() || !entityTree->renderableForEntityId(entityMapIter->first)); } From ee3fd8107050088598512f98f2217578d01e79e7 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 4 Oct 2018 11:33:01 -0700 Subject: [PATCH 64/81] Code review fixes from birarda --- cmake/macros/SetPackagingParameters.cmake | 2 +- cmake/templates/NSIS.template.in | 3 ++- server-console/CMakeLists.txt | 8 +------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/cmake/macros/SetPackagingParameters.cmake b/cmake/macros/SetPackagingParameters.cmake index 3bf984534b..1b7243d4f2 100644 --- a/cmake/macros/SetPackagingParameters.cmake +++ b/cmake/macros/SetPackagingParameters.cmake @@ -18,7 +18,7 @@ macro(SET_PACKAGING_PARAMETERS) set(BUILD_GLOBAL_SERVICES "DEVELOPMENT") set(USE_STABLE_GLOBAL_SERVICES 0) set(BUILD_NUMBER 0) - set(APP_USER_MODEL_ID "com.highfidelity.console") + set(APP_USER_MODEL_ID "com.highfidelity.console-dev") set_from_env(RELEASE_TYPE RELEASE_TYPE "DEV") set_from_env(RELEASE_NUMBER RELEASE_NUMBER "") diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index 3226712519..b3c3145672 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -412,7 +412,7 @@ Section "-Previous Install Cleanup" Delete "$INSTDIR\@AC_EXEC_NAME@" ; delete interface so it's not there for server-only installs - Delete "$INSTDIR\@INTERFACE_WIN_EXEC_NAME@" + Delete "$INSTDIR\@INTERFACE_WIN_EXEC_NAME@" SectionEnd @CPACK_NSIS_INSTALLATION_TYPES@ @@ -1005,6 +1005,7 @@ Function HandlePostInstallOptions ${EndIf} ${If} $LaunchConsoleNowState == ${BST_CHECKED} + ${AndIf} @SERVER_COMPONENT_CONDITIONAL@ !insertmacro WriteInstallOption @SERVER_LAUNCH_NOW_REG_KEY@ YES ; both launches use the explorer trick in case the user has elevated permissions for the installer diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index 150561ffbb..6e02c2df00 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -28,7 +28,7 @@ if (BUILD_CLIENT) endif() if (BUILD_SERVER) - add_dependencies(${TARGET_NAME} assignment-client domain-server interface) + add_dependencies(${TARGET_NAME} assignment-client domain-server) endif() # set the packaged console folder depending on platform, so we can copy it @@ -64,12 +64,6 @@ elseif (WIN32) install( DIRECTORY "${CONSOLE_DESTINATION}/" DESTINATION ${CONSOLE_INSTALL_DIR} - COMPONENT ${SERVER_COMPONENT} - ) - install( - DIRECTORY "${CONSOLE_DESTINATION}/" - DESTINATION ${CONSOLE_INSTALL_DIR} - COMPONENT ${CLIENT_COMPONENT} ) # sign the copied server console executable after install From f74d9ada209205fb15def68874be2197c97fabad Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 4 Oct 2018 12:38:34 -0700 Subject: [PATCH 65/81] Code review fix --- server-console/CMakeLists.txt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index 6e02c2df00..0c35567d28 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -49,14 +49,7 @@ if (APPLE) install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" USE_SOURCE_PERMISSIONS - DESTINATION ${CONSOLE_INSTALL_DIR} - COMPONENT ${SERVER_COMPONENT} - ) - install( - DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}/" - USE_SOURCE_PERMISSIONS - DESTINATION ${CONSOLE_INSTALL_DIR}/${CONSOLE_EXEC_NAME} - COMPONENT ${CLIENT_COMPONENT} + DESTINATION ${CONSOLE_INSTALL_DIR} ) elseif (WIN32) set(CONSOLE_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}") From 2e3566bc73d80df75b40b0c5adbb33dd77e494da Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Thu, 4 Oct 2018 14:24:43 -0700 Subject: [PATCH 66/81] hide overlays after clicking on them --- scripts/system/redirectOverlays.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index eeccb25334..2669cb0120 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -196,8 +196,22 @@ return; } if (tryAgainImageHover === overlayID) { + // hide try again overlays. + var properties = { + visible: false + }; + Overlays.editOverlay(tryAgainImageNeutral, properties); + Overlays.editOverlay(tryAgainImageHover, properties); + Overlays.editOverlay(tryAgainText, properties); location.goToLastAddress(); } else if (backImageHover === overlayID && location.canGoBack()) { + // hide back overlays. + var properties = { + visible: false + }; + Overlays.editOverlay(backImageNeutral, properties); + Overlays.editOverlay(backImageHover, properties); + Overlays.editOverlay(backText, properties); location.goBack(); } } From bda9735b5dc077eec1ab246d8e0b8646b42b88ae Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 4 Oct 2018 15:01:16 -0700 Subject: [PATCH 67/81] fix loading progress --- interface/src/Application.cpp | 5 ++++- interface/src/Application.h | 2 +- interface/src/octree/SafeLanding.cpp | 14 +++++++------- .../entities-renderer/src/EntityTreeRenderer.cpp | 2 +- .../src/RenderableParticleEffectEntityItem.cpp | 10 ++++++++++ .../entities/src/ParticleEffectEntityItem.cpp | 3 ++- libraries/networking/src/DomainHandler.h | 2 +- scripts/defaultScripts.js | 4 ++-- scripts/system/interstitialPage.js | 2 +- 9 files changed, 29 insertions(+), 15 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 757007267f..358b0c94ba 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6575,6 +6575,7 @@ bool Application::gpuTextureMemSizeStable() { qint64 textureResourceGPUMemSize = renderStats->textureResourceGPUMemSize; qint64 texturePopulatedGPUMemSize = renderStats->textureResourcePopulatedGPUMemSize; + qint64 textureTransferSize = renderStats->texturePendingGPUTransferSize; if (_gpuTextureMemSizeAtLastCheck == textureResourceGPUMemSize) { _gpuTextureMemSizeStabilityCount++; @@ -6584,8 +6585,10 @@ bool Application::gpuTextureMemSizeStable() { _gpuTextureMemSizeAtLastCheck = textureResourceGPUMemSize; if (_gpuTextureMemSizeStabilityCount >= _minimumGPUTextureMemSizeStabilityCount) { - return (textureResourceGPUMemSize == texturePopulatedGPUMemSize); + qDebug() << "GPU checking"; + return (textureResourceGPUMemSize == texturePopulatedGPUMemSize) && (textureTransferSize == 0); } + qDebug() << "GPU not ready"; return false; } diff --git a/interface/src/Application.h b/interface/src/Application.h index cb37e655fc..01c0f3770c 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -587,7 +587,7 @@ private: QElapsedTimer _lastTimeUpdated; QElapsedTimer _lastTimeRendered; - int _minimumGPUTextureMemSizeStabilityCount { 15 }; + int _minimumGPUTextureMemSizeStabilityCount { 20 }; ShapeManager _shapeManager; PhysicalEntitySimulationPointer _entitySimulation; diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index 6b28d9c713..a4dc086ad8 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -83,8 +83,6 @@ void SafeLanding::addTrackedEntity(const EntityItemID& entityID) { } qCDebug(interfaceapp) << "Safe Landing: Tracking entity " << entity->getItemName(); } - } else { - qCDebug(interfaceapp) << "Safe Landing: Null Entity: " << entityID; } } @@ -109,12 +107,13 @@ void SafeLanding::noteReceivedsequenceNumber(int sequenceNumber) { } bool SafeLanding::isLoadSequenceComplete() { + qDebug() << "is sequence complete" << isSequenceNumbersComplete(); if (isEntityLoadingComplete() && isSequenceNumbersComplete()) { Locker lock(_lock); - _trackedEntities.clear(); _initialStart = INVALID_SEQUENCE; _initialEnd = INVALID_SEQUENCE; _entityTree = nullptr; + _trackingEntities = false; // Don't track anything else that comes in. EntityTreeRenderer::setEntityLoadingPriorityFunction(StandardPriority); } @@ -148,7 +147,6 @@ bool SafeLanding::isSequenceNumbersComplete() { (startIter != _sequenceNumbers.end() && endIter != _sequenceNumbers.end() && distance(startIter, endIter) == sequenceSize - 1)) { - _trackingEntities = false; // Don't track anything else that comes in. return true; } } @@ -187,10 +185,12 @@ bool SafeLanding::isEntityLoadingComplete() { bool isVisuallyReady = true; - bool enableInterstitial = DependencyManager::get()->getDomainHandler().getInterstitialModeEnabled(); - if (enableInterstitial) { - isVisuallyReady = (entity->isVisuallyReady() || !entityTree->renderableForEntityId(entityMapIter->first)); + auto entityRenderable = entityTree->renderableForEntityId(entityMapIter->first); + if (!entityRenderable) { + entityTree->addingEntity(entityMapIter->first); + } + isVisuallyReady = entity->isVisuallyReady() || (!entityRenderable && !entity->isParentPathComplete()); } if (isEntityPhysicsReady(entity) && isVisuallyReady) { diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index dbbf8af4b9..6e82d26f29 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -310,10 +310,10 @@ void EntityTreeRenderer::addPendingEntities(const render::ScenePointer& scene, r } auto entityID = entity->getEntityItemID(); - processedIds.insert(entityID); auto renderable = EntityRenderer::addToScene(*this, entity, scene, transaction); if (renderable) { _entitiesInScene.insert({ entityID, renderable }); + processedIds.insert(entityID); } } diff --git a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp index 1a263fba79..f51a3f7740 100644 --- a/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableParticleEffectEntityItem.cpp @@ -104,6 +104,10 @@ void ParticleEffectEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePoi _networkTexture.reset(); }); } + + withWriteLock([&] { + entity->setVisuallyReady(true); + }); } else { bool textureNeedsUpdate = resultWithReadLock([&]{ return !_networkTexture || _networkTexture->getURL() != QUrl(_particleProperties.textures); @@ -113,6 +117,12 @@ void ParticleEffectEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePoi _networkTexture = DependencyManager::get()->getTexture(_particleProperties.textures); }); } + + if (_networkTexture) { + withWriteLock([&] { + entity->setVisuallyReady(_networkTexture->isFailed() || _networkTexture->isLoaded()); + }); + } } void* key = (void*)this; diff --git a/libraries/entities/src/ParticleEffectEntityItem.cpp b/libraries/entities/src/ParticleEffectEntityItem.cpp index 238f41b05f..a0c12d8ee0 100644 --- a/libraries/entities/src/ParticleEffectEntityItem.cpp +++ b/libraries/entities/src/ParticleEffectEntityItem.cpp @@ -166,6 +166,7 @@ ParticleEffectEntityItem::ParticleEffectEntityItem(const EntityItemID& entityIte { _type = EntityTypes::ParticleEffect; setColor(DEFAULT_COLOR); + _visuallyReady = false; } void ParticleEffectEntityItem::setAlpha(float alpha) { @@ -777,4 +778,4 @@ particle::Properties ParticleEffectEntityItem::getParticleProperties() const { } return result; -} \ No newline at end of file +} diff --git a/libraries/networking/src/DomainHandler.h b/libraries/networking/src/DomainHandler.h index 1ff88b425d..ddd23339df 100644 --- a/libraries/networking/src/DomainHandler.h +++ b/libraries/networking/src/DomainHandler.h @@ -231,7 +231,7 @@ private: QString _pendingPath; QTimer _settingsTimer; mutable ReadWriteLockable _interstitialModeSettingLock; - Setting::Handle _enableInterstitialMode{ "enableInterstitialMode", false }; + Setting::Handle _enableInterstitialMode{ "enableInterstitialMode", true }; QSet _domainConnectionRefusals; bool _hasCheckedForAccessToken { false }; diff --git a/scripts/defaultScripts.js b/scripts/defaultScripts.js index 42341a8484..b8dcd22923 100644 --- a/scripts/defaultScripts.js +++ b/scripts/defaultScripts.js @@ -39,8 +39,8 @@ var DEFAULT_SCRIPTS_SEPARATE = [ ]; if (Window.interstitialModeEnabled) { - DEFAULT_SCRIPTS_SEPARATE.push("system/interstitialPage.js"); - DEFAULT_SCRIPTS_SEPARATE.push("system/redirectOverlays.js"); + DEFAULT_SCRIPTS_COMBINED.push("system/interstitialPage.js"); + DEFAULT_SCRIPTS_COMBINED.push("system/redirectOverlays.js"); } // add a menu item for debugging diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index bd542b298d..00db9b1909 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -472,7 +472,7 @@ textureMemSizeAtLastCheck = textureResourceGPUMemSize; - if (textureMemSizeStabilityCount >= 15) { + if (textureMemSizeStabilityCount >= 20) { if (textureResourceGPUMemSize > 0) { print((texturePopulatedGPUMemSize / textureResourceGPUMemSize)); From 265bafecba22f5d5959b2f636b779a2af37e5911 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Thu, 4 Oct 2018 15:36:31 -0700 Subject: [PATCH 68/81] More CR Fixes --- cmake/templates/NSIS.template.in | 38 ++++++++++++++++++-------------- server-console/CMakeLists.txt | 2 +- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index b3c3145672..fd48a792dc 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -1004,32 +1004,38 @@ Function HandlePostInstallOptions ${EndIf} ${EndIf} - ${If} $LaunchConsoleNowState == ${BST_CHECKED} - ${AndIf} @SERVER_COMPONENT_CONDITIONAL@ - !insertmacro WriteInstallOption @SERVER_LAUNCH_NOW_REG_KEY@ YES - - ; both launches use the explorer trick in case the user has elevated permissions for the installer - ${If} $LaunchClientNowState == ${BST_CHECKED} + ${If} $LaunchClientNowState == ${BST_CHECKED} !insertmacro WriteInstallOption @CLIENT_LAUNCH_NOW_REG_KEY@ YES + ${Else} + !insertmacro WriteInstallOption @CLIENT_LAUNCH_NOW_REG_KEY@ NO + ${EndIf} + + ${If} $LaunchConsoleNowState == ${BST_CHECKED} + !insertmacro WriteInstallOption @SERVER_LAUNCH_NOW_REG_KEY@ YES + ${Else} + !insertmacro WriteInstallOption @SERVER_LAUNCH_NOW_REG_KEY@ NO + ${EndIf} + + ${If} $LaunchConsoleNowState == ${BST_CHECKED} + ${If} @SERVER_COMPONENT_CONDITIONAL@ + ${AndIf} $LaunchClientNowState == ${BST_CHECKED} + ${AndIf} @CLIENT_COMPONENT_CONDITIONAL@ + ; both launches use the explorer trick in case the user has elevated permissions for the installer ; create shortcut with ARGUMENTS CreateShortCut "$TEMP\ConsoleShortcut.lnk" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@" "-- --launchInterface" Exec '"$WINDIR\explorer.exe" "$TEMP\ConsoleShortcut.lnk"' ${Else} - !insertmacro WriteInstallOption @CLIENT_LAUNCH_NOW_REG_KEY@ NO Exec '"$WINDIR\explorer.exe" "$INSTDIR\@CONSOLE_INSTALL_SUBDIR@\@CONSOLE_WIN_EXEC_NAME@"' ${EndIf} + ${EndIf} - ${ElseIf} @CLIENT_COMPONENT_CONDITIONAL@ - !insertmacro WriteInstallOption @SERVER_LAUNCH_NOW_REG_KEY@ NO - - ; launch uses the explorer trick in case the user has elevated permissions for the installer - ${If} $LaunchClientNowState == ${BST_CHECKED} - !insertmacro WriteInstallOption @CLIENT_LAUNCH_NOW_REG_KEY@ YES + ${If} $LaunchClientNowState == ${BST_CHECKED} + ${AndIf} @CLIENT_COMPONENT_CONDITIONAL@ + ${Unless} $LaunchConsoleNowState == ${BST_CHECKED} + ${OrUnless} @SERVER_COMPONENT_CONDITIONAL@ + ; launch uses the explorer trick in case the user has elevated permissions for the installer Exec '"$WINDIR\explorer.exe" "$INSTDIR\@INTERFACE_WIN_EXEC_NAME@"' - ${Else} - !insertmacro WriteInstallOption @CLIENT_LAUNCH_NOW_REG_KEY@ NO ${EndIf} - ${EndIf} FunctionEnd diff --git a/server-console/CMakeLists.txt b/server-console/CMakeLists.txt index 0c35567d28..49742cacf0 100644 --- a/server-console/CMakeLists.txt +++ b/server-console/CMakeLists.txt @@ -49,7 +49,7 @@ if (APPLE) install( DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}" USE_SOURCE_PERMISSIONS - DESTINATION ${CONSOLE_INSTALL_DIR} + DESTINATION ${CONSOLE_INSTALL_DIR} ) elseif (WIN32) set(CONSOLE_DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER}") From 2a3b4a85c7cffbf39883d7bfce39d2a763d60628 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 4 Oct 2018 15:57:05 -0700 Subject: [PATCH 69/81] debugging --- interface/src/octree/SafeLanding.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index a4dc086ad8..3077762a08 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -186,10 +186,13 @@ bool SafeLanding::isEntityLoadingComplete() { bool isVisuallyReady = true; if (enableInterstitial) { + bool hasRenderable = true; auto entityRenderable = entityTree->renderableForEntityId(entityMapIter->first); if (!entityRenderable) { + hasRenderable = false; entityTree->addingEntity(entityMapIter->first); } + qDebug() << EntityTypes::getEntityTypeName(entity->getType()) << entity->isVisuallyReady() << hasRenderable << entity->isParentPathComplete(); isVisuallyReady = entity->isVisuallyReady() || (!entityRenderable && !entity->isParentPathComplete()); } @@ -204,6 +207,10 @@ bool SafeLanding::isEntityLoadingComplete() { } } + if (!_trackedEntities.empty()) { + qDebug() << "\n"; + } + if (enableInterstitial) { _trackedEntityStabilityCount++; } From c423305bd1639f697f6737e3499b873a05de2a34 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Thu, 4 Oct 2018 16:30:48 -0700 Subject: [PATCH 70/81] check overlay visibility before showing back up again --- scripts/system/redirectOverlays.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index 2669cb0120..d7b58eb668 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -243,11 +243,11 @@ }); Overlays.hoverLeaveOverlay.connect(function(overlayID, event) { - if (overlayID === backImageHover) { + if (overlayID === backImageHover && Overlays.getProperty(backImageHover, "visible")) { Overlays.editOverlay(backImageHover, {visible: false}); Overlays.editOverlay(backImageNeutral, {visible: true}); } - if (overlayID === tryAgainImageHover) { + if (overlayID === tryAgainImageHover && Overlays.getProperty(tryAgainImageHover, "visible")) { Overlays.editOverlay(tryAgainImageHover, {visible: false}); Overlays.editOverlay(tryAgainImageNeutral, {visible: true}); } From a2237aa48a3e4793d4a3825648566f874ea35e92 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Thu, 4 Oct 2018 16:41:14 -0700 Subject: [PATCH 71/81] reverting click overlay behavior --- scripts/system/redirectOverlays.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index d7b58eb668..8f42990b7d 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -196,22 +196,8 @@ return; } if (tryAgainImageHover === overlayID) { - // hide try again overlays. - var properties = { - visible: false - }; - Overlays.editOverlay(tryAgainImageNeutral, properties); - Overlays.editOverlay(tryAgainImageHover, properties); - Overlays.editOverlay(tryAgainText, properties); location.goToLastAddress(); } else if (backImageHover === overlayID && location.canGoBack()) { - // hide back overlays. - var properties = { - visible: false - }; - Overlays.editOverlay(backImageNeutral, properties); - Overlays.editOverlay(backImageHover, properties); - Overlays.editOverlay(backText, properties); location.goBack(); } } From 5d011bafb26b3e034e0f4228b1231136c9187264 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 4 Oct 2018 17:02:44 -0700 Subject: [PATCH 72/81] small tweaks --- interface/src/Application.h | 2 +- interface/src/octree/SafeLanding.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.h b/interface/src/Application.h index 1ceae9cd02..750d9ce987 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -583,7 +583,7 @@ private: QElapsedTimer _lastTimeUpdated; QElapsedTimer _lastTimeRendered; - int _minimumGPUTextureMemSizeStabilityCount { 20 }; + int _minimumGPUTextureMemSizeStabilityCount { 30 }; ShapeManager _shapeManager; PhysicalEntitySimulationPointer _entitySimulation; diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index 3077762a08..d5eb4c23c2 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -147,6 +147,10 @@ bool SafeLanding::isSequenceNumbersComplete() { (startIter != _sequenceNumbers.end() && endIter != _sequenceNumbers.end() && distance(startIter, endIter) == sequenceSize - 1)) { + bool enableInterstitial = DependencyManager::get()->getDomainHandler().getInterstitialModeEnabled(); + if (!enableInterstitial) { + _trackingEntities = false; // Don't track anything else that comes in. + } return true; } } @@ -193,7 +197,7 @@ bool SafeLanding::isEntityLoadingComplete() { entityTree->addingEntity(entityMapIter->first); } qDebug() << EntityTypes::getEntityTypeName(entity->getType()) << entity->isVisuallyReady() << hasRenderable << entity->isParentPathComplete(); - isVisuallyReady = entity->isVisuallyReady() || (!entityRenderable && !entity->isParentPathComplete()); + isVisuallyReady = entity->isVisuallyReady() || (!entityRenderable && !entity->isParentPathComplete()); } if (isEntityPhysicsReady(entity) && isVisuallyReady) { From d2850801976a8a585a67c4dfab5b033ece31b869 Mon Sep 17 00:00:00 2001 From: danteruiz Date: Thu, 4 Oct 2018 18:38:25 -0700 Subject: [PATCH 73/81] remmoving some debug statements --- interface/src/Application.cpp | 2 -- interface/src/octree/SafeLanding.cpp | 7 +------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 4688160a34..1e158c30be 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -6607,10 +6607,8 @@ bool Application::gpuTextureMemSizeStable() { _gpuTextureMemSizeAtLastCheck = textureResourceGPUMemSize; if (_gpuTextureMemSizeStabilityCount >= _minimumGPUTextureMemSizeStabilityCount) { - qDebug() << "GPU checking"; return (textureResourceGPUMemSize == texturePopulatedGPUMemSize) && (textureTransferSize == 0); } - qDebug() << "GPU not ready"; return false; } diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index d5eb4c23c2..ed0ce3c278 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -107,7 +107,6 @@ void SafeLanding::noteReceivedsequenceNumber(int sequenceNumber) { } bool SafeLanding::isLoadSequenceComplete() { - qDebug() << "is sequence complete" << isSequenceNumbersComplete(); if (isEntityLoadingComplete() && isSequenceNumbersComplete()) { Locker lock(_lock); _initialStart = INVALID_SEQUENCE; @@ -196,7 +195,7 @@ bool SafeLanding::isEntityLoadingComplete() { hasRenderable = false; entityTree->addingEntity(entityMapIter->first); } - qDebug() << EntityTypes::getEntityTypeName(entity->getType()) << entity->isVisuallyReady() << hasRenderable << entity->isParentPathComplete(); + isVisuallyReady = entity->isVisuallyReady() || (!entityRenderable && !entity->isParentPathComplete()); } @@ -211,10 +210,6 @@ bool SafeLanding::isEntityLoadingComplete() { } } - if (!_trackedEntities.empty()) { - qDebug() << "\n"; - } - if (enableInterstitial) { _trackedEntityStabilityCount++; } From 8abbd51bb1734fea69ce6cfa9bbfa7da45435a62 Mon Sep 17 00:00:00 2001 From: Wayne Chen Date: Thu, 4 Oct 2018 23:11:27 -0700 Subject: [PATCH 74/81] removing unused variable --- interface/src/octree/SafeLanding.cpp | 2 -- scripts/system/redirectOverlays.js | 16 ++++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index ed0ce3c278..94dfe77ba7 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -189,10 +189,8 @@ bool SafeLanding::isEntityLoadingComplete() { bool isVisuallyReady = true; if (enableInterstitial) { - bool hasRenderable = true; auto entityRenderable = entityTree->renderableForEntityId(entityMapIter->first); if (!entityRenderable) { - hasRenderable = false; entityTree->addingEntity(entityMapIter->first); } diff --git a/scripts/system/redirectOverlays.js b/scripts/system/redirectOverlays.js index 8f42990b7d..b1180e0cd0 100644 --- a/scripts/system/redirectOverlays.js +++ b/scripts/system/redirectOverlays.js @@ -14,6 +14,7 @@ var hardRefusalErrors = [PROTOCOL_VERSION_MISMATCH, NOT_AUTHORIZED, TIMEOUT]; var timer = null; + var isErrorState = false; function getOopsText() { var error = Window.getLastDomainConnectionError(); @@ -131,6 +132,7 @@ }); function toggleOverlays(isInErrorState) { + isErrorState = isInErrorState; if (!isInErrorState) { var properties = { visible: false @@ -148,6 +150,8 @@ var oopsText = getOopsText(); // if oopsText === "", it was a success. var overlaysVisible = (oopsText !== ""); + // for catching init or if error state were to be different. + isErrorState = overlaysVisible; var properties = { visible: overlaysVisible }; @@ -218,6 +222,10 @@ Overlays.mouseReleaseOnOverlay.connect(clickedOnOverlay); Overlays.hoverEnterOverlay.connect(function(overlayID, event) { + if (!isErrorState) { + // don't allow hover overlay events to get caught if it's not in error state anymore. + return; + } if (overlayID === backImageNeutral && location.canGoBack()) { Overlays.editOverlay(backImageNeutral, {visible: false}); Overlays.editOverlay(backImageHover, {visible: true}); @@ -229,11 +237,15 @@ }); Overlays.hoverLeaveOverlay.connect(function(overlayID, event) { - if (overlayID === backImageHover && Overlays.getProperty(backImageHover, "visible")) { + if (!isErrorState) { + // don't allow hover overlay events to get caught if it's not in error state anymore. + return; + } + if (overlayID === backImageHover) { Overlays.editOverlay(backImageHover, {visible: false}); Overlays.editOverlay(backImageNeutral, {visible: true}); } - if (overlayID === tryAgainImageHover && Overlays.getProperty(tryAgainImageHover, "visible")) { + if (overlayID === tryAgainImageHover) { Overlays.editOverlay(tryAgainImageHover, {visible: false}); Overlays.editOverlay(tryAgainImageNeutral, {visible: true}); } From 88f76ac7601c3a5536e6638903ce0573af583435 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 4 Oct 2018 14:57:08 -0700 Subject: [PATCH 75/81] suppress traits larger than INT16_MAX bytes --- .../src/avatars/AvatarMixerClientData.cpp | 44 ++++++++++++++----- .../src/avatars/AvatarMixerSlave.cpp | 3 ++ libraries/avatars/src/AvatarData.cpp | 41 +++++++++++------ libraries/avatars/src/AvatarTraits.h | 1 + libraries/networking/src/NodeList.cpp | 1 - 5 files changed, 64 insertions(+), 26 deletions(-) diff --git a/assignment-client/src/avatars/AvatarMixerClientData.cpp b/assignment-client/src/avatars/AvatarMixerClientData.cpp index 187c9ed0f2..09bdfbc564 100644 --- a/assignment-client/src/avatars/AvatarMixerClientData.cpp +++ b/assignment-client/src/avatars/AvatarMixerClientData.cpp @@ -112,6 +112,11 @@ void AvatarMixerClientData::processSetTraitsMessage(ReceivedMessage& message, AvatarTraits::TraitWireSize traitSize; message.readPrimitive(&traitSize); + if (traitSize < -1 || traitSize > message.getBytesLeftToRead()) { + qWarning() << "Refusing to process simple trait of size" << traitSize << "from" << message.getSenderSockAddr(); + break; + } + if (packetTraitVersion > _lastReceivedTraitVersions[traitType]) { _avatar->processTrait(traitType, message.read(traitSize)); _lastReceivedTraitVersions[traitType] = packetTraitVersion; @@ -128,26 +133,41 @@ void AvatarMixerClientData::processSetTraitsMessage(ReceivedMessage& message, } else { AvatarTraits::TraitInstanceID instanceID = QUuid::fromRfc4122(message.readWithoutCopy(NUM_BYTES_RFC4122_UUID)); + if (message.getBytesLeftToRead() == 0) { + qWarning () << "Received an instanced trait with no size from" << message.getSenderSockAddr(); + break; + } + AvatarTraits::TraitWireSize traitSize; message.readPrimitive(&traitSize); - auto& instanceVersionRef = _lastReceivedTraitVersions.getInstanceValueRef(traitType, instanceID); + if (traitSize < -1 || traitSize > message.getBytesLeftToRead()) { + qWarning() << "Refusing to process instanced trait of size" << traitSize << "from" << message.getSenderSockAddr(); + break; + } - if (packetTraitVersion > instanceVersionRef) { - if (traitSize == AvatarTraits::DELETED_TRAIT_SIZE) { - _avatar->processDeletedTraitInstance(traitType, instanceID); + if (traitType == AvatarTraits::AvatarEntity) { + auto& instanceVersionRef = _lastReceivedTraitVersions.getInstanceValueRef(traitType, instanceID); - // to track a deleted instance but keep version information - // the avatar mixer uses the negative value of the sent version - instanceVersionRef = -packetTraitVersion; + if (packetTraitVersion > instanceVersionRef) { + if (traitSize == AvatarTraits::DELETED_TRAIT_SIZE) { + _avatar->processDeletedTraitInstance(traitType, instanceID); + + // to track a deleted instance but keep version information + // the avatar mixer uses the negative value of the sent version + instanceVersionRef = -packetTraitVersion; + } else { + _avatar->processTraitInstance(traitType, instanceID, message.read(traitSize)); + instanceVersionRef = packetTraitVersion; + } + + anyTraitsChanged = true; } else { - _avatar->processTraitInstance(traitType, instanceID, message.read(traitSize)); - instanceVersionRef = packetTraitVersion; + message.seek(message.getPosition() + traitSize); } - - anyTraitsChanged = true; } else { - message.seek(message.getPosition() + traitSize); + qWarning() << "Refusing to process traits packet with instanced trait of unprocessable type from" << message.getSenderSockAddr(); + break; } } } diff --git a/assignment-client/src/avatars/AvatarMixerSlave.cpp b/assignment-client/src/avatars/AvatarMixerSlave.cpp index 9c88580b99..b6ec006c39 100644 --- a/assignment-client/src/avatars/AvatarMixerSlave.cpp +++ b/assignment-client/src/avatars/AvatarMixerSlave.cpp @@ -152,6 +152,7 @@ qint64 AvatarMixerSlave::addChangedTraitsToBulkPacket(AvatarMixerClientData* lis }); if (!isDeleted && (sentInstanceIt == sentIDValuePairs.end() || receivedVersion > sentInstanceIt->value)) { + // this instance version exists and has never been sent or is newer so we need to send it bytesWritten += sendingAvatar->packTraitInstance(traitType, instanceID, traitsPacketList, receivedVersion); @@ -161,6 +162,7 @@ qint64 AvatarMixerSlave::addChangedTraitsToBulkPacket(AvatarMixerClientData* lis sentIDValuePairs.emplace_back(instanceID, receivedVersion); } } else if (isDeleted && sentInstanceIt != sentIDValuePairs.end() && absoluteReceivedVersion > sentInstanceIt->value) { + // this instance version was deleted and we haven't sent the delete to this client yet bytesWritten += AvatarTraits::packInstancedTraitDelete(traitType, instanceID, traitsPacketList, absoluteReceivedVersion); @@ -180,6 +182,7 @@ qint64 AvatarMixerSlave::addChangedTraitsToBulkPacket(AvatarMixerClientData* lis listeningNodeData->setLastOtherAvatarTraitsSendPoint(otherNodeLocalID, timeOfLastTraitsChange); } + return bytesWritten; } diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index 2168dff1f6..62eaee0f46 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -1802,15 +1802,24 @@ QUrl AvatarData::getWireSafeSkeletonModelURL() const { qint64 AvatarData::packTrait(AvatarTraits::TraitType traitType, ExtendedIODevice& destination, AvatarTraits::TraitVersion traitVersion) { - qint64 bytesWritten = 0; - bytesWritten += destination.writePrimitive(traitType); - if (traitVersion > AvatarTraits::DEFAULT_TRAIT_VERSION) { - bytesWritten += destination.writePrimitive(traitVersion); - } + qint64 bytesWritten = 0; if (traitType == AvatarTraits::SkeletonModelURL) { + QByteArray encodedSkeletonURL = getWireSafeSkeletonModelURL().toEncoded(); + + if (encodedSkeletonURL.size() > AvatarTraits::MAXIMUM_TRAIT_SIZE) { + qWarning() << "Refusing to pack simple trait" << traitType << "of size" << encodedSkeletonURL.size() + << "bytes since it exceeds the maximum size" << AvatarTraits::MAXIMUM_TRAIT_SIZE << "bytes"; + return 0; + } + + bytesWritten += destination.writePrimitive(traitType); + + if (traitVersion > AvatarTraits::DEFAULT_TRAIT_VERSION) { + bytesWritten += destination.writePrimitive(traitVersion); + } AvatarTraits::TraitWireSize encodedURLSize = encodedSkeletonURL.size(); bytesWritten += destination.writePrimitive(encodedURLSize); @@ -1825,14 +1834,6 @@ qint64 AvatarData::packTraitInstance(AvatarTraits::TraitType traitType, AvatarTr ExtendedIODevice& destination, AvatarTraits::TraitVersion traitVersion) { qint64 bytesWritten = 0; - bytesWritten += destination.writePrimitive(traitType); - - if (traitVersion > AvatarTraits::DEFAULT_TRAIT_VERSION) { - bytesWritten += destination.writePrimitive(traitVersion); - } - - bytesWritten += destination.write(traitInstanceID.toRfc4122()); - if (traitType == AvatarTraits::AvatarEntity) { // grab a read lock on the avatar entities and check for entity data for the given ID QByteArray entityBinaryData; @@ -1843,6 +1844,20 @@ qint64 AvatarData::packTraitInstance(AvatarTraits::TraitType traitType, AvatarTr } }); + if (entityBinaryData.size() > AvatarTraits::MAXIMUM_TRAIT_SIZE) { + qWarning() << "Refusing to pack instanced trait" << traitType << "of size" << entityBinaryData.size() + << "bytes since it exceeds the maximum size " << AvatarTraits::MAXIMUM_TRAIT_SIZE << "bytes"; + return 0; + } + + bytesWritten += destination.writePrimitive(traitType); + + if (traitVersion > AvatarTraits::DEFAULT_TRAIT_VERSION) { + bytesWritten += destination.writePrimitive(traitVersion); + } + + bytesWritten += destination.write(traitInstanceID.toRfc4122()); + if (!entityBinaryData.isNull()) { AvatarTraits::TraitWireSize entityBinarySize = entityBinaryData.size(); diff --git a/libraries/avatars/src/AvatarTraits.h b/libraries/avatars/src/AvatarTraits.h index f0c807a432..5e28515d12 100644 --- a/libraries/avatars/src/AvatarTraits.h +++ b/libraries/avatars/src/AvatarTraits.h @@ -39,6 +39,7 @@ namespace AvatarTraits { using TraitWireSize = int16_t; const TraitWireSize DELETED_TRAIT_SIZE = -1; + const TraitWireSize MAXIMUM_TRAIT_SIZE = INT16_MAX; inline qint64 packInstancedTraitDelete(TraitType traitType, TraitInstanceID instanceID, ExtendedIODevice& destination, TraitVersion traitVersion = NULL_TRAIT_VERSION) { diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index e458ffab7e..917a4ca791 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -332,7 +332,6 @@ void NodeList::sendDomainServerCheckIn() { qCDebug(networking) << "Local domain-server port read from shared memory (or default) is" << domainPort; _domainHandler.setPort(domainPort); } - } // check if we're missing a keypair we need to verify ourselves with the domain-server From c3478dc018a34e5e392d96b8819ce2955633348e Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 5 Oct 2018 13:48:35 -0700 Subject: [PATCH 76/81] remove expired avatarEntities from their avatars --- interface/src/Application.cpp | 4 ++++ interface/src/avatar/AvatarManager.cpp | 11 +++++++++++ interface/src/avatar/AvatarManager.h | 2 ++ interface/src/avatar/MyAvatar.cpp | 2 +- libraries/entities/src/EntitySimulation.h | 2 +- libraries/physics/src/PhysicalEntitySimulation.cpp | 8 ++++++++ libraries/physics/src/PhysicalEntitySimulation.h | 2 ++ 7 files changed, 29 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 4b45541e1a..c708676b17 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5921,6 +5921,10 @@ void Application::update(float deltaTime) { // update the rendering without any simulation getEntities()->update(false); } + // remove recently dead avatarEntities + SetOfEntities deadAvatarEntities; + _entitySimulation->takeDeadAvatarEntities(deadAvatarEntities); + avatarManager->removeDeadAvatarEntities(deadAvatarEntities); } // AvatarManager update diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index c268561a8d..d31b201dc7 100644 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -452,6 +452,17 @@ void AvatarManager::handleProcessedPhysicsTransaction(PhysicsEngine::Transaction transaction.clear(); } +void AvatarManager::removeDeadAvatarEntities(const SetOfEntities& deadEntities) { + for (auto entity : deadEntities) { + QUuid sessionID = entity->getOwningAvatarID(); + AvatarSharedPointer avatar = getAvatarBySessionID(sessionID); + if (avatar) { + const bool REQUIRES_REMOVAL_FROM_TREE = false; + avatar->clearAvatarEntity(entity->getID(), REQUIRES_REMOVAL_FROM_TREE); + } + } +} + void AvatarManager::handleRemovedAvatar(const AvatarSharedPointer& removedAvatar, KillAvatarReason removalReason) { auto avatar = std::static_pointer_cast(removedAvatar); { diff --git a/interface/src/avatar/AvatarManager.h b/interface/src/avatar/AvatarManager.h index 3ed156f673..209b976c44 100644 --- a/interface/src/avatar/AvatarManager.h +++ b/interface/src/avatar/AvatarManager.h @@ -26,6 +26,7 @@ #include #include #include +#include // for SetOfEntities #include "AvatarMotionState.h" #include "MyAvatar.h" @@ -187,6 +188,7 @@ public: void queuePhysicsChange(const OtherAvatarPointer& avatar); void buildPhysicsTransaction(PhysicsEngine::Transaction& transaction); void handleProcessedPhysicsTransaction(PhysicsEngine::Transaction& transaction); + void removeDeadAvatarEntities(const SetOfEntities& deadEntities); public slots: /**jsdoc diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 086cbb3425..b347963cf1 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -137,7 +137,7 @@ MyAvatar::MyAvatar(QThread* thread) : _useSnapTurnSetting(QStringList() << AVATAR_SETTINGS_GROUP_NAME << "useSnapTurn", _useSnapTurn), _userHeightSetting(QStringList() << AVATAR_SETTINGS_GROUP_NAME << "userHeight", DEFAULT_AVATAR_HEIGHT), _flyingHMDSetting(QStringList() << AVATAR_SETTINGS_GROUP_NAME << "flyingHMD", _flyingPrefHMD), - _avatarEntityCountSetting(QStringList() << AVATAR_SETTINGS_GROUP_NAME << "avatarEntityData" << "size", _flyingPrefHMD) + _avatarEntityCountSetting(QStringList() << AVATAR_SETTINGS_GROUP_NAME << "avatarEntityData" << "size", 0) { _clientTraitsHandler = std::unique_ptr(new ClientTraitsHandler(this)); diff --git a/libraries/entities/src/EntitySimulation.h b/libraries/entities/src/EntitySimulation.h index b19e1c33d3..f107bcae6e 100644 --- a/libraries/entities/src/EntitySimulation.h +++ b/libraries/entities/src/EntitySimulation.h @@ -104,7 +104,7 @@ protected: QMutex _dynamicsMutex { QMutex::Recursive }; protected: - SetOfEntities _deadEntities; + SetOfEntities _deadEntities; // dead entities that might still be in the _entityTree private: void moveSimpleKinematics(); diff --git a/libraries/physics/src/PhysicalEntitySimulation.cpp b/libraries/physics/src/PhysicalEntitySimulation.cpp index 2004f8953d..ab8bfb8290 100644 --- a/libraries/physics/src/PhysicalEntitySimulation.cpp +++ b/libraries/physics/src/PhysicalEntitySimulation.cpp @@ -79,6 +79,9 @@ void PhysicalEntitySimulation::removeEntityInternal(EntityItemPointer entity) { _deadEntities.insert(entity); } } + if (entity->getClientOnly()) { + _deadAvatarEntities.insert(entity); + } } void PhysicalEntitySimulation::removeOwnershipData(EntityMotionState* motionState) { @@ -123,6 +126,11 @@ void PhysicalEntitySimulation::takeDeadEntities(SetOfEntities& deadEntities) { _deadEntities.clear(); } +void PhysicalEntitySimulation::takeDeadAvatarEntities(SetOfEntities& deadEntities) { + _deadAvatarEntities.swap(deadEntities); + _deadAvatarEntities.clear(); +} + void PhysicalEntitySimulation::changeEntityInternal(EntityItemPointer entity) { // queue incoming changes: from external sources (script, EntityServer, etc) to physics engine QMutexLocker lock(&_mutex); diff --git a/libraries/physics/src/PhysicalEntitySimulation.h b/libraries/physics/src/PhysicalEntitySimulation.h index fdf996df25..843069e247 100644 --- a/libraries/physics/src/PhysicalEntitySimulation.h +++ b/libraries/physics/src/PhysicalEntitySimulation.h @@ -60,6 +60,7 @@ public: virtual void applyDynamicChanges() override; virtual void takeDeadEntities(SetOfEntities& deadEntities) override; + void takeDeadAvatarEntities(SetOfEntities& deadEntities); signals: void entityCollisionWithEntity(const EntityItemID& idA, const EntityItemID& idB, const Collision& collision); @@ -112,6 +113,7 @@ private: VectorOfEntityMotionStates _owned; VectorOfEntityMotionStates _bids; + SetOfEntities _deadAvatarEntities; workload::SpacePointer _space; uint64_t _nextBidExpiry; uint32_t _lastStepSendPackets { 0 }; From 82170a66edb67c552eb42d0bdeae8448cf78783f Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 5 Oct 2018 14:43:57 -0700 Subject: [PATCH 77/81] avoid backwards seek for skipped trait deletes --- libraries/avatars/src/AvatarHashMap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/avatars/src/AvatarHashMap.cpp b/libraries/avatars/src/AvatarHashMap.cpp index c8ea68dae4..2f3b12e0ed 100644 --- a/libraries/avatars/src/AvatarHashMap.cpp +++ b/libraries/avatars/src/AvatarHashMap.cpp @@ -337,7 +337,7 @@ void AvatarHashMap::processBulkAvatarTraits(QSharedPointer mess // grab the last trait versions for this avatar auto& lastProcessedVersions = _processedTraitVersions[avatarID]; - while (traitType != AvatarTraits::NullTrait) { + while (traitType != AvatarTraits::NullTrait && message->getBytesLeftToRead() > 0) { AvatarTraits::TraitVersion packetTraitVersion; message->readPrimitive(&packetTraitVersion); @@ -378,7 +378,7 @@ void AvatarHashMap::processBulkAvatarTraits(QSharedPointer mess } } - if (skipBinaryTrait) { + if (skipBinaryTrait && traitBinarySize > 0) { // we didn't read this trait because it was older or because we didn't have an avatar to process it for message->seek(message->getPosition() + traitBinarySize); } From 36c2cceb577a6daeb16024ad967d5e4710484e0f Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 5 Oct 2018 15:39:51 -0700 Subject: [PATCH 78/81] fix for failing to enter domain --- interface/src/Application.cpp | 5 ++++- interface/src/Application.h | 4 ++++ interface/src/octree/SafeLanding.cpp | 4 +++- interface/src/scripting/WindowScriptingInterface.cpp | 4 ---- interface/src/scripting/WindowScriptingInterface.h | 2 -- scripts/system/interstitialPage.js | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 1e158c30be..57ed19c021 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -5617,7 +5617,8 @@ void Application::update(float deltaTime) { // for nearby entities before starting bullet up. quint64 now = usecTimestampNow(); if (isServerlessMode() || _octreeProcessor.isLoadSequenceComplete()) { - if (gpuTextureMemSizeStable()) { + bool enableInterstitial = DependencyManager::get()->getDomainHandler().getInterstitialModeEnabled(); + if (gpuTextureMemSizeStable() || !enableInterstitial) { // we've received a new full-scene octree stats packet, or it's been long enough to try again anyway _lastPhysicsCheckTime = now; _fullSceneCounterAtLastPhysicsCheck = _fullSceneReceivedCounter; @@ -6241,6 +6242,8 @@ int Application::sendNackPackets() { missingSequenceNumbers = sequenceNumberStats.getMissingSet(); }); + _isMissingSequenceNumbers = (missingSequenceNumbers.size() != 0); + // construct nack packet(s) for this node foreach(const OCTREE_PACKET_SEQUENCE& missingNumber, missingSequenceNumbers) { nackPacketList->writePrimitive(missingNumber); diff --git a/interface/src/Application.h b/interface/src/Application.h index 750d9ce987..75260b910f 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -183,6 +183,8 @@ public: // passes, mirror window passes, etc void copyDisplayViewFrustum(ViewFrustum& viewOut) const; + bool isMissingSequenceNumbers() { return _isMissingSequenceNumbers; } + const ConicalViewFrustums& getConicalViews() const override { return _conicalViews; } const OctreePacketProcessor& getOctreePacketProcessor() const { return _octreeProcessor; } @@ -713,6 +715,8 @@ private: bool _fakedMouseEvent { false }; + bool _isMissingSequenceNumbers { false }; + void checkChangeCursor(); mutable QMutex _changeCursorLock { QMutex::Recursive }; Qt::CursorShape _desiredCursor{ Qt::BlankCursor }; diff --git a/interface/src/octree/SafeLanding.cpp b/interface/src/octree/SafeLanding.cpp index ed0ce3c278..02a8441fab 100644 --- a/interface/src/octree/SafeLanding.cpp +++ b/interface/src/octree/SafeLanding.cpp @@ -142,10 +142,12 @@ bool SafeLanding::isSequenceNumbersComplete() { _initialEnd + SEQUENCE_MODULO - _initialStart; auto startIter = _sequenceNumbers.find(_initialStart); auto endIter = _sequenceNumbers.find(_initialEnd - 1); + + bool missingSequenceNumbers = qApp->isMissingSequenceNumbers(); if (sequenceSize == 0 || (startIter != _sequenceNumbers.end() && endIter != _sequenceNumbers.end() - && distance(startIter, endIter) == sequenceSize - 1)) { + && ((distance(startIter, endIter) == sequenceSize - 1) || !missingSequenceNumbers))) { bool enableInterstitial = DependencyManager::get()->getDomainHandler().getInterstitialModeEnabled(); if (!enableInterstitial) { _trackingEntities = false; // Don't track anything else that comes in. diff --git a/interface/src/scripting/WindowScriptingInterface.cpp b/interface/src/scripting/WindowScriptingInterface.cpp index c09bff7b5e..75f17def20 100644 --- a/interface/src/scripting/WindowScriptingInterface.cpp +++ b/interface/src/scripting/WindowScriptingInterface.cpp @@ -399,10 +399,6 @@ void WindowScriptingInterface::showAssetServer(const QString& upload) { QMetaObject::invokeMethod(qApp, "showAssetServerWidget", Qt::QueuedConnection, Q_ARG(QString, upload)); } -void WindowScriptingInterface::setMinimumGPUTextureMemSizeStabilityCount(int stabilityCount) { - QMetaObject::invokeMethod(qApp, " setMinimumGPUTextureMemStabilityCount", Qt::QueuedConnection, Q_ARG(int, stabilityCount)); -} - QString WindowScriptingInterface::checkVersion() { return QCoreApplication::applicationVersion(); } diff --git a/interface/src/scripting/WindowScriptingInterface.h b/interface/src/scripting/WindowScriptingInterface.h index fe0113b770..f6a5a5ef74 100644 --- a/interface/src/scripting/WindowScriptingInterface.h +++ b/interface/src/scripting/WindowScriptingInterface.h @@ -571,8 +571,6 @@ public slots: float domainLoadingProgress(); - void setMinimumGPUTextureMemSizeStabilityCount(int stabilityCount); - private slots: void onWindowGeometryChanged(const QRect& geometry); void onMessageBoxSelected(int button); diff --git a/scripts/system/interstitialPage.js b/scripts/system/interstitialPage.js index 1c2f83bb04..19e603b4ab 100644 --- a/scripts/system/interstitialPage.js +++ b/scripts/system/interstitialPage.js @@ -50,7 +50,7 @@ "Tip: Use the Create app to import models and create custom entities.", "Tip: We're open source! Feel free to contribute to our code on GitHub!", "Tip: What emotes have you used in the Emote app?", - "Tip: Take and share your snapshots with the everyone using the Snap app.", + "Tip: Take and share your snapshots with everyone using the Snap app.", "Tip: Did you know you can show websites in-world by creating a web entity?", "Tip: Find out more information about domains by visiting our website!", "Tip: Did you know you can get cool new apps from the Marketplace?", From 335c60e6b8afd91e7cda6eb1ccca34668286a545 Mon Sep 17 00:00:00 2001 From: Anthony Thibault Date: Fri, 5 Oct 2018 17:29:25 -0700 Subject: [PATCH 79/81] Reduce the glitches of far away animating avatars Currently, the avatars that are further then 10 meters away have a very aggressive 15 degree rotation threshold, used to reduce the amount of rotation joint changes sent over the network. This PR tunes both the distances and rotation thresholds used for this LOD culling. --- libraries/avatars/src/AvatarData.cpp | 8 +++++--- libraries/avatars/src/AvatarData.h | 21 ++++++++++++--------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index 5fb4ef3156..5930b79074 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -206,11 +206,13 @@ float AvatarData::getDistanceBasedMinRotationDOT(glm::vec3 viewerPosition) const if (distance < AVATAR_DISTANCE_LEVEL_1) { result = AVATAR_MIN_ROTATION_DOT; } else if (distance < AVATAR_DISTANCE_LEVEL_2) { - result = ROTATION_CHANGE_15D; + result = ROTATION_CHANGE_2D; } else if (distance < AVATAR_DISTANCE_LEVEL_3) { - result = ROTATION_CHANGE_45D; + result = ROTATION_CHANGE_4D; } else if (distance < AVATAR_DISTANCE_LEVEL_4) { - result = ROTATION_CHANGE_90D; + result = ROTATION_CHANGE_6D; + } else if (distance < AVATAR_DISTANCE_LEVEL_5) { + result = ROTATION_CHANGE_15D; } return result; } diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index 860772b7c9..46489451f7 100644 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -309,16 +309,19 @@ const float AVATAR_SEND_FULL_UPDATE_RATIO = 0.02f; const float AVATAR_MIN_ROTATION_DOT = 0.9999999f; const float AVATAR_MIN_TRANSLATION = 0.0001f; -const float ROTATION_CHANGE_15D = 0.9914449f; -const float ROTATION_CHANGE_45D = 0.9238795f; -const float ROTATION_CHANGE_90D = 0.7071068f; -const float ROTATION_CHANGE_179D = 0.0087266f; - -const float AVATAR_DISTANCE_LEVEL_1 = 10.0f; -const float AVATAR_DISTANCE_LEVEL_2 = 100.0f; -const float AVATAR_DISTANCE_LEVEL_3 = 1000.0f; -const float AVATAR_DISTANCE_LEVEL_4 = 10000.0f; +// quaternion dot products +const float ROTATION_CHANGE_2D = 0.99984770f; // 2 degrees +const float ROTATION_CHANGE_4D = 0.99939083f; // 4 degrees +const float ROTATION_CHANGE_6D = 0.99862953f; // 6 degrees +const float ROTATION_CHANGE_15D = 0.99144486f; // 15 degrees +const float ROTATION_CHANGE_179D = 0.00872653f; // 179 degrees +// rotation culling distance thresholds +const float AVATAR_DISTANCE_LEVEL_1 = 12.5f; // meters +const float AVATAR_DISTANCE_LEVEL_2 = 16.6f; // meters +const float AVATAR_DISTANCE_LEVEL_3 = 25.0f; // meters +const float AVATAR_DISTANCE_LEVEL_4 = 50.0f; // meters +const float AVATAR_DISTANCE_LEVEL_5 = 200.0f; // meters // Where one's own Avatar begins in the world (will be overwritten if avatar data file is found). // This is the start location in the Sandbox (xyz: 6270, 211, 6000). From 1719f4a4748b7ace4fd07a214c61558ccedce794 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Fri, 5 Oct 2018 23:49:06 -0300 Subject: [PATCH 80/81] Build libplugins_libhifiCodec.so --- android/app/CMakeLists.txt | 2 ++ android/app/build.gradle | 2 ++ android/build.gradle | 28 +++++++++++++++++++------ cmake/macros/TargetHifiAudioCodec.cmake | 22 +++++++++++++++++++ plugins/hifiCodec/CMakeLists.txt | 5 +---- 5 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 cmake/macros/TargetHifiAudioCodec.cmake diff --git a/android/app/CMakeLists.txt b/android/app/CMakeLists.txt index d24a84c6a5..9930a9e152 100644 --- a/android/app/CMakeLists.txt +++ b/android/app/CMakeLists.txt @@ -7,6 +7,8 @@ target_bullet() set(INTERFACE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../interface") add_subdirectory("${INTERFACE_DIR}" "libraries/interface") include_directories("${INTERFACE_DIR}/src") +set(HIFI_CODEC_PLUGIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../plugins/hifiCodec") +add_subdirectory("${HIFI_CODEC_PLUGIN_DIR}" "libraries/hifiCodecPlugin") target_link_libraries(native-lib android log m interface) diff --git a/android/app/build.gradle b/android/app/build.gradle index 24c067b176..13d3a0fc41 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -80,8 +80,10 @@ android { if (Os.isFamily(Os.FAMILY_UNIX)) { def uploadDumpSymsTask = rootProject.getTasksByName("uploadBreakpadDumpSyms${variant.name.capitalize()}", false).first() def runDumpSymsTask = rootProject.getTasksByName("runBreakpadDumpSyms${variant.name.capitalize()}", false).first() + def renameHifiACTask = rootProject.getTasksByName("renameHifiACTask${variant.name.capitalize()}", false).first() runDumpSymsTask.dependsOn(task) variant.assemble.dependsOn(uploadDumpSymsTask) + variant.assemble.dependsOn(renameHifiACTask) } } diff --git a/android/build.gradle b/android/build.gradle index aa7aa399b2..72015aab2e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -143,11 +143,9 @@ def packages = [ includeLibs: ['libtbb.so', 'libtbbmalloc.so'], ], hifiAC: [ - file: 'libplugins_libhifiCodec.zip', - versionId: 'i31pW.qNbvFOXRxbyiJUxg3sphaFNmZU', - checksum: '9412a8e12c88a4096c1fc843bb9fe52d', - sharedLibFolder: '', - includeLibs: ['libplugins_libhifiCodec.so'] + baseUrl: 'http://s3.amazonaws.com/hifi-public/dependencies/', + file: 'codecSDK-android_armv8-2.0.zip', + checksum: '1cbef929675818fc64c4101b72f84a6a' ], etc2comp: [ file: 'etc2comp-patched-armv8-libcpp.tgz', @@ -367,7 +365,8 @@ task downloadDependencies { doLast { packages.each { entry -> def filename = entry.value['file']; - def url = baseUrl + filename; + def dependencyBaseUrl = entry.value['baseUrl'] + def url = (dependencyBaseUrl?.trim() ? dependencyBaseUrl : baseUrl) + filename; if (entry.value.containsKey('versionId')) { url = url + '?versionId=' + entry.value['versionId'] } @@ -668,6 +667,23 @@ task uploadBreakpadDumpSymsRelease(type:io.github.httpbuilderng.http.HttpTask, d } } +task renameHifiACTaskDebug() { + doLast { + def sourceFile = new File("${appDir}/build/intermediates/cmake/debug/obj/arm64-v8a/","libhifiCodec.so") + def destinationFile = new File("${appDir}/src/main/jniLibs/", "libplugins_libhifiCodec.so)") + copy { from sourceFile; into destinationFile.parent; rename(sourceFile.name, destinationFile.name) } + } +} +task renameHifiACTaskRelease(type: Copy) { + doLast { + doLast { + def sourceFile = new File("${appDir}/build/intermediates/cmake/release/obj/arm64-v8a/","libhifiCodec.so") + def destinationFile = new File("${appDir}/src/main/jniLibs/arm64-v8a", "libplugins_libhifiCodec.so") + copy { from sourceFile; into destinationFile.parent; rename(sourceFile.name, destinationFile.name) } + } + } +} + // FIXME this code is prototyping the desired functionality for doing build time binary dependency resolution. // See the comment on the qtBundle task above /* diff --git a/cmake/macros/TargetHifiAudioCodec.cmake b/cmake/macros/TargetHifiAudioCodec.cmake new file mode 100644 index 0000000000..98c24e684c --- /dev/null +++ b/cmake/macros/TargetHifiAudioCodec.cmake @@ -0,0 +1,22 @@ +# +# Copyright 2018 High Fidelity, Inc. +# Created by Gabriel Calero and Cristian Duarte on 2018/10/05 +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# +macro(TARGET_HIFIAUDIOCODEC) + if (ANDROID) + set(HIFIAC_INSTALL_DIR ${HIFI_ANDROID_PRECOMPILED}/hifiAC/codecSDK) + set(HIFIAC_LIB_DIR "${HIFIAC_INSTALL_DIR}/Release") + set(HIFIAC_INCLUDE_DIRS "${HIFIAC_INSTALL_DIR}/include" CACHE TYPE INTERNAL) + list(APPEND HIFIAC_LIBS "${HIFIAC_LIB_DIR}/libaudio.a") + set(HIFIAC_LIBRARIES ${HIFIAC_LIBS} CACHE TYPE INTERNAL) + else() + add_dependency_external_projects(hifiAudioCodec) + target_include_directories(${TARGET_NAME} PRIVATE ${HIFIAUDIOCODEC_INCLUDE_DIRS}) + target_link_libraries(${TARGET_NAME} ${HIFIAUDIOCODEC_LIBRARIES}) + endif() + target_include_directories(${TARGET_NAME} PRIVATE ${HIFIAC_INCLUDE_DIRS}) + target_link_libraries(${TARGET_NAME} ${HIFIAC_LIBRARIES}) +endmacro() diff --git a/plugins/hifiCodec/CMakeLists.txt b/plugins/hifiCodec/CMakeLists.txt index 9ecaf7b511..0d4f093fc2 100644 --- a/plugins/hifiCodec/CMakeLists.txt +++ b/plugins/hifiCodec/CMakeLists.txt @@ -9,10 +9,7 @@ set(TARGET_NAME hifiCodec) setup_hifi_client_server_plugin() link_hifi_libraries(audio plugins) -add_dependency_external_projects(hifiAudioCodec) -target_include_directories(${TARGET_NAME} PRIVATE ${HIFIAUDIOCODEC_INCLUDE_DIRS}) -target_link_libraries(${TARGET_NAME} ${HIFIAUDIOCODEC_LIBRARIES}) - +target_hifiAudioCodec() if (BUILD_SERVER) install_beside_console() endif () From 42285245d5eda94c12fa52c3d943739f1efe5bc1 Mon Sep 17 00:00:00 2001 From: Gabriel Calero Date: Sat, 6 Oct 2018 00:43:19 -0300 Subject: [PATCH 81/81] Fix gradle script --- android/app/build.gradle | 2 +- android/build.gradle | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 13d3a0fc41..76f5acfaea 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -83,7 +83,7 @@ android { def renameHifiACTask = rootProject.getTasksByName("renameHifiACTask${variant.name.capitalize()}", false).first() runDumpSymsTask.dependsOn(task) variant.assemble.dependsOn(uploadDumpSymsTask) - variant.assemble.dependsOn(renameHifiACTask) + variant.mergeResources.dependsOn(renameHifiACTask) } } diff --git a/android/build.gradle b/android/build.gradle index 72015aab2e..14f9e4803f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -670,17 +670,15 @@ task uploadBreakpadDumpSymsRelease(type:io.github.httpbuilderng.http.HttpTask, d task renameHifiACTaskDebug() { doLast { def sourceFile = new File("${appDir}/build/intermediates/cmake/debug/obj/arm64-v8a/","libhifiCodec.so") - def destinationFile = new File("${appDir}/src/main/jniLibs/", "libplugins_libhifiCodec.so)") + def destinationFile = new File("${appDir}/src/main/jniLibs/arm64-v8a", "libplugins_libhifiCodec.so") copy { from sourceFile; into destinationFile.parent; rename(sourceFile.name, destinationFile.name) } } } task renameHifiACTaskRelease(type: Copy) { doLast { - doLast { - def sourceFile = new File("${appDir}/build/intermediates/cmake/release/obj/arm64-v8a/","libhifiCodec.so") - def destinationFile = new File("${appDir}/src/main/jniLibs/arm64-v8a", "libplugins_libhifiCodec.so") - copy { from sourceFile; into destinationFile.parent; rename(sourceFile.name, destinationFile.name) } - } + def sourceFile = new File("${appDir}/build/intermediates/cmake/release/obj/arm64-v8a/","libhifiCodec.so") + def destinationFile = new File("${appDir}/src/main/jniLibs/arm64-v8a", "libplugins_libhifiCodec.so") + copy { from sourceFile; into destinationFile.parent; rename(sourceFile.name, destinationFile.name) } } }