mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 06:57:37 +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(resetting()), SLOT(resettingDomain()));
|
||||||
connect(&domainHandler, SIGNAL(connectedToDomain(QUrl)), SLOT(updateWindowTitle()));
|
connect(&domainHandler, SIGNAL(connectedToDomain(QUrl)), SLOT(updateWindowTitle()));
|
||||||
connect(&domainHandler, SIGNAL(disconnectedFromDomain()), SLOT(updateWindowTitle()));
|
connect(&domainHandler, SIGNAL(disconnectedFromDomain()), SLOT(updateWindowTitle()));
|
||||||
connect(&domainHandler, &DomainHandler::disconnectedFromDomain, this, &Application::clearDomainAvatars);
|
|
||||||
connect(&domainHandler, &DomainHandler::disconnectedFromDomain, this, [this]() {
|
connect(&domainHandler, &DomainHandler::disconnectedFromDomain, this, [this]() {
|
||||||
getOverlays().deleteOverlay(getTabletScreenID());
|
getOverlays().deleteOverlay(getTabletScreenID());
|
||||||
getOverlays().deleteOverlay(getTabletHomeButtonID());
|
getOverlays().deleteOverlay(getTabletHomeButtonID());
|
||||||
|
@ -6370,10 +6369,6 @@ void Application::clearDomainOctreeDetails() {
|
||||||
getMyAvatar()->setAvatarEntityDataChanged(true);
|
getMyAvatar()->setAvatarEntityDataChanged(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::clearDomainAvatars() {
|
|
||||||
DependencyManager::get<AvatarManager>()->clearOtherAvatars();
|
|
||||||
}
|
|
||||||
|
|
||||||
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();
|
resetPhysicsReadyInformation();
|
||||||
|
@ -6461,9 +6456,6 @@ void Application::nodeKilled(SharedNodePointer node) {
|
||||||
} else if (node->getType() == NodeType::EntityServer) {
|
} else if (node->getType() == NodeType::EntityServer) {
|
||||||
// we lost an entity server, clear all of the domain octree details
|
// we lost an entity server, clear all of the domain octree details
|
||||||
clearDomainOctreeDetails();
|
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) {
|
} else if (node->getType() == NodeType::AssetServer) {
|
||||||
// asset server going away - check if we have the asset browser showing
|
// asset server going away - check if we have the asset browser showing
|
||||||
|
|
||||||
|
|
|
@ -437,7 +437,6 @@ private slots:
|
||||||
void onDesktopRootContextCreated(QQmlContext* qmlContext);
|
void onDesktopRootContextCreated(QQmlContext* qmlContext);
|
||||||
void showDesktop();
|
void showDesktop();
|
||||||
void clearDomainOctreeDetails();
|
void clearDomainOctreeDetails();
|
||||||
void clearDomainAvatars();
|
|
||||||
void onAboutToQuit();
|
void onAboutToQuit();
|
||||||
void onPresent(quint32 frameCount);
|
void onPresent(quint32 frameCount);
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ public:
|
||||||
|
|
||||||
void postUpdate(float deltaTime, const render::ScenePointer& scene);
|
void postUpdate(float deltaTime, const render::ScenePointer& scene);
|
||||||
|
|
||||||
void clearOtherAvatars();
|
void clearOtherAvatars() override;
|
||||||
void deleteAllAvatars();
|
void deleteAllAvatars();
|
||||||
|
|
||||||
void getObjectsToRemoveFromPhysics(VectorOfMotionStates& motionStates);
|
void getObjectsToRemoveFromPhysics(VectorOfMotionStates& motionStates);
|
||||||
|
|
|
@ -113,6 +113,12 @@ AvatarHashMap::AvatarHashMap() {
|
||||||
packetReceiver.registerListener(PacketType::BulkAvatarTraits, this, "processBulkAvatarTraits");
|
packetReceiver.registerListener(PacketType::BulkAvatarTraits, this, "processBulkAvatarTraits");
|
||||||
|
|
||||||
connect(nodeList.data(), &NodeList::uuidChanged, this, &AvatarHashMap::sessionUUIDChanged);
|
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() {
|
QVector<QUuid> AvatarHashMap::getAvatarIdentifiers() {
|
||||||
|
@ -429,3 +435,12 @@ void AvatarHashMap::sessionUUIDChanged(const QUuid& sessionUUID, const QUuid& ol
|
||||||
emit avatarSessionChangedEvent(sessionUUID, oldUUID);
|
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);
|
void setReplicaCount(int count);
|
||||||
int getReplicaCount() { return _replicas.getReplicaCount(); };
|
int getReplicaCount() { return _replicas.getReplicaCount(); };
|
||||||
|
|
||||||
|
virtual void clearOtherAvatars();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
|
|
Loading…
Reference in a new issue