From a089c43fdcce07a9ab808d7a87aaeef3ff63e239 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 11 Feb 2016 14:07:05 -0800 Subject: [PATCH 1/4] don't send ice heartbeat with no ice-server socket --- domain-server/src/DomainServer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index d1cb9d4e4a..9e3b69854f 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1073,7 +1073,9 @@ void DomainServer::sendHeartbeatToDataServer(const QString& networkAddress) { // TODO: have data-web respond with ice-server hostname to use void DomainServer::sendHeartbeatToIceServer() { - DependencyManager::get()->sendHeartbeatToIceServer(_iceServerSocket); + if (!_iceServerSocket.getAddress().isNull()) { + DependencyManager::get()->sendHeartbeatToIceServer(_iceServerSocket); + } } void DomainServer::processNodeJSONStatsPacket(QSharedPointer packetList, SharedNodePointer sendingNode) { From a6ba8dd8e54f4d9262254ef43ba5d5808bbfe08e Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 11 Feb 2016 14:14:16 -0800 Subject: [PATCH 2/4] fix null STUN server socket check in LNL --- libraries/networking/src/LimitedNodeList.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/networking/src/LimitedNodeList.cpp b/libraries/networking/src/LimitedNodeList.cpp index 67237ee269..a3707d19ba 100644 --- a/libraries/networking/src/LimitedNodeList.cpp +++ b/libraries/networking/src/LimitedNodeList.cpp @@ -671,7 +671,7 @@ const int NUM_BYTES_STUN_HEADER = 20; void LimitedNodeList::sendSTUNRequest() { - if (!_stunSockAddr.isNull()) { + if (!_stunSockAddr.getAddress().isNull()) { const int NUM_INITIAL_STUN_REQUESTS_BEFORE_FAIL = 10; if (!_hasCompletedInitialSTUN) { @@ -840,7 +840,7 @@ void LimitedNodeList::startSTUNPublicSocketUpdate() { } void LimitedNodeList::possiblyTimeoutSTUNAddressLookup() { - if (_stunSockAddr.isNull()) { + if (_stunSockAddr.getAddress().isNull()) { // our stun address is still NULL, but we've been waiting for long enough - time to force a fail stopInitialSTUNUpdate(false); } From ca5525cc3f6dd40866555cd25b1f928c1362b947 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Fri, 12 Feb 2016 06:58:14 -0800 Subject: [PATCH 3/4] if an entity already was near-picked, don't do a distance-to-center check on it. --- examples/controllers/handControllerGrab.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/controllers/handControllerGrab.js b/examples/controllers/handControllerGrab.js index e2f88ccb3b..908337f643 100644 --- a/examples/controllers/handControllerGrab.js +++ b/examples/controllers/handControllerGrab.js @@ -855,6 +855,7 @@ function MyController(hand) { getEntityCustomData(GRABBABLE_DATA_KEY, candidateEntities[i], DEFAULT_GRABBABLE_DATA); var grabDataForCandidate = getEntityCustomData(GRAB_USER_DATA_KEY, candidateEntities[i], {}); var propsForCandidate = Entities.getEntityProperties(candidateEntities[i], GRABBABLE_PROPERTIES); + var near = (nearPickedCandidateEntities.indexOf(candidateEntities[i]) >= 0); var isPhysical = this.propsArePhysical(propsForCandidate); var grabbable; @@ -916,7 +917,7 @@ function MyController(hand) { continue; } - if (this.state == STATE_SEARCHING && !isPhysical && distance > NEAR_PICK_MAX_DISTANCE) { + if (this.state == STATE_SEARCHING && !isPhysical && distance > NEAR_PICK_MAX_DISTANCE && !near) { // we can't distance-grab non-physical if (WANT_DEBUG_SEARCH_NAME && propsForCandidate.name == WANT_DEBUG_SEARCH_NAME) { print("grab is skipping '" + WANT_DEBUG_SEARCH_NAME + "': not physical and too far for near-grab"); From 94bc1764a8d0e79d9091d9d01c5d0569eb524eda Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Fri, 12 Feb 2016 06:58:44 -0800 Subject: [PATCH 4/4] fix auto-updating of adjustments to worn or equipped entities --- examples/attachedEntitiesManager.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/attachedEntitiesManager.js b/examples/attachedEntitiesManager.js index 7172b456be..4dda76f4df 100644 --- a/examples/attachedEntitiesManager.js +++ b/examples/attachedEntitiesManager.js @@ -144,9 +144,9 @@ function AttachedEntitiesManager() { this.handleEntityRelease = function(grabbedEntity, releasedFromJoint) { // if this is still equipped, just rewrite the position information. - var grabData = getEntityCustomData('grabKey', entityID, {}); + var grabData = getEntityCustomData('grabKey', grabbedEntity, {}); if ("refCount" in grabData && grabData.refCount > 0) { - manager.updateRelativeOffsets(parsedMessage.grabbedEntity); + manager.updateRelativeOffsets(grabbedEntity); return; } @@ -185,8 +185,8 @@ function AttachedEntitiesManager() { parentJointIndex: bestJointIndex }; - if (bestJointOffset && bestJointOffset.constructor === Array && bestJointOffset.length > 1) { - if (this.avatarIsInDressingRoom()) { + if (bestJointOffset && bestJointOffset.constructor === Array) { + if (this.avatarIsInDressingRoom() || bestJointOffset.length < 2) { this.updateRelativeOffsets(grabbedEntity); } else { // don't snap the entity to the preferred position if the avatar is in the dressing room.