mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-19 02:41:17 +02:00
duh
This commit is contained in:
parent
daccb70819
commit
2443b2d6d9
1 changed files with 7 additions and 1 deletions
|
@ -209,10 +209,13 @@ QByteArray AvatarData::toByteArray(bool cullSmallChanges, bool sendAll, bool sen
|
|||
if (compressed) {
|
||||
setAtBit(packetStateFlags, AVATARDATA_FLAGS_COMPRESSED);
|
||||
}
|
||||
|
||||
memcpy(destinationBuffer, &packetStateFlags, sizeof(packetStateFlags));
|
||||
destinationBuffer += sizeof(packetStateFlags);
|
||||
|
||||
if (!sendMinimum) {
|
||||
//qDebug() << __FUNCTION__ << "not minimum... sending actual content!!";
|
||||
|
||||
auto header = reinterpret_cast<AvatarDataPacket::Header*>(destinationBuffer);
|
||||
header->position[0] = getLocalPosition().x;
|
||||
header->position[1] = getLocalPosition().y;
|
||||
|
@ -514,15 +517,18 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
|
|||
|
||||
// if this is the minimum, then it only includes the flags
|
||||
if (minimumSent) {
|
||||
//qDebug() << __FUNCTION__ << "minimum... not expecting actual content!!";
|
||||
|
||||
int numBytesRead = sizeof(packetStateFlags);
|
||||
_averageBytesReceived.updateAverage(numBytesRead);
|
||||
return numBytesRead;
|
||||
}
|
||||
//qDebug() << __FUNCTION__ << "NOT minimum... expecting actual content!!";
|
||||
|
||||
QByteArray uncompressBuffer;
|
||||
const unsigned char* startPosition = reinterpret_cast<const unsigned char*>(buffer.data());
|
||||
const unsigned char* endPosition = startPosition + buffer.size();
|
||||
const unsigned char* sourceBuffer = startPosition;
|
||||
const unsigned char* sourceBuffer = startPosition + sizeof(packetStateFlags); // skip the flags!!
|
||||
|
||||
if (packetIsCompressed) {
|
||||
uncompressBuffer = qUncompress(buffer.right(buffer.size() - sizeof(packetStateFlags)));
|
||||
|
|
Loading…
Reference in a new issue