From 066b350d207f9410b2198726bdd71555b08c2d6d Mon Sep 17 00:00:00 2001
From: Charles Krinke
Date: Fri, 23 May 2008 02:45:52 +0000
Subject: Thank you kindly, Melanie, for: Nothing huge, but the new button code
for producing a new script does well, but the script will not allow for name
change once created. It reverts back to new script.
---
.../Region/Environment/Scenes/Scene.Inventory.cs | 73 +++++++++++++---------
.../Environment/Scenes/SceneExternalChecks.cs | 1 +
.../Scenes/SceneObjectPart.Inventory.cs | 5 +-
3 files changed, 48 insertions(+), 31 deletions(-)
(limited to 'OpenSim/Region/Environment/Scenes')
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 0e19d96..e92178c 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -897,53 +897,66 @@ namespace OpenSim.Region.Environment.Scenes
/// This method does not handle scripts, RezScript(IClientAPI, LLUUID, unit)
///
///
- ///
- ///
+ ///
+ ///
///
- public void UpdateTaskInventory(IClientAPI remoteClient, LLUUID itemID, LLUUID folderID,
+ public void UpdateTaskInventory(IClientAPI remoteClient, LLUUID transactionID, TaskInventoryItem itemInfo,
uint primLocalID)
{
+ LLUUID itemID=itemInfo.ItemID;
+ LLUUID folderID=itemInfo.ParentID;
+
+ // Find the prim we're dealing with
SceneObjectPart part = GetSceneObjectPart(primLocalID);
if (part != null)
{
- LLUUID copyID = LLUUID.Random();
- if (itemID != LLUUID.Zero)
+ TaskInventoryItem currentItem=part.GetInventoryItem(itemID);
+ if(currentItem == null)
{
- CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
-
- if (userInfo != null && userInfo.RootFolder != null)
+ LLUUID copyID = LLUUID.Random();
+ if (itemID != LLUUID.Zero)
{
- InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
+ CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
- // Try library
- // XXX clumsy, possibly should be one call
- if (null == item)
+ if (userInfo != null && userInfo.RootFolder != null)
{
- item = CommsManager.UserProfileCacheService.libraryRoot.FindItem(itemID);
- }
+ InventoryItemBase item = userInfo.RootFolder.FindItem(itemID);
- if (item != null)
- {
- part.ParentGroup.AddInventoryItem(remoteClient, primLocalID, item, copyID);
- m_log.InfoFormat(
- "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
- item.Name, primLocalID, remoteClient.Name);
- part.GetProperties(remoteClient);
- if (!ExternalChecks.ExternalChecksBypassPermissions())
+ // Try library
+ // XXX clumsy, possibly should be one call
+ if (null == item)
{
- if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
- RemoveInventoryItem(remoteClient, itemID);
+ item = CommsManager.UserProfileCacheService.libraryRoot.FindItem(itemID);
+ }
+
+ if (item != null)
+ {
+ part.ParentGroup.AddInventoryItem(remoteClient, primLocalID, item, copyID);
+ m_log.InfoFormat(
+ "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
+ item.Name, primLocalID, remoteClient.Name);
+ part.GetProperties(remoteClient);
+ if (!ExternalChecks.ExternalChecksBypassPermissions())
+ {
+ if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
+ RemoveInventoryItem(remoteClient, itemID);
+ }
+ }
+ else
+ {
+ m_log.ErrorFormat(
+ "[PRIM INVENTORY]: Could not find inventory item {0} to update for {1}!",
+ itemID, remoteClient.Name);
}
- }
- else
- {
- m_log.ErrorFormat(
- "[PRIM INVENTORY]: Could not find inventory item {0} to update for {1}!",
- itemID, remoteClient.Name);
}
}
}
+ else // Updating existing item with new perms etc
+ {
+ if(part.UpdateInventoryItem(itemInfo))
+ part.GetProperties(remoteClient);
+ }
}
else
{
diff --git a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
index 040ee70..2be5ab9 100644
--- a/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneExternalChecks.cs
@@ -69,6 +69,7 @@ namespace OpenSim.Region.Environment.Scenes
(uint)LLObject.ObjectFlags.ObjectMove |
(uint)LLObject.ObjectFlags.ObjectTransfer |
(uint)LLObject.ObjectFlags.ObjectYouOwner |
+ (uint)LLObject.ObjectFlags.ObjectOwnerModify |
(uint)LLObject.ObjectFlags.ObjectYouOfficer;
foreach (GenerateClientFlags check in GenerateClientFlagsCheckFunctions)
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index 51521ff..facf72d 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
@@ -286,7 +286,6 @@ namespace OpenSim.Region.Environment.Scenes
public void AddInventoryItem(TaskInventoryItem item)
{
item.ParentID = UUID;
- item.CreationDate = 1000;
item.ParentPartID = UUID;
string name=FindAvailableInventoryName(item.Name);
@@ -369,6 +368,10 @@ namespace OpenSim.Region.Environment.Scenes
{
if (m_taskInventory.ContainsKey(item.ItemID))
{
+ item.ParentID = UUID;
+ item.ParentPartID = UUID;
+ item.Flags=m_taskInventory[item.ItemID].Flags;
+
m_taskInventory[item.ItemID] = item;
m_inventorySerial++;
TriggerScriptChangedEvent(Changed.INVENTORY);
--
cgit v1.1