mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-10 02:44:34 +02:00
Merge pull request #13912 from birarda/bug/agent-clear-avatars
handle agent avatar clear on avatar mixer disconnect
This commit is contained in:
commit
2c056e5b22
5 changed files with 18 additions and 10 deletions
|
@ -1192,7 +1192,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
|||
connect(&domainHandler, SIGNAL(resetting()), SLOT(resettingDomain()));
|
||||
connect(&domainHandler, SIGNAL(connectedToDomain(QUrl)), SLOT(updateWindowTitle()));
|
||||
connect(&domainHandler, SIGNAL(disconnectedFromDomain()), SLOT(updateWindowTitle()));
|
||||
connect(&domainHandler, &DomainHandler::disconnectedFromDomain, this, &Application::clearDomainAvatars);
|
||||
connect(&domainHandler, &DomainHandler::disconnectedFromDomain, this, [this]() {
|
||||
getOverlays().deleteOverlay(getTabletScreenID());
|
||||
getOverlays().deleteOverlay(getTabletHomeButtonID());
|
||||
|
@ -6370,10 +6369,6 @@ void Application::clearDomainOctreeDetails() {
|
|||
getMyAvatar()->setAvatarEntityDataChanged(true);
|
||||
}
|
||||
|
||||
void Application::clearDomainAvatars() {
|
||||
DependencyManager::get<AvatarManager>()->clearOtherAvatars();
|
||||
}
|
||||
|
||||
void Application::domainURLChanged(QUrl domainURL) {
|
||||
// disable physics until we have enough information about our new location to not cause craziness.
|
||||
resetPhysicsReadyInformation();
|
||||
|
@ -6461,9 +6456,6 @@ void Application::nodeKilled(SharedNodePointer node) {
|
|||
} else if (node->getType() == NodeType::EntityServer) {
|
||||
// we lost an entity server, clear all of the domain octree details
|
||||
clearDomainOctreeDetails();
|
||||
} else if (node->getType() == NodeType::AvatarMixer) {
|
||||
// our avatar mixer has gone away - clear the hash of avatars
|
||||
DependencyManager::get<AvatarManager>()->clearOtherAvatars();
|
||||
} else if (node->getType() == NodeType::AssetServer) {
|
||||
// asset server going away - check if we have the asset browser showing
|
||||
|
||||
|
|
|
@ -437,7 +437,6 @@ private slots:
|
|||
void onDesktopRootContextCreated(QQmlContext* qmlContext);
|
||||
void showDesktop();
|
||||
void clearDomainOctreeDetails();
|
||||
void clearDomainAvatars();
|
||||
void onAboutToQuit();
|
||||
void onPresent(quint32 frameCount);
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ public:
|
|||
|
||||
void postUpdate(float deltaTime, const render::ScenePointer& scene);
|
||||
|
||||
void clearOtherAvatars();
|
||||
void clearOtherAvatars() override;
|
||||
void deleteAllAvatars();
|
||||
|
||||
void getObjectsToRemoveFromPhysics(VectorOfMotionStates& motionStates);
|
||||
|
|
|
@ -113,6 +113,12 @@ AvatarHashMap::AvatarHashMap() {
|
|||
packetReceiver.registerListener(PacketType::BulkAvatarTraits, this, "processBulkAvatarTraits");
|
||||
|
||||
connect(nodeList.data(), &NodeList::uuidChanged, this, &AvatarHashMap::sessionUUIDChanged);
|
||||
|
||||
connect(nodeList.data(), &NodeList::nodeKilled, this, [this](SharedNodePointer killedNode){
|
||||
if (killedNode->getType() == NodeType::AvatarMixer) {
|
||||
clearOtherAvatars();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
QVector<QUuid> AvatarHashMap::getAvatarIdentifiers() {
|
||||
|
@ -429,3 +435,12 @@ void AvatarHashMap::sessionUUIDChanged(const QUuid& sessionUUID, const QUuid& ol
|
|||
emit avatarSessionChangedEvent(sessionUUID, oldUUID);
|
||||
}
|
||||
|
||||
void AvatarHashMap::clearOtherAvatars() {
|
||||
QWriteLocker locker(&_hashLock);
|
||||
|
||||
for (auto& av : _avatarHash) {
|
||||
handleRemovedAvatar(av);
|
||||
}
|
||||
|
||||
_avatarHash.clear();
|
||||
}
|
||||
|
|
|
@ -101,6 +101,8 @@ public:
|
|||
void setReplicaCount(int count);
|
||||
int getReplicaCount() { return _replicas.getReplicaCount(); };
|
||||
|
||||
virtual void clearOtherAvatars();
|
||||
|
||||
signals:
|
||||
|
||||
/**jsdoc
|
||||
|
|
Loading…
Reference in a new issue