aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-05-16 23:11:00 +0000
committerTeravus Ovares2008-05-16 23:11:00 +0000
commitaa5197304e2bb8c6b2f7bf3c8e86256042cf23b8 (patch)
treec55e7c94e4978bbc073947da44b383c692d8f5c6 /OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
parentminor change to justin's previous fix that should still (diff)
downloadopensim-SC_OLD-aa5197304e2bb8c6b2f7bf3c8e86256042cf23b8.zip
opensim-SC_OLD-aa5197304e2bb8c6b2f7bf3c8e86256042cf23b8.tar.gz
opensim-SC_OLD-aa5197304e2bb8c6b2f7bf3c8e86256042cf23b8.tar.bz2
opensim-SC_OLD-aa5197304e2bb8c6b2f7bf3c8e86256042cf23b8.tar.xz
* Committing patch from mantis 0001297: [PATCH] Fix behavior of child prim inventories. Also enables 'New Script' button. from Melanie. Thanks Melanie!
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs53
1 files changed, 41 insertions, 12 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 5e2ccec..0447631 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -221,7 +221,7 @@ namespace OpenSim.Region.Environment.Scenes
221 // Update item with new asset 221 // Update item with new asset
222 item.AssetID = asset.FullID; 222 item.AssetID = asset.FullID;
223 group.UpdateInventoryItem(item); 223 group.UpdateInventoryItem(item);
224 group.GetProperties(remoteClient); 224 part.GetProperties(remoteClient);
225 225
226 // Trigger rerunning of script (use TriggerRezScript event, see RezScript) 226 // Trigger rerunning of script (use TriggerRezScript event, see RezScript)
227 if (isScriptRunning) 227 if (isScriptRunning)
@@ -572,7 +572,7 @@ namespace OpenSim.Region.Environment.Scenes
572 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID, 572 private void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID folderID, uint callbackID,
573 AssetBase asset, uint nextOwnerMask) 573 AssetBase asset, uint nextOwnerMask)
574 { 574 {
575 CreateNewInventoryItem(remoteClient, folderID, callbackID, asset, nextOwnerMask, nextOwnerMask, 0, nextOwnerMask); 575 CreateNewInventoryItem(remoteClient, folderID, callbackID, asset, (uint)PermissionMask.All, (uint)PermissionMask.All, 0, nextOwnerMask);
576 } 576 }
577 577
578 /// <summary> 578 /// <summary>
@@ -789,11 +789,12 @@ namespace OpenSim.Region.Environment.Scenes
789 /// <param name="localID"></param> 789 /// <param name="localID"></param>
790 public void RemoveTaskInventory(IClientAPI remoteClient, LLUUID itemID, uint localID) 790 public void RemoveTaskInventory(IClientAPI remoteClient, LLUUID itemID, uint localID)
791 { 791 {
792 SceneObjectGroup group = GetGroupByPrim(localID); 792 SceneObjectPart part = GetSceneObjectPart(localID);
793 SceneObjectGroup group = part.ParentGroup;
793 if (group != null) 794 if (group != null)
794 { 795 {
795 int type = group.RemoveInventoryItem(localID, itemID); 796 int type = group.RemoveInventoryItem(localID, itemID);
796 group.GetProperties(remoteClient); 797 part.GetProperties(remoteClient);
797 if (type == 10) 798 if (type == 10)
798 { 799 {
799 EventManager.TriggerRemoveScript(localID, itemID); 800 EventManager.TriggerRemoveScript(localID, itemID);
@@ -917,7 +918,7 @@ namespace OpenSim.Region.Environment.Scenes
917 m_log.InfoFormat( 918 m_log.InfoFormat(
918 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}", 919 "[PRIM INVENTORY]: Update with item {0} requested of prim {1} for {2}",
919 item.Name, primLocalID, remoteClient.Name); 920 item.Name, primLocalID, remoteClient.Name);
920 part.ParentGroup.GetProperties(remoteClient); 921 part.GetProperties(remoteClient);
921 if (!ExternalChecks.ExternalChecksBypassPermissions()) 922 if (!ExternalChecks.ExternalChecksBypassPermissions())
922 { 923 {
923 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) 924 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
@@ -948,8 +949,9 @@ namespace OpenSim.Region.Environment.Scenes
948 /// <param name="remoteClient"></param> 949 /// <param name="remoteClient"></param>
949 /// <param name="itemID"> </param> 950 /// <param name="itemID"> </param>
950 /// <param name="localID"></param> 951 /// <param name="localID"></param>
951 public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID) 952 public void RezScript(IClientAPI remoteClient, InventoryItemBase itemBase, LLUUID transactionID, uint localID)
952 { 953 {
954 LLUUID itemID=itemBase.ID;
953 LLUUID copyID = LLUUID.Random(); 955 LLUUID copyID = LLUUID.Random();
954 956
955 if (itemID != LLUUID.Zero) 957 if (itemID != LLUUID.Zero)
@@ -974,7 +976,7 @@ namespace OpenSim.Region.Environment.Scenes
974 { 976 {
975 part.ParentGroup.AddInventoryItem(remoteClient, localID, item, copyID); 977 part.ParentGroup.AddInventoryItem(remoteClient, localID, item, copyID);
976 part.ParentGroup.StartScript(localID, copyID); 978 part.ParentGroup.StartScript(localID, copyID);
977 part.ParentGroup.GetProperties(remoteClient); 979 part.GetProperties(remoteClient);
978 980
979 // m_log.InfoFormat("[PRIMINVENTORY]: " + 981 // m_log.InfoFormat("[PRIMINVENTORY]: " +
980 // "Rezzed script {0} into prim local ID {1} for user {2}", 982 // "Rezzed script {0} into prim local ID {1} for user {2}",
@@ -999,11 +1001,38 @@ namespace OpenSim.Region.Environment.Scenes
999 } 1001 }
1000 else // If the itemID is zero then the script has been rezzed directly in an object's inventory 1002 else // If the itemID is zero then the script has been rezzed directly in an object's inventory
1001 { 1003 {
1002 // not yet implemented 1004 SceneObjectPart part=GetSceneObjectPart(itemBase.Folder);
1003 // TODO Need to get more details from original RezScript packet 1005 if(part == null)
1004 // XXX jc tmp 1006 return;
1005// AssetBase asset = CreateAsset("chimney sweep", "sailor.lsl", 10, 10, null); 1007
1006// AssetCache.AddAsset(asset); 1008 AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.InvType, (sbyte)itemBase.AssetType, Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"));
1009 AssetCache.AddAsset(asset);
1010
1011 TaskInventoryItem taskItem=new TaskInventoryItem();
1012
1013 taskItem.ResetIDs(itemBase.Folder);
1014 taskItem.ParentID = itemBase.Folder;
1015 taskItem.CreationDate = (uint)itemBase.CreationDate;
1016 taskItem.Name = itemBase.Name;
1017 taskItem.Description = itemBase.Description;
1018 taskItem.Type = itemBase.AssetType;
1019 taskItem.InvType = itemBase.InvType;
1020 taskItem.OwnerID = itemBase.Owner;
1021 taskItem.CreatorID = itemBase.Creator;
1022 taskItem.BaseMask = itemBase.BasePermissions;
1023 taskItem.OwnerMask = itemBase.CurrentPermissions;
1024 taskItem.EveryoneMask = itemBase.EveryOnePermissions;
1025 taskItem.NextOwnerMask = itemBase.NextPermissions;
1026 taskItem.GroupID = itemBase.GroupID;
1027 taskItem.GroupMask = 0;
1028 taskItem.Flags = itemBase.Flags;
1029 taskItem.PermsGranter = LLUUID.Zero;
1030 taskItem.PermsMask = 0;
1031 taskItem.AssetID = asset.ID;
1032
1033 part.AddInventoryItem(taskItem);
1034 part.GetProperties(remoteClient);
1035 part.StartScript(taskItem);
1007 } 1036 }
1008 } 1037 }
1009 1038