Merge pull request #9248 from howard-stearns/fixIdentityPacketInAC

Fix idententity packet in AC
This commit is contained in:
Howard Stearns 2016-12-20 17:02:27 -08:00 committed by GitHub
commit 51c0ab0aed

View file

@ -134,11 +134,16 @@ void AvatarHashMap::processAvatarIdentityPacket(QSharedPointer<ReceivedMessage>
// make sure this isn't for an ignored avatar // make sure this isn't for an ignored avatar
auto nodeList = DependencyManager::get<NodeList>(); auto nodeList = DependencyManager::get<NodeList>();
static auto EMPTY = QUuid(); static auto EMPTY = QUuid();
if (identity.uuid == _avatarHash.value(EMPTY)->getSessionUUID()) {
// We add MyAvatar to _avatarHash with an empty UUID. Code relies on this. In order to correctly handle an {
// identity packet for ourself (such as when we are assigned a sessionDisplayName by the mixer upon joining), QReadLocker locker(&_hashLock);
// we make things match here. auto me = _avatarHash.find(EMPTY);
identity.uuid = EMPTY; if ((me != _avatarHash.end()) && (identity.uuid == me.value()->getSessionUUID())) {
// We add MyAvatar to _avatarHash with an empty UUID. Code relies on this. In order to correctly handle an
// identity packet for ourself (such as when we are assigned a sessionDisplayName by the mixer upon joining),
// we make things match here.
identity.uuid = EMPTY;
}
} }
if (!nodeList->isIgnoringNode(identity.uuid)) { if (!nodeList->isIgnoringNode(identity.uuid)) {
// mesh URL for a UUID, find avatar in our list // mesh URL for a UUID, find avatar in our list