mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 07:02:46 +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);
|
||||
if (file.open(QIODevice::WriteOnly)) {
|
||||
auto entityData = data.toByteArray();
|
||||
auto entityData = data.toGzippedByteArray();
|
||||
file.write(entityData);
|
||||
file.close();
|
||||
} else {
|
||||
|
|
|
@ -152,3 +152,15 @@ QByteArray OctreeUtils::RawOctreeData::toByteArray() {
|
|||
|
||||
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;
|
||||
|
||||
QByteArray toByteArray();
|
||||
QByteArray toGzippedByteArray();
|
||||
};
|
||||
|
||||
bool readOctreeFile(QString path, QJsonDocument* doc);
|
||||
|
|
Loading…
Reference in a new issue