mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 11:35:20 +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);
|
f.write(data);
|
||||||
OctreeUtils::RawEntityData entityData;
|
OctreeUtils::RawEntityData entityData;
|
||||||
if (entityData.readOctreeDataInfoFromData(data)) {
|
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 {
|
} else {
|
||||||
qCDebug(domain_server) << "Failed to read new octree data info";
|
qCDebug(domain_server) << "Failed to read new octree data info";
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ bool OctreeEntitiesFileParser::parseEntities(QVariantMap& parsedEntities) {
|
||||||
_errorString = "Duplicate Id entries";
|
_errorString = "Duplicate Id entries";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
gotId = true;
|
||||||
if (nextToken() != '"') {
|
if (nextToken() != '"') {
|
||||||
_errorString = "Invalid Id value";
|
_errorString = "Invalid Id value";
|
||||||
return false;
|
return false;
|
||||||
|
@ -107,6 +107,16 @@ bool OctreeEntitiesFileParser::parseEntities(QVariantMap& parsedEntities) {
|
||||||
_errorString = "Invalid Id string";
|
_errorString = "Invalid Id string";
|
||||||
return false;
|
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()) );
|
QUuid idValue = QUuid::fromString(QLatin1String(idString.c_str()) );
|
||||||
if (idValue.isNull()) {
|
if (idValue.isNull()) {
|
||||||
_errorString = "Id value invalid UUID string: " + idString;
|
_errorString = "Id value invalid UUID string: " + idString;
|
||||||
|
@ -114,7 +124,6 @@ bool OctreeEntitiesFileParser::parseEntities(QVariantMap& parsedEntities) {
|
||||||
}
|
}
|
||||||
|
|
||||||
parsedEntities["Id"] = idValue;
|
parsedEntities["Id"] = idValue;
|
||||||
gotId = true;
|
|
||||||
} else if (key == "Version") {
|
} else if (key == "Version") {
|
||||||
if (gotVersion) {
|
if (gotVersion) {
|
||||||
_errorString = "Duplicate Version entries";
|
_errorString = "Duplicate Version entries";
|
||||||
|
|
Loading…
Reference in a new issue