mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
* Adds CreatorID to asset metadata. This is just the plumbing to support CreatorID, it doesn't modify database backends or OAR files to support storing/loading it
This commit is contained in:
@@ -384,7 +384,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||
}
|
||||
}
|
||||
|
||||
AssetBase Animasset = new AssetBase(UUID.Random(), "Random Animation", (sbyte)AssetType.Animation);
|
||||
AssetBase Animasset = new AssetBase(UUID.Random(), "Random Animation", (sbyte)AssetType.Animation, m_scenePresence.UUID);
|
||||
Animasset.Data = anim.ToBytes();
|
||||
Animasset.Temporary = true;
|
||||
Animasset.Local = true;
|
||||
|
||||
@@ -192,7 +192,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return new ArrayList();
|
||||
}
|
||||
|
||||
AssetBase asset = CreateAsset(item.Name, item.Description, (sbyte)AssetType.LSLText, data);
|
||||
AssetBase asset = CreateAsset(item.Name, item.Description, (sbyte)AssetType.LSLText, data, remoteClient.AgentId);
|
||||
AssetService.Store(asset);
|
||||
|
||||
if (isScriptRunning)
|
||||
@@ -570,15 +570,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <summary>
|
||||
/// Create a new asset data structure.
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="description"></param>
|
||||
/// <param name="invType"></param>
|
||||
/// <param name="assetType"></param>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data)
|
||||
private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data, UUID creatorID)
|
||||
{
|
||||
AssetBase asset = new AssetBase(UUID.Random(), name, assetType);
|
||||
AssetBase asset = new AssetBase(UUID.Random(), name, assetType, creatorID);
|
||||
asset.Description = description;
|
||||
asset.Data = (data == null) ? new byte[1] : data;
|
||||
|
||||
@@ -704,7 +698,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
data = Encoding.ASCII.GetBytes(strdata);
|
||||
}
|
||||
|
||||
AssetBase asset = CreateAsset(name, description, assetType, data);
|
||||
AssetBase asset = CreateAsset(name, description, assetType, data, remoteClient.AgentId);
|
||||
AssetService.Store(asset);
|
||||
|
||||
CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate);
|
||||
@@ -1289,7 +1283,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
itemBase.InvType, part.UUID, remoteClient.AgentId))
|
||||
return;
|
||||
|
||||
AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"));
|
||||
AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType,
|
||||
Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"),
|
||||
remoteClient.AgentId);
|
||||
AssetService.Store(asset);
|
||||
|
||||
TaskInventoryItem taskItem = new TaskInventoryItem();
|
||||
@@ -1583,7 +1579,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
objectGroup.GetPartName(objectGroup.LocalId),
|
||||
objectGroup.GetPartDescription(objectGroup.LocalId),
|
||||
(sbyte)AssetType.Object,
|
||||
Utils.StringToBytes(sceneObjectXml));
|
||||
Utils.StringToBytes(sceneObjectXml),
|
||||
remoteClient.AgentId);
|
||||
AssetService.Store(asset);
|
||||
|
||||
item.AssetID = asset.FullID;
|
||||
@@ -1630,7 +1627,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
grp.GetPartName(grp.LocalId),
|
||||
grp.GetPartDescription(grp.LocalId),
|
||||
(sbyte)AssetType.Object,
|
||||
Utils.StringToBytes(sceneObjectXml));
|
||||
Utils.StringToBytes(sceneObjectXml),
|
||||
remoteClient.AgentId);
|
||||
AssetService.Store(asset);
|
||||
|
||||
InventoryItemBase item = new InventoryItemBase();
|
||||
|
||||
@@ -4389,7 +4389,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
group.GetPartName(localID),
|
||||
group.GetPartDescription(localID),
|
||||
(sbyte)AssetType.Object,
|
||||
Utils.StringToBytes(sceneObjectXml));
|
||||
Utils.StringToBytes(sceneObjectXml),
|
||||
group.OwnerID);
|
||||
AssetService.Store(asset);
|
||||
|
||||
InventoryItemBase item = new InventoryItemBase();
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||
TestHelper.InMethod();
|
||||
|
||||
UUID corruptAssetUuid = UUID.Parse("00000000-0000-0000-0000-000000000666");
|
||||
AssetBase corruptAsset = AssetHelpers.CreateAsset(corruptAssetUuid, "CORRUPT ASSET");
|
||||
AssetBase corruptAsset = AssetHelpers.CreateAsset(corruptAssetUuid, "CORRUPT ASSET", UUID.Zero);
|
||||
m_assetService.Store(corruptAsset);
|
||||
|
||||
IDictionary<UUID, int> foundAssetUuids = new Dictionary<UUID, int>();
|
||||
|
||||
Reference in New Issue
Block a user