From b5921e2b95305d2918f94f52a560f8c004b8bcb4 Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 22 Aug 2007 14:37:54 +0000 Subject: Start of Task Inventory (ie prim's inventory). For now, you can only move scripts into a prim (from your user inventory) and although the script will now show up in the prims inventory, you can't make any changes to it (or delete it). Also a prim's inventory is currently not saved between restarts. --- .../Region/Environment/Scenes/SceneObjectGroup.cs | 39 ++++++++++++++++------ 1 file changed, 29 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 2151ded..219de84 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -10,6 +10,7 @@ using libsecondlife.Packets; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Types; using OpenSim.Physics.Manager; +using OpenSim.Framework.Data; namespace OpenSim.Region.Environment.Scenes { @@ -518,7 +519,7 @@ namespace OpenSim.Region.Environment.Scenes proper.ObjectData[0].FolderID = LLUUID.Zero; proper.ObjectData[0].FromTaskID = LLUUID.Zero; proper.ObjectData[0].GroupID = LLUUID.Zero; - proper.ObjectData[0].InventorySerial = 0; + proper.ObjectData[0].InventorySerial = (short) this.m_rootPart.InventorySerial; proper.ObjectData[0].LastOwnerID = this.m_rootPart.LastOwnerID; proper.ObjectData[0].ObjectID = this.UUID; proper.ObjectData[0].OwnerID = this.m_rootPart.OwnerID; @@ -601,27 +602,45 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void GetPartInventoryFileName(IClientAPI remoteClient, uint localID) + public bool GetPartInventoryFileName(IClientAPI remoteClient, uint localID) { SceneObjectPart part = this.GetChildPrim(localID); if (part != null) { - part.GetInventoryFileName(remoteClient, localID); + return part.GetInventoryFileName(remoteClient, localID); } + return false; } - /// - /// - /// - /// - /// - public void RequestInventoryFile(IClientAPI remoteClient, uint localID, ulong xferID) + public string RequestInventoryFile(uint localID, XferManagaer xferManager) + { + SceneObjectPart part = this.GetChildPrim(localID); + if (part != null) + { + return part.RequestInventoryFile(xferManager); + } + return ""; + } + + public bool AddInventoryItem(IClientAPI remoteClient, uint localID, InventoryItemBase item) { SceneObjectPart part = this.GetChildPrim(localID); if (part != null) { - part.RequestInventoryFile(remoteClient, xferID); + SceneObjectPart.TaskInventoryItem taskItem = new SceneObjectPart.TaskInventoryItem(); + taskItem.item_id = item.inventoryID; + taskItem.asset_id = item.assetID; + taskItem.name = item.inventoryName; + taskItem.desc = item.inventoryDescription; + taskItem.owner_id = item.avatarID; + taskItem.creator_id = item.creatorsID; + taskItem.type = taskItem.AssetTypes[item.assetType]; + taskItem.inv_type = taskItem.AssetTypes[item.invType]; + part.AddInventoryItem(taskItem); + return true; } + return false; + } /// -- cgit v1.1