mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 06:44:06 +02:00
seek to correct place for bulk avatar data
This commit is contained in:
parent
b71678dfdb
commit
35c8a60f3b
1 changed files with 5 additions and 3 deletions
|
@ -54,6 +54,8 @@ void AvatarHashMap::processAvatarDataPacket(QSharedPointer<NLPacket> packet, Sha
|
|||
// only add them if mixerWeakPointer points to something (meaning that mixer is still around)
|
||||
while (packet->bytesLeftToRead()) {
|
||||
QUuid sessionUUID = QUuid::fromRfc4122(packet->read(NUM_BYTES_RFC4122_UUID));
|
||||
|
||||
int positionBeforeRead = packet->pos();
|
||||
|
||||
QByteArray byteArray = packet->read(packet->bytesLeftToRead());
|
||||
|
||||
|
@ -62,15 +64,15 @@ void AvatarHashMap::processAvatarDataPacket(QSharedPointer<NLPacket> packet, Sha
|
|||
if (!avatar) {
|
||||
avatar = addAvatar(sessionUUID, sendingNode);
|
||||
}
|
||||
|
||||
|
||||
// have the matching (or new) avatar parse the data from the packet
|
||||
int bytesRead = avatar->parseDataFromBuffer(byteArray);
|
||||
packet->seek(packet->pos() + bytesRead);
|
||||
packet->seek(positionBeforeRead + bytesRead);
|
||||
} else {
|
||||
// create a dummy AvatarData class to throw this data on the ground
|
||||
AvatarData dummyData;
|
||||
int bytesRead = dummyData.parseDataFromBuffer(byteArray);
|
||||
packet->seek(packet->pos() + bytesRead);
|
||||
packet->seek(positionBeforeRead + bytesRead);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue