mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-07 10:02:24 +02:00
Case20410 Automatic Content Archives doesn't restore correctly with old Tutorial content set
The tutorial content set had a content set Id of Null, which caused a failure to parse the content set.
This commit is contained in:
parent
6ccf16dfe5
commit
2d71ec1c75
2 changed files with 12 additions and 3 deletions
|
@ -1734,7 +1734,7 @@ void DomainServer::processOctreeDataPersistMessage(QSharedPointer<ReceivedMessag
|
|||
f.write(data);
|
||||
OctreeUtils::RawEntityData entityData;
|
||||
if (entityData.readOctreeDataInfoFromData(data)) {
|
||||
qCDebug(domain_server) << "Wrote new entities file" << entityData.id << entityData.version;
|
||||
qCDebug(domain_server) << "Wrote new entities file" << entityData.id << entityData.dataVersion;
|
||||
} else {
|
||||
qCDebug(domain_server) << "Failed to read new octree data info";
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ bool OctreeEntitiesFileParser::parseEntities(QVariantMap& parsedEntities) {
|
|||
_errorString = "Duplicate Id entries";
|
||||
return false;
|
||||
}
|
||||
|
||||
gotId = true;
|
||||
if (nextToken() != '"') {
|
||||
_errorString = "Invalid Id value";
|
||||
return false;
|
||||
|
@ -107,6 +107,16 @@ bool OctreeEntitiesFileParser::parseEntities(QVariantMap& parsedEntities) {
|
|||
_errorString = "Invalid Id string";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (idString == "{00000000-0000-0000-0000-000000000000}") {
|
||||
// some older archives may have a null string id, so
|
||||
// return success without setting parsedEntities,
|
||||
// which will result in a new uuid for the restored
|
||||
// archive. (not parsing and using isNull as parsing
|
||||
// results in null if there is a corrupt string)
|
||||
return true;
|
||||
}
|
||||
|
||||
QUuid idValue = QUuid::fromString(QLatin1String(idString.c_str()) );
|
||||
if (idValue.isNull()) {
|
||||
_errorString = "Id value invalid UUID string: " + idString;
|
||||
|
@ -114,7 +124,6 @@ bool OctreeEntitiesFileParser::parseEntities(QVariantMap& parsedEntities) {
|
|||
}
|
||||
|
||||
parsedEntities["Id"] = idValue;
|
||||
gotId = true;
|
||||
} else if (key == "Version") {
|
||||
if (gotVersion) {
|
||||
_errorString = "Duplicate Version entries";
|
||||
|
|
Loading…
Reference in a new issue