mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-04 00:41:17 +02:00
Merge pull request #10829 from birarda/bug/sequence-skips
fix avatar mixer sending empty avatar identities
This commit is contained in:
commit
f6fe3f91fd
3 changed files with 14 additions and 5 deletions
|
@ -285,6 +285,13 @@ void AvatarMixer::start() {
|
||||||
// is guaranteed to not be accessed by other thread
|
// is guaranteed to not be accessed by other thread
|
||||||
void AvatarMixer::manageIdentityData(const SharedNodePointer& node) {
|
void AvatarMixer::manageIdentityData(const SharedNodePointer& node) {
|
||||||
AvatarMixerClientData* nodeData = reinterpret_cast<AvatarMixerClientData*>(node->getLinkedData());
|
AvatarMixerClientData* nodeData = reinterpret_cast<AvatarMixerClientData*>(node->getLinkedData());
|
||||||
|
|
||||||
|
// there is no need to manage identity data we haven't received yet
|
||||||
|
// so bail early if we've never received an identity packet for this avatar
|
||||||
|
if (!nodeData || !nodeData->getAvatar().hasProcessedFirstIdentity()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool sendIdentity = false;
|
bool sendIdentity = false;
|
||||||
if (nodeData && nodeData->getAvatarSessionDisplayNameMustChange()) {
|
if (nodeData && nodeData->getAvatarSessionDisplayNameMustChange()) {
|
||||||
AvatarData& avatar = nodeData->getAvatar();
|
AvatarData& avatar = nodeData->getAvatar();
|
||||||
|
|
|
@ -320,14 +320,18 @@ void AvatarMixerSlave::broadcastAvatarDataToAgent(const SharedNodePointer& node)
|
||||||
++numOtherAvatars;
|
++numOtherAvatars;
|
||||||
|
|
||||||
const AvatarMixerClientData* otherNodeData = reinterpret_cast<const AvatarMixerClientData*>(otherNode->getLinkedData());
|
const AvatarMixerClientData* otherNodeData = reinterpret_cast<const AvatarMixerClientData*>(otherNode->getLinkedData());
|
||||||
|
const AvatarData* otherAvatar = otherNodeData->getConstAvatarData();
|
||||||
|
|
||||||
// If the time that the mixer sent AVATAR DATA about Avatar B to Avatar A is BEFORE OR EQUAL TO
|
// If the time that the mixer sent AVATAR DATA about Avatar B to Avatar A is BEFORE OR EQUAL TO
|
||||||
// the time that Avatar B flagged an IDENTITY DATA change, send IDENTITY DATA about Avatar B to Avatar A.
|
// the time that Avatar B flagged an IDENTITY DATA change, send IDENTITY DATA about Avatar B to Avatar A.
|
||||||
if (nodeData->getLastBroadcastTime(otherNode->getUUID()) <= otherNodeData->getIdentityChangeTimestamp()) {
|
if (otherAvatar->hasProcessedFirstIdentity()
|
||||||
|
&& nodeData->getLastBroadcastTime(otherNode->getUUID()) <= otherNodeData->getIdentityChangeTimestamp()) {
|
||||||
identityBytesSent += sendIdentityPacket(otherNodeData, node);
|
identityBytesSent += sendIdentityPacket(otherNodeData, node);
|
||||||
|
|
||||||
|
// remember the last time we sent identity details about this other node to the receiver
|
||||||
|
nodeData->setLastBroadcastTime(otherNode->getUUID(), usecTimestampNow());
|
||||||
}
|
}
|
||||||
|
|
||||||
const AvatarData* otherAvatar = otherNodeData->getConstAvatarData();
|
|
||||||
glm::vec3 otherPosition = otherAvatar->getClientGlobalPosition();
|
glm::vec3 otherPosition = otherAvatar->getClientGlobalPosition();
|
||||||
|
|
||||||
// determine if avatar is in view, to determine how much data to include...
|
// determine if avatar is in view, to determine how much data to include...
|
||||||
|
@ -400,9 +404,6 @@ void AvatarMixerSlave::broadcastAvatarDataToAgent(const SharedNodePointer& node)
|
||||||
// set the last sent sequence number for this sender on the receiver
|
// set the last sent sequence number for this sender on the receiver
|
||||||
nodeData->setLastBroadcastSequenceNumber(otherNode->getUUID(),
|
nodeData->setLastBroadcastSequenceNumber(otherNode->getUUID(),
|
||||||
otherNodeData->getLastReceivedSequenceNumber());
|
otherNodeData->getLastReceivedSequenceNumber());
|
||||||
|
|
||||||
// remember the last time we sent details about this other node to the receiver
|
|
||||||
nodeData->setLastBroadcastTime(otherNode->getUUID(), start);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -627,6 +627,7 @@ public:
|
||||||
void markIdentityDataChanged() { _identityDataChanged = true; }
|
void markIdentityDataChanged() { _identityDataChanged = true; }
|
||||||
|
|
||||||
void pushIdentitySequenceNumber() { ++_identitySequenceNumber; };
|
void pushIdentitySequenceNumber() { ++_identitySequenceNumber; };
|
||||||
|
bool hasProcessedFirstIdentity() const { return _hasProcessedFirstIdentity; }
|
||||||
|
|
||||||
float getDensity() const { return _density; }
|
float getDensity() const { return _density; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue