diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 73 |
1 files changed, 36 insertions, 37 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index fe66dd5..0148d76 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -242,9 +242,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
242 | 242 | ||
243 | // Retrieve item | 243 | // Retrieve item |
244 | TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId); | 244 | TaskInventoryItem item = group.GetInventoryItem(part.LocalId, itemId); |
245 | 245 | ||
246 | if (null == item) | 246 | if (null == item) |
247 | { | 247 | { |
248 | m_log.ErrorFormat( | 248 | m_log.ErrorFormat( |
249 | "[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for caps script update " | 249 | "[PRIM INVENTORY]: Tried to retrieve item ID {0} from prim {1}, {2} for caps script update " |
250 | + " but the item does not exist in this inventory", | 250 | + " but the item does not exist in this inventory", |
@@ -338,7 +338,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
338 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 338 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
339 | else | 339 | else |
340 | item.CreationDate = itemUpd.CreationDate; | 340 | item.CreationDate = itemUpd.CreationDate; |
341 | |||
342 | 341 | ||
343 | // TODO: Check if folder changed and move item | 342 | // TODO: Check if folder changed and move item |
344 | //item.NextPermissions = itemUpd.Folder; | 343 | //item.NextPermissions = itemUpd.Folder; |
@@ -577,7 +576,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
577 | asset.Type = assetType; | 576 | asset.Type = assetType; |
578 | asset.FullID = LLUUID.Random(); | 577 | asset.FullID = LLUUID.Random(); |
579 | asset.Data = (data == null) ? new byte[1] : data; | 578 | asset.Data = (data == null) ? new byte[1] : data; |
580 | 579 | ||
581 | return asset; | 580 | return asset; |
582 | } | 581 | } |
583 | 582 | ||
@@ -958,7 +957,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
958 | agentItem.Folder = folderId; | 957 | agentItem.Folder = folderId; |
959 | AddInventoryItem(remoteClient, agentItem); | 958 | AddInventoryItem(remoteClient, agentItem); |
960 | } | 959 | } |
961 | 960 | ||
962 | /// <summary> | 961 | /// <summary> |
963 | /// <see>ClientMoveTaskInventoryItem</see> | 962 | /// <see>ClientMoveTaskInventoryItem</see> |
964 | /// </summary> | 963 | /// </summary> |
@@ -981,13 +980,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
981 | } | 980 | } |
982 | 981 | ||
983 | TaskInventoryItem taskItem = part.GetInventoryItem(itemId); | 982 | TaskInventoryItem taskItem = part.GetInventoryItem(itemId); |
984 | 983 | ||
985 | if (null == taskItem) | 984 | if (null == taskItem) |
986 | { | 985 | { |
987 | m_log.WarnFormat("[PRIM INVENTORY]: Move of inventory item {0} from prim with local id {1} failed" | 986 | m_log.WarnFormat("[PRIM INVENTORY]: Move of inventory item {0} from prim with local id {1} failed" |
988 | + " because the inventory item could not be found", | 987 | + " because the inventory item could not be found", |
989 | itemId, primLocalId); | 988 | itemId, primLocalId); |
990 | 989 | ||
991 | return; | 990 | return; |
992 | } | 991 | } |
993 | 992 | ||
@@ -997,7 +996,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
997 | 996 | ||
998 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); | 997 | MoveTaskInventoryItem(remoteClient, folderId, part, itemId); |
999 | } | 998 | } |
1000 | 999 | ||
1001 | /// <summary> | 1000 | /// <summary> |
1002 | /// <see>MoveTaskInventoryItem</see> | 1001 | /// <see>MoveTaskInventoryItem</see> |
1003 | /// </summary> | 1002 | /// </summary> |
@@ -1029,7 +1028,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1029 | AddInventoryItem(avatarId, agentItem); | 1028 | AddInventoryItem(avatarId, agentItem); |
1030 | } | 1029 | } |
1031 | } | 1030 | } |
1032 | 1031 | ||
1033 | /// <summary> | 1032 | /// <summary> |
1034 | /// Copy a task (prim) inventory item to another task (prim) | 1033 | /// Copy a task (prim) inventory item to another task (prim) |
1035 | /// </summary> | 1034 | /// </summary> |
@@ -1049,7 +1048,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1049 | 1048 | ||
1050 | return; | 1049 | return; |
1051 | } | 1050 | } |
1052 | 1051 | ||
1053 | SceneObjectPart destPart = GetSceneObjectPart(destId); | 1052 | SceneObjectPart destPart = GetSceneObjectPart(destId); |
1054 | 1053 | ||
1055 | if (destPart == null) | 1054 | if (destPart == null) |
@@ -1060,7 +1059,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1060 | destId); | 1059 | destId); |
1061 | return; | 1060 | return; |
1062 | } | 1061 | } |
1063 | 1062 | ||
1064 | if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.AllowInventoryDrop) == 0) | 1063 | if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)LLObject.ObjectFlags.AllowInventoryDrop) == 0) |
1065 | { | 1064 | { |
1066 | // object cannot copy items to an object owned by a different owner | 1065 | // object cannot copy items to an object owned by a different owner |
@@ -1076,7 +1075,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1076 | } | 1075 | } |
1077 | 1076 | ||
1078 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); | 1077 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); |
1079 | 1078 | ||
1080 | destTaskItem.ItemID = LLUUID.Random(); | 1079 | destTaskItem.ItemID = LLUUID.Random(); |
1081 | destTaskItem.CreatorID = srcTaskItem.CreatorID; | 1080 | destTaskItem.CreatorID = srcTaskItem.CreatorID; |
1082 | destTaskItem.AssetID = srcTaskItem.AssetID; | 1081 | destTaskItem.AssetID = srcTaskItem.AssetID; |
@@ -1091,7 +1090,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1091 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; | 1090 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; |
1092 | destTaskItem.NextPermissions = srcTaskItem.NextPermissions; | 1091 | destTaskItem.NextPermissions = srcTaskItem.NextPermissions; |
1093 | destTaskItem.Flags = srcTaskItem.Flags; | 1092 | destTaskItem.Flags = srcTaskItem.Flags; |
1094 | 1093 | ||
1095 | if (destPart.OwnerID != part.OwnerID) | 1094 | if (destPart.OwnerID != part.OwnerID) |
1096 | { | 1095 | { |
1097 | if (ExternalChecks.ExternalChecksPropagatePermissions()) | 1096 | if (ExternalChecks.ExternalChecksPropagatePermissions()) |
@@ -1112,20 +1111,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
1112 | destTaskItem.Name = srcTaskItem.Name; | 1111 | destTaskItem.Name = srcTaskItem.Name; |
1113 | destTaskItem.InvType = srcTaskItem.InvType; | 1112 | destTaskItem.InvType = srcTaskItem.InvType; |
1114 | destTaskItem.Type = srcTaskItem.Type; | 1113 | destTaskItem.Type = srcTaskItem.Type; |
1115 | 1114 | ||
1116 | destPart.AddInventoryItem(destTaskItem); | 1115 | destPart.AddInventoryItem(destTaskItem); |
1117 | 1116 | ||
1118 | if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 1117 | if ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1119 | part.RemoveInventoryItem(itemId); | 1118 | part.RemoveInventoryItem(itemId); |
1120 | 1119 | ||
1121 | ScenePresence avatar; | 1120 | ScenePresence avatar; |
1122 | 1121 | ||
1123 | if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) | 1122 | if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) |
1124 | { | 1123 | { |
1125 | destPart.GetProperties(avatar.ControllingClient); | 1124 | destPart.GetProperties(avatar.ControllingClient); |
1126 | } | 1125 | } |
1127 | } | 1126 | } |
1128 | 1127 | ||
1129 | public void MoveTaskInventoryItems(LLUUID destID, string category, SceneObjectPart host, List<LLUUID> items) | 1128 | public void MoveTaskInventoryItems(LLUUID destID, string category, SceneObjectPart host, List<LLUUID> items) |
1130 | { | 1129 | { |
1131 | CachedUserInfo profile = CommsManager.UserProfileCacheService.GetUserDetails(destID); | 1130 | CachedUserInfo profile = CommsManager.UserProfileCacheService.GetUserDetails(destID); |
@@ -1139,7 +1138,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1139 | } | 1138 | } |
1140 | 1139 | ||
1141 | LLUUID newFolderID = LLUUID.Random(); | 1140 | LLUUID newFolderID = LLUUID.Random(); |
1142 | 1141 | ||
1143 | profile.CreateFolder(category, newFolderID, 0xffff, profile.RootFolder.ID); | 1142 | profile.CreateFolder(category, newFolderID, 0xffff, profile.RootFolder.ID); |
1144 | 1143 | ||
1145 | foreach (LLUUID itemID in items) | 1144 | foreach (LLUUID itemID in items) |
@@ -1346,7 +1345,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1346 | 1345 | ||
1347 | part.AddInventoryItem(taskItem); | 1346 | part.AddInventoryItem(taskItem); |
1348 | part.GetProperties(remoteClient); | 1347 | part.GetProperties(remoteClient); |
1349 | 1348 | ||
1350 | part.CreateScriptInstance(taskItem, 0, false); | 1349 | part.CreateScriptInstance(taskItem, 0, false); |
1351 | } | 1350 | } |
1352 | } | 1351 | } |
@@ -1370,7 +1369,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1370 | 1369 | ||
1371 | return; | 1370 | return; |
1372 | } | 1371 | } |
1373 | 1372 | ||
1374 | SceneObjectPart destPart = GetSceneObjectPart(destId); | 1373 | SceneObjectPart destPart = GetSceneObjectPart(destId); |
1375 | 1374 | ||
1376 | if (destPart == null) | 1375 | if (destPart == null) |
@@ -1381,7 +1380,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1381 | destId); | 1380 | destId); |
1382 | return; | 1381 | return; |
1383 | } | 1382 | } |
1384 | 1383 | ||
1385 | // Must own the object, and have modify rights | 1384 | // Must own the object, and have modify rights |
1386 | if (srcPart.OwnerID != destPart.OwnerID) | 1385 | if (srcPart.OwnerID != destPart.OwnerID) |
1387 | return; | 1386 | return; |
@@ -1395,14 +1394,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
1395 | "[PRIM INVENTORY]: " + | 1394 | "[PRIM INVENTORY]: " + |
1396 | "Script in object {0} : {1}, attempted to load script {2} : {3} into object {4} : {5} with invalid pin {6}", | 1395 | "Script in object {0} : {1}, attempted to load script {2} : {3} into object {4} : {5} with invalid pin {6}", |
1397 | srcPart.Name, srcId, srcTaskItem.Name, srcTaskItem.ItemID, destPart.Name, destId, pin); | 1396 | srcPart.Name, srcId, srcTaskItem.Name, srcTaskItem.ItemID, destPart.Name, destId, pin); |
1398 | // the LSL Wiki says we are supposed to shout on the DEBUG_CHANNEL - | 1397 | // the LSL Wiki says we are supposed to shout on the DEBUG_CHANNEL - |
1399 | // "Object: Task Object trying to illegally load script onto task Other_Object!" | 1398 | // "Object: Task Object trying to illegally load script onto task Other_Object!" |
1400 | // How do we shout from in here? | 1399 | // How do we shout from in here? |
1401 | return; | 1400 | return; |
1402 | } | 1401 | } |
1403 | 1402 | ||
1404 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); | 1403 | TaskInventoryItem destTaskItem = new TaskInventoryItem(); |
1405 | 1404 | ||
1406 | destTaskItem.ItemID = LLUUID.Random(); | 1405 | destTaskItem.ItemID = LLUUID.Random(); |
1407 | destTaskItem.CreatorID = srcTaskItem.CreatorID; | 1406 | destTaskItem.CreatorID = srcTaskItem.CreatorID; |
1408 | destTaskItem.AssetID = srcTaskItem.AssetID; | 1407 | destTaskItem.AssetID = srcTaskItem.AssetID; |
@@ -1417,7 +1416,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1417 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; | 1416 | destTaskItem.CurrentPermissions = srcTaskItem.CurrentPermissions; |
1418 | destTaskItem.NextPermissions = srcTaskItem.NextPermissions; | 1417 | destTaskItem.NextPermissions = srcTaskItem.NextPermissions; |
1419 | destTaskItem.Flags = srcTaskItem.Flags; | 1418 | destTaskItem.Flags = srcTaskItem.Flags; |
1420 | 1419 | ||
1421 | if (destPart.OwnerID != srcPart.OwnerID) | 1420 | if (destPart.OwnerID != srcPart.OwnerID) |
1422 | { | 1421 | { |
1423 | if (ExternalChecks.ExternalChecksPropagatePermissions()) | 1422 | if (ExternalChecks.ExternalChecksPropagatePermissions()) |
@@ -1438,22 +1437,22 @@ namespace OpenSim.Region.Environment.Scenes | |||
1438 | destTaskItem.Name = srcTaskItem.Name; | 1437 | destTaskItem.Name = srcTaskItem.Name; |
1439 | destTaskItem.InvType = srcTaskItem.InvType; | 1438 | destTaskItem.InvType = srcTaskItem.InvType; |
1440 | destTaskItem.Type = srcTaskItem.Type; | 1439 | destTaskItem.Type = srcTaskItem.Type; |
1441 | 1440 | ||
1442 | destPart.AddInventoryItemExclusive(destTaskItem); | 1441 | destPart.AddInventoryItemExclusive(destTaskItem); |
1443 | 1442 | ||
1444 | if (running > 0) | 1443 | if (running > 0) |
1445 | { | 1444 | { |
1446 | destPart.CreateScriptInstance(destTaskItem, 0, false); | 1445 | destPart.CreateScriptInstance(destTaskItem, 0, false); |
1447 | } | 1446 | } |
1448 | 1447 | ||
1449 | ScenePresence avatar; | 1448 | ScenePresence avatar; |
1450 | 1449 | ||
1451 | if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) | 1450 | if (TryGetAvatar(srcTaskItem.OwnerID, out avatar)) |
1452 | { | 1451 | { |
1453 | destPart.GetProperties(avatar.ControllingClient); | 1452 | destPart.GetProperties(avatar.ControllingClient); |
1454 | } | 1453 | } |
1455 | } | 1454 | } |
1456 | 1455 | ||
1457 | /// <summary> | 1456 | /// <summary> |
1458 | /// Called when an object is removed from the environment into inventory. | 1457 | /// Called when an object is removed from the environment into inventory. |
1459 | /// </summary> | 1458 | /// </summary> |
@@ -1566,7 +1565,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1566 | private bool InventoryDeQueueAndDelete() | 1565 | private bool InventoryDeQueueAndDelete() |
1567 | { | 1566 | { |
1568 | DeleteToInventoryHolder x = null; | 1567 | DeleteToInventoryHolder x = null; |
1569 | 1568 | ||
1570 | try | 1569 | try |
1571 | { | 1570 | { |
1572 | lock (m_inventoryDeletes) | 1571 | lock (m_inventoryDeletes) |
@@ -1580,13 +1579,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
1580 | return true; | 1579 | return true; |
1581 | } | 1580 | } |
1582 | } | 1581 | } |
1583 | } | 1582 | } |
1584 | catch(Exception e) | 1583 | catch(Exception e) |
1585 | { | 1584 | { |
1586 | // We can't put the object group details in here since the root part may have disappeared (which is where these sit). | 1585 | // We can't put the object group details in here since the root part may have disappeared (which is where these sit). |
1587 | // FIXME: This needs to be fixed. | 1586 | // FIXME: This needs to be fixed. |
1588 | m_log.ErrorFormat( | 1587 | m_log.ErrorFormat( |
1589 | "[AGENT INVENTORY]: Queued deletion of scene object to agent {0} {1} failed: {2}", | 1588 | "[AGENT INVENTORY]: Queued deletion of scene object to agent {0} {1} failed: {2}", |
1590 | (x != null ? x.remoteClient.Name : "unavailable"), (x != null ? x.remoteClient.AgentId : "unavailable"), e.ToString()); | 1589 | (x != null ? x.remoteClient.Name : "unavailable"), (x != null ? x.remoteClient.AgentId : "unavailable"), e.ToString()); |
1591 | } | 1590 | } |
1592 | 1591 | ||
@@ -1745,7 +1744,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1745 | } | 1744 | } |
1746 | } | 1745 | } |
1747 | } | 1746 | } |
1748 | 1747 | ||
1749 | AssetBase asset = CreateAsset( | 1748 | AssetBase asset = CreateAsset( |
1750 | objectGroup.GetPartName(objectGroup.LocalId), | 1749 | objectGroup.GetPartName(objectGroup.LocalId), |
1751 | objectGroup.GetPartDescription(objectGroup.LocalId), | 1750 | objectGroup.GetPartDescription(objectGroup.LocalId), |
@@ -1792,7 +1791,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1792 | } | 1791 | } |
1793 | } | 1792 | } |
1794 | } | 1793 | } |
1795 | 1794 | ||
1796 | public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId) | 1795 | public LLUUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, LLUUID AgentId) |
1797 | { | 1796 | { |
1798 | SceneObjectGroup objectGroup = grp; | 1797 | SceneObjectGroup objectGroup = grp; |
@@ -2057,7 +2056,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2057 | /// <param name="param"></param> | 2056 | /// <param name="param"></param> |
2058 | /// <returns></returns> | 2057 | /// <returns></returns> |
2059 | public virtual SceneObjectGroup RezObject( | 2058 | public virtual SceneObjectGroup RezObject( |
2060 | SceneObjectPart sourcePart, TaskInventoryItem item, | 2059 | SceneObjectPart sourcePart, TaskInventoryItem item, |
2061 | LLVector3 pos, LLQuaternion rot, LLVector3 vel, int param) | 2060 | LLVector3 pos, LLQuaternion rot, LLVector3 vel, int param) |
2062 | { | 2061 | { |
2063 | // Rez object | 2062 | // Rez object |
@@ -2142,10 +2141,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2142 | return rootPart.ParentGroup; | 2141 | return rootPart.ParentGroup; |
2143 | } | 2142 | } |
2144 | } | 2143 | } |
2145 | 2144 | ||
2146 | return null; | 2145 | return null; |
2147 | } | 2146 | } |
2148 | 2147 | ||
2149 | public virtual bool returnObjects(SceneObjectGroup[] returnobjects, LLUUID AgentId) | 2148 | public virtual bool returnObjects(SceneObjectGroup[] returnobjects, LLUUID AgentId) |
2150 | { | 2149 | { |
2151 | string message = ""; | 2150 | string message = ""; |
@@ -2218,7 +2217,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2218 | item.AssetType = asset.Type; | 2217 | item.AssetType = asset.Type; |
2219 | item.InvType = (int)InventoryType.Object; | 2218 | item.InvType = (int)InventoryType.Object; |
2220 | item.Folder = folderID; | 2219 | item.Folder = folderID; |
2221 | 2220 | ||
2222 | if ((AgentId != returnobjects[i].RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) | 2221 | if ((AgentId != returnobjects[i].RootPart.OwnerID) && ExternalChecks.ExternalChecksPropagatePermissions()) |
2223 | { | 2222 | { |
2224 | uint perms = returnobjects[i].GetEffectivePermissions(); | 2223 | uint perms = returnobjects[i].GetEffectivePermissions(); |