wait for SafeLanding to start before starting octreeQuery

This commit is contained in:
Andrew Meadows 2019-07-17 11:20:38 -07:00
parent 05d896f3de
commit b0f297e696
2 changed files with 18 additions and 14 deletions

View file

@ -5986,6 +5986,7 @@ void Application::resetPhysicsReadyInformation() {
_gpuTextureMemSizeStabilityCount = 0; _gpuTextureMemSizeStabilityCount = 0;
_gpuTextureMemSizeAtLastCheck = 0; _gpuTextureMemSizeAtLastCheck = 0;
_physicsEnabled = false; _physicsEnabled = false;
_octreeProcessor.stopSafeLanding();
} }
void Application::reloadResourceCaches() { void Application::reloadResourceCaches() {
@ -6981,13 +6982,16 @@ int Application::sendNackPackets() {
} }
void Application::queryOctree(NodeType_t serverType, PacketType packetType) { void Application::queryOctree(NodeType_t serverType, PacketType packetType) {
if (!_settingsLoaded) { if (!_settingsLoaded) {
return; // bail early if settings are not loaded return; // bail early if settings are not loaded
} }
const bool isModifiedQuery = !_physicsEnabled; const bool isModifiedQuery = !_physicsEnabled;
if (isModifiedQuery) { if (isModifiedQuery) {
if (!_octreeProcessor.safeLandingIsActive()) {
// don't send the octreeQuery until SafeLanding knows it has started
return;
}
// Create modified view that is a simple sphere. // Create modified view that is a simple sphere.
bool interstitialModeEnabled = DependencyManager::get<NodeList>()->getDomainHandler().getInterstitialModeEnabled(); bool interstitialModeEnabled = DependencyManager::get<NodeList>()->getDomainHandler().getInterstitialModeEnabled();
@ -7210,7 +7214,6 @@ void Application::clearDomainOctreeDetails(bool clearAll) {
void Application::domainURLChanged(QUrl domainURL) { void Application::domainURLChanged(QUrl domainURL) {
// disable physics until we have enough information about our new location to not cause craziness. // disable physics until we have enough information about our new location to not cause craziness.
resetPhysicsReadyInformation();
setIsServerlessMode(domainURL.scheme() != URL_SCHEME_HIFI); setIsServerlessMode(domainURL.scheme() != URL_SCHEME_HIFI);
if (isServerlessMode()) { if (isServerlessMode()) {
loadServerlessDomain(domainURL); loadServerlessDomain(domainURL);
@ -7220,7 +7223,6 @@ void Application::domainURLChanged(QUrl domainURL) {
void Application::goToErrorDomainURL(QUrl errorDomainURL) { void Application::goToErrorDomainURL(QUrl errorDomainURL) {
// disable physics until we have enough information about our new location to not cause craziness. // disable physics until we have enough information about our new location to not cause craziness.
resetPhysicsReadyInformation();
setIsServerlessMode(errorDomainURL.scheme() != URL_SCHEME_HIFI); setIsServerlessMode(errorDomainURL.scheme() != URL_SCHEME_HIFI);
if (isServerlessMode()) { if (isServerlessMode()) {
loadErrorDomain(errorDomainURL); loadErrorDomain(errorDomainURL);
@ -7237,12 +7239,12 @@ void Application::resettingDomain() {
void Application::nodeAdded(SharedNodePointer node) { void Application::nodeAdded(SharedNodePointer node) {
if (node->getType() == NodeType::EntityServer) { if (node->getType() == NodeType::EntityServer) {
if (_failedToConnectToEntityServer && !_entityServerConnectionTimer.isActive()) { if (_failedToConnectToEntityServer && !_entityServerConnectionTimer.isActive()) {
_failedToConnectToEntityServer = false;
_octreeProcessor.stopSafeLanding(); _octreeProcessor.stopSafeLanding();
_octreeProcessor.startSafeLanding(); _failedToConnectToEntityServer = false;
} else if (_entityServerConnectionTimer.isActive()) { } else if (_entityServerConnectionTimer.isActive()) {
_entityServerConnectionTimer.stop(); _entityServerConnectionTimer.stop();
} }
_octreeProcessor.startSafeLanding();
_entityServerConnectionTimer.setInterval(ENTITY_SERVER_CONNECTION_TIMEOUT); _entityServerConnectionTimer.setInterval(ENTITY_SERVER_CONNECTION_TIMEOUT);
_entityServerConnectionTimer.start(); _entityServerConnectionTimer.start();
} }

View file

@ -159,16 +159,18 @@ void SafeLanding::updateTracking() {
void SafeLanding::stopTracking() { void SafeLanding::stopTracking() {
Locker lock(_lock); Locker lock(_lock);
_trackingEntities = false; if (_trackingEntities) {
if (_entityTreeRenderer) { _trackingEntities = false;
auto entityTree = _entityTreeRenderer->getTree(); if (_entityTreeRenderer) {
disconnect(std::const_pointer_cast<EntityTree>(entityTree).get(), auto entityTree = _entityTreeRenderer->getTree();
&EntityTree::addingEntity, this, &SafeLanding::addTrackedEntity); disconnect(std::const_pointer_cast<EntityTree>(entityTree).get(),
disconnect(std::const_pointer_cast<EntityTree>(entityTree).get(), &EntityTree::addingEntity, this, &SafeLanding::addTrackedEntity);
&EntityTree::deletingEntity, this, &SafeLanding::deleteTrackedEntity); disconnect(std::const_pointer_cast<EntityTree>(entityTree).get(),
_entityTreeRenderer.reset(); &EntityTree::deletingEntity, this, &SafeLanding::deleteTrackedEntity);
_entityTreeRenderer.reset();
}
EntityTreeRenderer::setEntityLoadingPriorityFunction(_prevEntityLoadingPriorityOperator);
} }
EntityTreeRenderer::setEntityLoadingPriorityFunction(_prevEntityLoadingPriorityOperator);
} }
void SafeLanding::reset() { void SafeLanding::reset() {