Resolve issue where an iar load fails to preserve original item creators

See http://opensimulator.org/mantis/view.php?id=4394
This change preserves the uuid when a profile is found rather than the ospa
0.6.8-post-fixes
Justin Clark-Casey (justincc) 2009-11-26 16:39:30 +00:00
parent a5f2803c79
commit 2bc19a1e23
3 changed files with 17 additions and 2 deletions

View File

@ -348,9 +348,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_scene.CommsManager);
if (UUID.Zero != ospResolvedId)
{
item.CreatorIdAsUuid = ospResolvedId;
// XXX: For now, don't preserve the OSPA in the creator id (which actually gets persisted to the
// database). Instead, replace with the UUID that we found.
item.CreatorId = ospResolvedId.ToString();
}
else
{
item.CreatorIdAsUuid = m_userInfo.UserProfile.ID;
}
item.Owner = m_userInfo.UserProfile.ID;

View File

@ -280,7 +280,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
string savePath = (cmdparams.Length > 6 ? cmdparams[6] : DEFAULT_INV_BACKUP_FILENAME);
m_log.InfoFormat(
"[INVENTORY ARCHIVER]: Saving archive {0} from inventory path {1} for {2} {3}",
"[INVENTORY ARCHIVER]: Saving archive {0} using inventory path {1} for {2} {3}",
savePath, invPath, firstName, lastName);
Guid id = Guid.NewGuid();

View File

@ -259,9 +259,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
= InventoryArchiveUtils.FindItemByPath(scene.InventoryService, userInfo.UserProfile.ID, item1Name);
Assert.That(foundItem1, Is.Not.Null, "Didn't find loaded item 1");
// We have to disable this check since loaded items that did find users via OSPA resolution are now only storing the
// UUID, not the OSPA itself.
// Assert.That(
// foundItem1.CreatorId, Is.EqualTo(item1.CreatorId),
// "Loaded item non-uuid creator doesn't match original");
Assert.That(
foundItem1.CreatorId, Is.EqualTo(item1.CreatorId),
foundItem1.CreatorId, Is.EqualTo(userItemCreatorUuid.ToString()),
"Loaded item non-uuid creator doesn't match original");
Assert.That(
foundItem1.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid),
"Loaded item uuid creator doesn't match original");