mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Merge pull request #10922 from highfidelity/revert-10835-bug/invisible-avatars
Revert "fix for invisible avatars after radius ignore"
This commit is contained in:
commit
8a00efde72
8 changed files with 42 additions and 1 deletions
|
@ -108,6 +108,9 @@ void AvatarMixerClientData::ignoreOther(SharedNodePointer self, SharedNodePointe
|
||||||
void AvatarMixerClientData::removeFromRadiusIgnoringSet(SharedNodePointer self, const QUuid& other) {
|
void AvatarMixerClientData::removeFromRadiusIgnoringSet(SharedNodePointer self, const QUuid& other) {
|
||||||
if (isRadiusIgnoring(other)) {
|
if (isRadiusIgnoring(other)) {
|
||||||
_radiusIgnoredOthers.erase(other);
|
_radiusIgnoredOthers.erase(other);
|
||||||
|
auto exitingSpaceBubblePacket = NLPacket::create(PacketType::ExitingSpaceBubble, NUM_BYTES_RFC4122_UUID);
|
||||||
|
exitingSpaceBubblePacket->write(other.toRfc4122());
|
||||||
|
DependencyManager::get<NodeList>()->sendUnreliablePacket(*exitingSpaceBubblePacket, *self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,7 @@ AvatarManager::AvatarManager(QObject* parent) :
|
||||||
packetReceiver.registerListener(PacketType::BulkAvatarData, this, "processAvatarDataPacket");
|
packetReceiver.registerListener(PacketType::BulkAvatarData, this, "processAvatarDataPacket");
|
||||||
packetReceiver.registerListener(PacketType::KillAvatar, this, "processKillAvatar");
|
packetReceiver.registerListener(PacketType::KillAvatar, this, "processKillAvatar");
|
||||||
packetReceiver.registerListener(PacketType::AvatarIdentity, this, "processAvatarIdentityPacket");
|
packetReceiver.registerListener(PacketType::AvatarIdentity, this, "processAvatarIdentityPacket");
|
||||||
|
packetReceiver.registerListener(PacketType::ExitingSpaceBubble, this, "processExitingSpaceBubble");
|
||||||
|
|
||||||
// when we hear that the user has ignored an avatar by session UUID
|
// when we hear that the user has ignored an avatar by session UUID
|
||||||
// immediately remove that avatar instead of waiting for the absence of packets from avatar mixer
|
// immediately remove that avatar instead of waiting for the absence of packets from avatar mixer
|
||||||
|
@ -319,6 +320,9 @@ void AvatarManager::handleRemovedAvatar(const AvatarSharedPointer& removedAvatar
|
||||||
|
|
||||||
if (removalReason == KillAvatarReason::TheirAvatarEnteredYourBubble) {
|
if (removalReason == KillAvatarReason::TheirAvatarEnteredYourBubble) {
|
||||||
emit DependencyManager::get<UsersScriptingInterface>()->enteredIgnoreRadius();
|
emit DependencyManager::get<UsersScriptingInterface>()->enteredIgnoreRadius();
|
||||||
|
}
|
||||||
|
if (removalReason == KillAvatarReason::TheirAvatarEnteredYourBubble || removalReason == YourAvatarEnteredTheirBubble) {
|
||||||
|
DependencyManager::get<NodeList>()->radiusIgnoreNodeBySessionID(avatar->getSessionUUID(), true);
|
||||||
} else if (removalReason == KillAvatarReason::AvatarDisconnected) {
|
} else if (removalReason == KillAvatarReason::AvatarDisconnected) {
|
||||||
// remove from node sets, if present
|
// remove from node sets, if present
|
||||||
DependencyManager::get<NodeList>()->removeFromIgnoreMuteSets(avatar->getSessionUUID());
|
DependencyManager::get<NodeList>()->removeFromIgnoreMuteSets(avatar->getSessionUUID());
|
||||||
|
|
|
@ -1440,7 +1440,8 @@ void Avatar::addToScene(AvatarSharedPointer myHandle, const render::ScenePointer
|
||||||
if (scene) {
|
if (scene) {
|
||||||
auto nodelist = DependencyManager::get<NodeList>();
|
auto nodelist = DependencyManager::get<NodeList>();
|
||||||
if (showAvatars
|
if (showAvatars
|
||||||
&& !nodelist->isIgnoringNode(getSessionUUID())) {
|
&& !nodelist->isIgnoringNode(getSessionUUID())
|
||||||
|
&& !nodelist->isRadiusIgnoringNode(getSessionUUID())) {
|
||||||
render::Transaction transaction;
|
render::Transaction transaction;
|
||||||
addToScene(myHandle, scene, transaction);
|
addToScene(myHandle, scene, transaction);
|
||||||
scene->enqueueTransaction(transaction);
|
scene->enqueueTransaction(transaction);
|
||||||
|
|
|
@ -170,6 +170,13 @@ void AvatarHashMap::processKillAvatar(QSharedPointer<ReceivedMessage> message, S
|
||||||
removeAvatar(sessionUUID, reason);
|
removeAvatar(sessionUUID, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AvatarHashMap::processExitingSpaceBubble(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode) {
|
||||||
|
// read the node id
|
||||||
|
QUuid sessionUUID = QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID));
|
||||||
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
|
nodeList->radiusIgnoreNodeBySessionID(sessionUUID, false);
|
||||||
|
}
|
||||||
|
|
||||||
void AvatarHashMap::removeAvatar(const QUuid& sessionUUID, KillAvatarReason removalReason) {
|
void AvatarHashMap::removeAvatar(const QUuid& sessionUUID, KillAvatarReason removalReason) {
|
||||||
QWriteLocker locker(&_hashLock);
|
QWriteLocker locker(&_hashLock);
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,7 @@ protected slots:
|
||||||
void processAvatarDataPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode);
|
void processAvatarDataPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode);
|
||||||
void processAvatarIdentityPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode);
|
void processAvatarIdentityPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode);
|
||||||
void processKillAvatar(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode);
|
void processKillAvatar(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode);
|
||||||
|
void processExitingSpaceBubble(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
AvatarHashMap();
|
AvatarHashMap();
|
||||||
|
|
|
@ -241,6 +241,10 @@ void NodeList::reset() {
|
||||||
|
|
||||||
_numNoReplyDomainCheckIns = 0;
|
_numNoReplyDomainCheckIns = 0;
|
||||||
|
|
||||||
|
// lock and clear our set of radius ignored IDs
|
||||||
|
_radiusIgnoredSetLock.lockForWrite();
|
||||||
|
_radiusIgnoredNodeIDs.clear();
|
||||||
|
_radiusIgnoredSetLock.unlock();
|
||||||
// lock and clear our set of ignored IDs
|
// lock and clear our set of ignored IDs
|
||||||
_ignoredSetLock.lockForWrite();
|
_ignoredSetLock.lockForWrite();
|
||||||
_ignoredNodeIDs.clear();
|
_ignoredNodeIDs.clear();
|
||||||
|
@ -806,6 +810,22 @@ void NodeList::sendIgnoreRadiusStateToNode(const SharedNodePointer& destinationN
|
||||||
sendPacket(std::move(ignorePacket), *destinationNode);
|
sendPacket(std::move(ignorePacket), *destinationNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NodeList::radiusIgnoreNodeBySessionID(const QUuid& nodeID, bool radiusIgnoreEnabled) {
|
||||||
|
if (radiusIgnoreEnabled) {
|
||||||
|
QReadLocker radiusIgnoredSetLocker{ &_radiusIgnoredSetLock }; // read lock for insert
|
||||||
|
// add this nodeID to our set of ignored IDs
|
||||||
|
_radiusIgnoredNodeIDs.insert(nodeID);
|
||||||
|
} else {
|
||||||
|
QWriteLocker radiusIgnoredSetLocker{ &_radiusIgnoredSetLock }; // write lock for unsafe_erase
|
||||||
|
_radiusIgnoredNodeIDs.unsafe_erase(nodeID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NodeList::isRadiusIgnoringNode(const QUuid& nodeID) const {
|
||||||
|
QReadLocker radiusIgnoredSetLocker{ &_radiusIgnoredSetLock }; // read lock for reading
|
||||||
|
return _radiusIgnoredNodeIDs.find(nodeID) != _radiusIgnoredNodeIDs.cend();
|
||||||
|
}
|
||||||
|
|
||||||
void NodeList::ignoreNodeBySessionID(const QUuid& nodeID, bool ignoreEnabled) {
|
void NodeList::ignoreNodeBySessionID(const QUuid& nodeID, bool ignoreEnabled) {
|
||||||
// enumerate the nodes to send a reliable ignore packet to each that can leverage it
|
// enumerate the nodes to send a reliable ignore packet to each that can leverage it
|
||||||
if (!nodeID.isNull() && _sessionUUID != nodeID) {
|
if (!nodeID.isNull() && _sessionUUID != nodeID) {
|
||||||
|
|
|
@ -77,6 +77,8 @@ public:
|
||||||
void toggleIgnoreRadius() { ignoreNodesInRadius(!getIgnoreRadiusEnabled()); }
|
void toggleIgnoreRadius() { ignoreNodesInRadius(!getIgnoreRadiusEnabled()); }
|
||||||
void enableIgnoreRadius() { ignoreNodesInRadius(true); }
|
void enableIgnoreRadius() { ignoreNodesInRadius(true); }
|
||||||
void disableIgnoreRadius() { ignoreNodesInRadius(false); }
|
void disableIgnoreRadius() { ignoreNodesInRadius(false); }
|
||||||
|
void radiusIgnoreNodeBySessionID(const QUuid& nodeID, bool radiusIgnoreEnabled);
|
||||||
|
bool isRadiusIgnoringNode(const QUuid& other) const;
|
||||||
void ignoreNodeBySessionID(const QUuid& nodeID, bool ignoreEnabled);
|
void ignoreNodeBySessionID(const QUuid& nodeID, bool ignoreEnabled);
|
||||||
bool isIgnoringNode(const QUuid& nodeID) const;
|
bool isIgnoringNode(const QUuid& nodeID) const;
|
||||||
void personalMuteNodeBySessionID(const QUuid& nodeID, bool muteEnabled);
|
void personalMuteNodeBySessionID(const QUuid& nodeID, bool muteEnabled);
|
||||||
|
@ -164,6 +166,8 @@ private:
|
||||||
QTimer _keepAlivePingTimer;
|
QTimer _keepAlivePingTimer;
|
||||||
bool _requestsDomainListData;
|
bool _requestsDomainListData;
|
||||||
|
|
||||||
|
mutable QReadWriteLock _radiusIgnoredSetLock;
|
||||||
|
tbb::concurrent_unordered_set<QUuid, UUIDHasher> _radiusIgnoredNodeIDs;
|
||||||
mutable QReadWriteLock _ignoredSetLock;
|
mutable QReadWriteLock _ignoredSetLock;
|
||||||
tbb::concurrent_unordered_set<QUuid, UUIDHasher> _ignoredNodeIDs;
|
tbb::concurrent_unordered_set<QUuid, UUIDHasher> _ignoredNodeIDs;
|
||||||
mutable QReadWriteLock _personalMutedSetLock;
|
mutable QReadWriteLock _personalMutedSetLock;
|
||||||
|
|
|
@ -105,6 +105,7 @@ public:
|
||||||
UsernameFromIDReply,
|
UsernameFromIDReply,
|
||||||
ViewFrustum,
|
ViewFrustum,
|
||||||
RequestsDomainListData,
|
RequestsDomainListData,
|
||||||
|
ExitingSpaceBubble,
|
||||||
PerAvatarGainSet,
|
PerAvatarGainSet,
|
||||||
EntityScriptGetStatus,
|
EntityScriptGetStatus,
|
||||||
EntityScriptGetStatusReply,
|
EntityScriptGetStatusReply,
|
||||||
|
|
Loading…
Reference in a new issue