mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 17:32:42 +08:00
From: chris yeoh <yeohc@au1.ibm.com>
If you use load-oar to transfer region data from one sim to another then currently inventory items can be left with unknown owner permission which results in them being no-mod/no-copy for everyone. The attached patch fixes things up so if the owner uuid does not exist on the destination system then it assigns ownership (and the creator for completeness) to the master avatar id. This will make it much more practical to share copies of regions :-)
This commit is contained in:
@@ -153,6 +153,19 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
|
||||
// And zap any troublesome sit target information
|
||||
part.SitTargetOrientation = new Quaternion(0,0,0,1);
|
||||
part.SitTargetPosition = new Vector3(0,0,0);
|
||||
|
||||
// Fix ownership/creator of inventory items
|
||||
// Not doing so results in inventory items
|
||||
// being no copy/no mod for everyone
|
||||
TaskInventoryDictionary inv = part.TaskInventory;
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv) {
|
||||
if (!resolveUserUuid(kvp.Value.OwnerID)) {
|
||||
kvp.Value.OwnerID = masterAvatarId;
|
||||
}
|
||||
if (!resolveUserUuid(kvp.Value.CreatorID)) {
|
||||
kvp.Value.CreatorID = masterAvatarId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_scene.AddRestoredSceneObject(sceneObject, true, false))
|
||||
|
||||
Reference in New Issue
Block a user