mirror of
https://github.com/overte-org/overte.git
synced 2025-07-29 09:30:01 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into improve-rotation-jitter
This commit is contained in:
commit
add45df496
1 changed files with 8 additions and 10 deletions
|
@ -1496,13 +1496,18 @@ QUrl AvatarData::cannonicalSkeletonModelURL(const QUrl& emptyURL) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AvatarData::processAvatarIdentity(const Identity& identity, bool& identityChanged, bool& displayNameChanged, const qint64 clockSkew) {
|
void AvatarData::processAvatarIdentity(const Identity& identity, bool& identityChanged, bool& displayNameChanged, const qint64 clockSkew) {
|
||||||
|
quint64 identityPacketUpdatedAt = identity.updatedAt;
|
||||||
|
|
||||||
|
if (identityPacketUpdatedAt <= (uint64_t)(abs(clockSkew))) { // Incoming timestamp is bad - compute our own timestamp
|
||||||
|
identityPacketUpdatedAt = usecTimestampNow() + clockSkew;
|
||||||
|
}
|
||||||
|
|
||||||
// Consider the case where this packet is being processed on Client A, and Client A is connected to Sandbox B.
|
// Consider the case where this packet is being processed on Client A, and Client A is connected to Sandbox B.
|
||||||
// If Client A's system clock is *ahead of* Sandbox B's system clock, "clockSkew" will be *negative*.
|
// If Client A's system clock is *ahead of* Sandbox B's system clock, "clockSkew" will be *negative*.
|
||||||
// If Client A's system clock is *behind* Sandbox B's system clock, "clockSkew" will be *positive*.
|
// If Client A's system clock is *behind* Sandbox B's system clock, "clockSkew" will be *positive*.
|
||||||
if ((_identityUpdatedAt > identity.updatedAt - clockSkew) && (_identityUpdatedAt != 0)) {
|
if ((_identityUpdatedAt > identityPacketUpdatedAt - clockSkew) && (_identityUpdatedAt != 0)) {
|
||||||
qCDebug(avatars) << "Ignoring late identity packet for avatar " << getSessionUUID()
|
qCDebug(avatars) << "Ignoring late identity packet for avatar " << getSessionUUID()
|
||||||
<< "_identityUpdatedAt (" << _identityUpdatedAt << ") is greater than identity.updatedAt - clockSkew (" << identity.updatedAt << "-" << clockSkew << ")";
|
<< "_identityUpdatedAt (" << _identityUpdatedAt << ") is greater than identityPacketUpdatedAt - clockSkew (" << identityPacketUpdatedAt << "-" << clockSkew << ")";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1538,14 +1543,7 @@ void AvatarData::processAvatarIdentity(const Identity& identity, bool& identityC
|
||||||
|
|
||||||
// use the timestamp from this identity, since we want to honor the updated times in "server clock"
|
// use the timestamp from this identity, since we want to honor the updated times in "server clock"
|
||||||
// this will overwrite any changes we made locally to this AvatarData's _identityUpdatedAt
|
// this will overwrite any changes we made locally to this AvatarData's _identityUpdatedAt
|
||||||
// Additionally, ensure that the timestamp that we try to record isn't negative, as
|
_identityUpdatedAt = identityPacketUpdatedAt - clockSkew;
|
||||||
// "_identityUpdatedAt" is an *unsigned* 64-bit integer. Furthermore, negative timestamps
|
|
||||||
// wouldn't make sense.
|
|
||||||
if (identity.updatedAt > clockSkew) {
|
|
||||||
_identityUpdatedAt = identity.updatedAt - clockSkew;
|
|
||||||
} else {
|
|
||||||
_identityUpdatedAt = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray AvatarData::identityByteArray() const {
|
QByteArray AvatarData::identityByteArray() const {
|
||||||
|
|
Loading…
Reference in a new issue