History

clear domain octree details if ES killed

Stephen Birarda committed 9 years ago

Commit 038ac741 parent a21a34a2 files · +9 −30Browse files

Showing the changes to interface/src/Application.cpp (1 of 2 files). Show all

Unified · Split

interface/src/Application.cpp+8−30
@@ -797,7 +797,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 796 unmodified lines
797797 connect(&domainHandler, SIGNAL(resetting()), SLOT(resettingDomain()));
798798 connect(&domainHandler, SIGNAL(connectedToDomain(const QString&)), SLOT(updateWindowTitle()));
799799 connect(&domainHandler, SIGNAL(disconnectedFromDomain()), SLOT(updateWindowTitle()));
800− connect(&domainHandler, SIGNAL(disconnectedFromDomain()), SLOT(clearDomainOctreeDetails()));
800+ connect(&domainHandler, &DomainHandler::disconnectedFromDomain, this, &Application::clearDomainAvatars);
801801 connect(&domainHandler, &DomainHandler::disconnectedFromDomain, this, [this]() {
802802 getOverlays().deleteOverlay(getTabletScreenID());
803803 getOverlays().deleteOverlay(getTabletHomeButtonID());
@@ -5196,14 +5196,17 @@ void Application::clearDomainOctreeDetails() { · 4392 unmodified lines
51965196 skyStage->setBackgroundMode(model::SunSkyStage::SKY_DEFAULT);
51975197
51985198 _recentlyClearedDomain = true;
5199−
5200− DependencyManager::get<AvatarManager>()->clearOtherAvatars();
5199+
52015200 DependencyManager::get<AnimationCache>()->clearUnusedResources();
52025201 DependencyManager::get<ModelCache>()->clearUnusedResources();
52035202 DependencyManager::get<SoundCache>()->clearUnusedResources();
52045203 DependencyManager::get<TextureCache>()->clearUnusedResources();
52055204 }
52065205
5206+void Application::clearDomainAvatars() {
5207+ DependencyManager::get<AvatarManager>()->clearOtherAvatars();
5208+}
5209+
52075210 void Application::domainChanged(const QString& domainHostname) {
52085211 updateWindowTitle();
52095212 // disable physics until we have enough information about our new location to not cause craziness.
@@ -5273,33 +5276,8 @@ void Application::nodeKilled(SharedNodePointer node) { · 63 unmodified lines
52735276 if (node->getType() == NodeType::AudioMixer) {
52745277 QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(), "audioMixerKilled");
52755278 } else if (node->getType() == NodeType::EntityServer) {
5276− QUuid nodeUUID = node->getUUID();
5277− // see if this is the first we've heard of this node...
5278− _entityServerJurisdictions.withReadLock([&] {
5279− if (_entityServerJurisdictions.find(nodeUUID) == _entityServerJurisdictions.end()) {
5280− return;
5281− }
5282−
5283− auto rootCode = _entityServerJurisdictions[nodeUUID].getRootOctalCode();
5284− VoxelPositionSize rootDetails;
5285− voxelDetailsForCode(rootCode.get(), rootDetails);
5286−
5287− qCDebug(interfaceapp, "model server going away...... v[%f, %f, %f, %f]",
5288− (double)rootDetails.x, (double)rootDetails.y, (double)rootDetails.z, (double)rootDetails.s);
5289−
5290− });
5291−
5292− // If the model server is going away, remove it from our jurisdiction map so we don't send voxels to a dead server
5293− _entityServerJurisdictions.withWriteLock([&] {
5294− _entityServerJurisdictions.erase(_entityServerJurisdictions.find(nodeUUID));
5295− });
5296−
5297− // also clean up scene stats for that server
5298− _octreeServerSceneStats.withWriteLock([&] {
5299− if (_octreeServerSceneStats.find(nodeUUID) != _octreeServerSceneStats.end()) {
5300− _octreeServerSceneStats.erase(nodeUUID);
5301− }
5302− });
5279+ // we lost an entity server, clear all of the domain octree details
5280+ clearDomainOctreeDetails();
53035281 } else if (node->getType() == NodeType::AvatarMixer) {
53045282 // our avatar mixer has gone away - clear the hash of avatars
53055283 DependencyManager::get<AvatarManager>()->clearOtherAvatars();