mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
change incoming/outgoing seq num handling
This commit is contained in:
parent
ddb6db9f6a
commit
f2a61fa59d
2 changed files with 12 additions and 3 deletions
|
@ -1562,14 +1562,23 @@ void AvatarData::processAvatarIdentity(const QByteArray& identityData, bool& ide
|
|||
}
|
||||
}
|
||||
|
||||
QByteArray AvatarData::identityByteArray() const {
|
||||
QByteArray AvatarData::identityByteArray(bool shouldForwardIncomingSequenceNumber) const {
|
||||
QByteArray identityData;
|
||||
QDataStream identityStream(&identityData, QIODevice::Append);
|
||||
const QUrl& urlToSend = cannonicalSkeletonModelURL(emptyURL); // depends on _skeletonModelURL
|
||||
|
||||
// we use the boolean flag to determine if this is an identity byte array for a mixer to send to an agent
|
||||
// or an agent to send to a mixer
|
||||
|
||||
// when mixers send identity packets to agents, they simply forward along the last incoming sequence number they received
|
||||
// whereas agents send a fresh outgoing sequence number when identity data has changed
|
||||
|
||||
udt::SequenceNumber identitySequenceNumber =
|
||||
shouldForwardIncomingSequenceNumber ? _lastIncomingSequenceNumber : _lastOutgoingSequenceNumber;
|
||||
|
||||
_avatarEntitiesLock.withReadLock([&] {
|
||||
identityStream << getSessionUUID()
|
||||
<< (udt::SequenceNumber::Type) _lastOutgoingSequenceNumber
|
||||
<< (udt::SequenceNumber::Type) identitySequenceNumber
|
||||
<< urlToSend
|
||||
<< _attachmentData
|
||||
<< _displayName
|
||||
|
|
|
@ -537,7 +537,7 @@ public:
|
|||
// displayNameChanged returns true if displayName has changed, false otherwise.
|
||||
void processAvatarIdentity(const QByteArray& identityData, bool& identityChanged, bool& displayNameChanged);
|
||||
|
||||
QByteArray identityByteArray() const;
|
||||
QByteArray identityByteArray(bool shouldForwardIncomingSequenceNumber = false) const;
|
||||
|
||||
const QUrl& getSkeletonModelURL() const { return _skeletonModelURL; }
|
||||
const QString& getDisplayName() const { return _displayName; }
|
||||
|
|
Loading…
Reference in a new issue