mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Fix entity data not being gzipped when adding id+version
This commit is contained in:
parent
ff5be2d690
commit
1b7b4eee50
3 changed files with 14 additions and 1 deletions
|
@ -1193,7 +1193,7 @@ void OctreeServer::handleOctreeDataFileReply(QSharedPointer<ReceivedMessage> mes
|
||||||
|
|
||||||
QFile file(_persistAbsoluteFilePath);
|
QFile file(_persistAbsoluteFilePath);
|
||||||
if (file.open(QIODevice::WriteOnly)) {
|
if (file.open(QIODevice::WriteOnly)) {
|
||||||
auto entityData = data.toByteArray();
|
auto entityData = data.toGzippedByteArray();
|
||||||
file.write(entityData);
|
file.write(entityData);
|
||||||
file.close();
|
file.close();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -152,3 +152,15 @@ QByteArray OctreeUtils::RawOctreeData::toByteArray() {
|
||||||
|
|
||||||
return doc.toJson();
|
return doc.toJson();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QByteArray OctreeUtils::RawOctreeData::toGzippedByteArray() {
|
||||||
|
auto data = toByteArray();
|
||||||
|
QByteArray gzData;
|
||||||
|
|
||||||
|
if (!gzip(data, gzData, -1)) {
|
||||||
|
qCritical("Unable to gzip data while converting json.");
|
||||||
|
return QByteArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
return gzData;
|
||||||
|
}
|
|
@ -31,6 +31,7 @@ public:
|
||||||
QJsonArray octreeData;
|
QJsonArray octreeData;
|
||||||
|
|
||||||
QByteArray toByteArray();
|
QByteArray toByteArray();
|
||||||
|
QByteArray toGzippedByteArray();
|
||||||
};
|
};
|
||||||
|
|
||||||
bool readOctreeFile(QString path, QJsonDocument* doc);
|
bool readOctreeFile(QString path, QJsonDocument* doc);
|
||||||
|
|
Loading…
Reference in a new issue