mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 16:18:05 +02:00
fix multiple avatar parsing in AvatarManager
This commit is contained in:
parent
9021ccef89
commit
4573eaebc6
3 changed files with 2 additions and 5 deletions
|
@ -70,7 +70,6 @@ void broadcastAvatarData() {
|
||||||
QByteArray avatarByteArray;
|
QByteArray avatarByteArray;
|
||||||
avatarByteArray.append(otherNode->getUUID().toRfc4122());
|
avatarByteArray.append(otherNode->getUUID().toRfc4122());
|
||||||
|
|
||||||
|
|
||||||
AvatarData *nodeData = (AvatarData *)otherNode->getLinkedData();
|
AvatarData *nodeData = (AvatarData *)otherNode->getLinkedData();
|
||||||
avatarByteArray.append(nodeData->toByteArray());
|
avatarByteArray.append(nodeData->toByteArray());
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,7 @@ void AvatarManager::processAvatarMixerDatagram(const QByteArray& datagram, const
|
||||||
int bytesRead = numBytesForPacketHeader(datagram);
|
int bytesRead = numBytesForPacketHeader(datagram);
|
||||||
|
|
||||||
QByteArray dummyAvatarByteArray = byteArrayWithPopluatedHeader(PacketTypeAvatarData);
|
QByteArray dummyAvatarByteArray = byteArrayWithPopluatedHeader(PacketTypeAvatarData);
|
||||||
int numDummyByteArrayHeaderBytes = dummyAvatarByteArray.size();
|
int numDummyByteArrayHeaderBytes = dummyAvatarByteArray.size();
|
||||||
|
|
||||||
// enumerate over all of the avatars in this packet
|
// enumerate over all of the avatars in this packet
|
||||||
// only add them if mixerWeakPointer points to something (meaning that mixer is still around)
|
// only add them if mixerWeakPointer points to something (meaning that mixer is still around)
|
||||||
|
@ -237,7 +237,7 @@ void AvatarManager::processAvatarMixerDatagram(const QByteArray& datagram, const
|
||||||
|
|
||||||
// make this Avatar's UUID the UUID in the packet and tack the remaining data onto the end
|
// make this Avatar's UUID the UUID in the packet and tack the remaining data onto the end
|
||||||
dummyAvatarByteArray.replace(numDummyByteArrayHeaderBytes - NUM_BYTES_RFC4122_UUID,
|
dummyAvatarByteArray.replace(numDummyByteArrayHeaderBytes - NUM_BYTES_RFC4122_UUID,
|
||||||
NUM_BYTES_RFC4122_UUID + datagram.size() - bytesRead,
|
datagram.size() - bytesRead,
|
||||||
datagram.mid(bytesRead));
|
datagram.mid(bytesRead));
|
||||||
|
|
||||||
// have the matching (or new) avatar parse the data from the packet
|
// have the matching (or new) avatar parse the data from the packet
|
||||||
|
|
|
@ -160,8 +160,6 @@ int HandData::encodeRemoteData(unsigned char* destinationBuffer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int HandData::decodeRemoteData(const QByteArray& dataByteArray) {
|
int HandData::decodeRemoteData(const QByteArray& dataByteArray) {
|
||||||
QDataStream packetStream(dataByteArray);
|
|
||||||
|
|
||||||
const unsigned char* startPosition;
|
const unsigned char* startPosition;
|
||||||
const unsigned char* sourceBuffer = startPosition = reinterpret_cast<const unsigned char*>(dataByteArray.data());
|
const unsigned char* sourceBuffer = startPosition = reinterpret_cast<const unsigned char*>(dataByteArray.data());
|
||||||
unsigned int numHands = *sourceBuffer++;
|
unsigned int numHands = *sourceBuffer++;
|
||||||
|
|
Loading…
Reference in a new issue