aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authorJohn Hurliman2010-02-22 13:27:17 -0800
committerJohn Hurliman2010-02-22 13:27:17 -0800
commit7665aad002ef066fc31fa9497225d2668641c769 (patch)
treece2ad89f1ffd20c6f5e9a3b6558f7b90c651c830 /OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
parent* Added a sanity check for missing asset data in LLClientView (diff)
downloadopensim-SC-7665aad002ef066fc31fa9497225d2668641c769.zip
opensim-SC-7665aad002ef066fc31fa9497225d2668641c769.tar.gz
opensim-SC-7665aad002ef066fc31fa9497225d2668641c769.tar.bz2
opensim-SC-7665aad002ef066fc31fa9497225d2668641c769.tar.xz
* 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
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs24
1 files changed, 11 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index ded001b..7928811 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -192,7 +192,7 @@ namespace OpenSim.Region.Framework.Scenes
192 return new ArrayList(); 192 return new ArrayList();
193 } 193 }
194 194
195 AssetBase asset = CreateAsset(item.Name, item.Description, (sbyte)AssetType.LSLText, data); 195 AssetBase asset = CreateAsset(item.Name, item.Description, (sbyte)AssetType.LSLText, data, remoteClient.AgentId);
196 AssetService.Store(asset); 196 AssetService.Store(asset);
197 197
198 if (isScriptRunning) 198 if (isScriptRunning)
@@ -570,15 +570,9 @@ namespace OpenSim.Region.Framework.Scenes
570 /// <summary> 570 /// <summary>
571 /// Create a new asset data structure. 571 /// Create a new asset data structure.
572 /// </summary> 572 /// </summary>
573 /// <param name="name"></param> 573 private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data, UUID creatorID)
574 /// <param name="description"></param>
575 /// <param name="invType"></param>
576 /// <param name="assetType"></param>
577 /// <param name="data"></param>
578 /// <returns></returns>
579 private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data)
580 { 574 {
581 AssetBase asset = new AssetBase(UUID.Random(), name, assetType); 575 AssetBase asset = new AssetBase(UUID.Random(), name, assetType, creatorID);
582 asset.Description = description; 576 asset.Description = description;
583 asset.Data = (data == null) ? new byte[1] : data; 577 asset.Data = (data == null) ? new byte[1] : data;
584 578
@@ -704,7 +698,7 @@ namespace OpenSim.Region.Framework.Scenes
704 data = Encoding.ASCII.GetBytes(strdata); 698 data = Encoding.ASCII.GetBytes(strdata);
705 } 699 }
706 700
707 AssetBase asset = CreateAsset(name, description, assetType, data); 701 AssetBase asset = CreateAsset(name, description, assetType, data, remoteClient.AgentId);
708 AssetService.Store(asset); 702 AssetService.Store(asset);
709 703
710 CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate); 704 CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate);
@@ -1289,7 +1283,9 @@ namespace OpenSim.Region.Framework.Scenes
1289 itemBase.InvType, part.UUID, remoteClient.AgentId)) 1283 itemBase.InvType, part.UUID, remoteClient.AgentId))
1290 return; 1284 return;
1291 1285
1292 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}")); 1286 AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType,
1287 Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"),
1288 remoteClient.AgentId);
1293 AssetService.Store(asset); 1289 AssetService.Store(asset);
1294 1290
1295 TaskInventoryItem taskItem = new TaskInventoryItem(); 1291 TaskInventoryItem taskItem = new TaskInventoryItem();
@@ -1583,7 +1579,8 @@ namespace OpenSim.Region.Framework.Scenes
1583 objectGroup.GetPartName(objectGroup.LocalId), 1579 objectGroup.GetPartName(objectGroup.LocalId),
1584 objectGroup.GetPartDescription(objectGroup.LocalId), 1580 objectGroup.GetPartDescription(objectGroup.LocalId),
1585 (sbyte)AssetType.Object, 1581 (sbyte)AssetType.Object,
1586 Utils.StringToBytes(sceneObjectXml)); 1582 Utils.StringToBytes(sceneObjectXml),
1583 remoteClient.AgentId);
1587 AssetService.Store(asset); 1584 AssetService.Store(asset);
1588 1585
1589 item.AssetID = asset.FullID; 1586 item.AssetID = asset.FullID;
@@ -1630,7 +1627,8 @@ namespace OpenSim.Region.Framework.Scenes
1630 grp.GetPartName(grp.LocalId), 1627 grp.GetPartName(grp.LocalId),
1631 grp.GetPartDescription(grp.LocalId), 1628 grp.GetPartDescription(grp.LocalId),
1632 (sbyte)AssetType.Object, 1629 (sbyte)AssetType.Object,
1633 Utils.StringToBytes(sceneObjectXml)); 1630 Utils.StringToBytes(sceneObjectXml),
1631 remoteClient.AgentId);
1634 AssetService.Store(asset); 1632 AssetService.Store(asset);
1635 1633
1636 InventoryItemBase item = new InventoryItemBase(); 1634 InventoryItemBase item = new InventoryItemBase();