diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 184 |
1 files changed, 92 insertions, 92 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index 58ab058..cb9aee2 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -42,12 +42,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
42 | public partial class Scene | 42 | public partial class Scene |
43 | { | 43 | { |
44 | private static readonly ILog m_log | 44 | private static readonly ILog m_log |
45 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | /// <summary> | 47 | /// <summary> |
48 | /// Allows asynchronous derezzing of objects from the scene into a client's inventory. | 48 | /// Allows asynchronous derezzing of objects from the scene into a client's inventory. |
49 | /// </summary> | 49 | /// </summary> |
50 | protected AsyncSceneObjectGroupDeleter m_asyncSceneObjectDeleter; | 50 | protected AsyncSceneObjectGroupDeleter m_asyncSceneObjectDeleter; |
51 | 51 | ||
52 | /// <summary> | 52 | /// <summary> |
53 | /// Start all the scripts in the scene which should be started. | 53 | /// Start all the scripts in the scene which should be started. |
@@ -145,9 +145,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
145 | else | 145 | else |
146 | { | 146 | { |
147 | m_log.ErrorFormat( | 147 | m_log.ErrorFormat( |
148 | "[AGENT INVENTORY]: Could not resolve user {0} for adding an inventory item", | 148 | "[AGENT INVENTORY]: Could not resolve user {0} for adding an inventory item", |
149 | remoteClient.AgentId); | 149 | remoteClient.AgentId); |
150 | } | 150 | } |
151 | } | 151 | } |
152 | 152 | ||
153 | /// <summary> | 153 | /// <summary> |
@@ -175,7 +175,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
175 | remoteClient.SendAgentAlertMessage("Insufficient permissions to edit notecard", false); | 175 | remoteClient.SendAgentAlertMessage("Insufficient permissions to edit notecard", false); |
176 | return UUID.Zero; | 176 | return UUID.Zero; |
177 | } | 177 | } |
178 | 178 | ||
179 | remoteClient.SendAgentAlertMessage("Notecard saved", false); | 179 | remoteClient.SendAgentAlertMessage("Notecard saved", false); |
180 | } | 180 | } |
181 | else if ((InventoryType)item.InvType == InventoryType.LSL) | 181 | else if ((InventoryType)item.InvType == InventoryType.LSL) |
@@ -185,7 +185,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
185 | remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false); | 185 | remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false); |
186 | return UUID.Zero; | 186 | return UUID.Zero; |
187 | } | 187 | } |
188 | 188 | ||
189 | remoteClient.SendAgentAlertMessage("Script saved", false); | 189 | remoteClient.SendAgentAlertMessage("Script saved", false); |
190 | } | 190 | } |
191 | 191 | ||
@@ -193,21 +193,21 @@ namespace OpenSim.Region.Environment.Scenes | |||
193 | CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data); | 193 | CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data); |
194 | AssetCache.AddAsset(asset); | 194 | AssetCache.AddAsset(asset); |
195 | 195 | ||
196 | item.AssetID = asset.FullID; | 196 | item.AssetID = asset.Metadata.FullID; |
197 | userInfo.UpdateItem(item); | 197 | userInfo.UpdateItem(item); |
198 | 198 | ||
199 | // remoteClient.SendInventoryItemCreateUpdate(item); | 199 | // remoteClient.SendInventoryItemCreateUpdate(item); |
200 | return (asset.FullID); | 200 | return (asset.Metadata.FullID); |
201 | } | 201 | } |
202 | } | 202 | } |
203 | } | 203 | } |
204 | else | 204 | else |
205 | { | 205 | { |
206 | m_log.ErrorFormat( | 206 | m_log.ErrorFormat( |
207 | "[AGENT INVENTORY]: Could not resolve user {0} for caps inventory update", | 207 | "[AGENT INVENTORY]: Could not resolve user {0} for caps inventory update", |
208 | remoteClient.AgentId); | 208 | remoteClient.AgentId); |
209 | } | 209 | } |
210 | 210 | ||
211 | return UUID.Zero; | 211 | return UUID.Zero; |
212 | } | 212 | } |
213 | 213 | ||
@@ -283,9 +283,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
283 | { | 283 | { |
284 | part.Inventory.RemoveScriptInstance(item.ItemID); | 284 | part.Inventory.RemoveScriptInstance(item.ItemID); |
285 | } | 285 | } |
286 | 286 | ||
287 | // Update item with new asset | 287 | // Update item with new asset |
288 | item.AssetID = asset.FullID; | 288 | item.AssetID = asset.Metadata.FullID; |
289 | group.UpdateInventoryItem(item); | 289 | group.UpdateInventoryItem(item); |
290 | part.GetProperties(remoteClient); | 290 | part.GetProperties(remoteClient); |
291 | 291 | ||
@@ -406,7 +406,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
406 | /// </summary> | 406 | /// </summary> |
407 | /// <param name="recipientClient"></param> | 407 | /// <param name="recipientClient"></param> |
408 | /// <param name="senderId">ID of the sender of the item</param> | 408 | /// <param name="senderId">ID of the sender of the item</param> |
409 | /// <param name="itemId"></param> | 409 | /// <param name="itemId"></param> |
410 | public virtual void GiveInventoryItem(IClientAPI recipientClient, UUID senderId, UUID itemId) | 410 | public virtual void GiveInventoryItem(IClientAPI recipientClient, UUID senderId, UUID itemId) |
411 | { | 411 | { |
412 | InventoryItemBase itemCopy = GiveInventoryItem(recipientClient.AgentId, senderId, itemId); | 412 | InventoryItemBase itemCopy = GiveInventoryItem(recipientClient.AgentId, senderId, itemId); |
@@ -420,19 +420,19 @@ namespace OpenSim.Region.Environment.Scenes | |||
420 | /// </summary> | 420 | /// </summary> |
421 | /// <param name="recipient"></param> | 421 | /// <param name="recipient"></param> |
422 | /// <param name="senderId">ID of the sender of the item</param> | 422 | /// <param name="senderId">ID of the sender of the item</param> |
423 | /// <param name="itemId"></param> | 423 | /// <param name="itemId"></param> |
424 | /// <returns>The inventory item copy given, null if the give was unsuccessful</returns> | 424 | /// <returns>The inventory item copy given, null if the give was unsuccessful</returns> |
425 | public virtual InventoryItemBase GiveInventoryItem(UUID recipient, UUID senderId, UUID itemId) | 425 | public virtual InventoryItemBase GiveInventoryItem(UUID recipient, UUID senderId, UUID itemId) |
426 | { | 426 | { |
427 | return GiveInventoryItem(recipient, senderId, itemId, UUID.Zero); | 427 | return GiveInventoryItem(recipient, senderId, itemId, UUID.Zero); |
428 | } | 428 | } |
429 | 429 | ||
430 | /// <summary> | 430 | /// <summary> |
431 | /// Give an inventory item from one user to another | 431 | /// Give an inventory item from one user to another |
432 | /// </summary> | 432 | /// </summary> |
433 | /// <param name="recipient"></param> | 433 | /// <param name="recipient"></param> |
434 | /// <param name="senderId">ID of the sender of the item</param> | 434 | /// <param name="senderId">ID of the sender of the item</param> |
435 | /// <param name="itemId"></param> | 435 | /// <param name="itemId"></param> |
436 | /// <param name="recipientFolderId"> | 436 | /// <param name="recipientFolderId"> |
437 | /// The id of the folder in which the copy item should go. If UUID.Zero then the item is placed in the most | 437 | /// The id of the folder in which the copy item should go. If UUID.Zero then the item is placed in the most |
438 | /// appropriate default folder. | 438 | /// appropriate default folder. |
@@ -485,7 +485,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
485 | itemCopy.AssetType = item.AssetType; | 485 | itemCopy.AssetType = item.AssetType; |
486 | itemCopy.InvType = item.InvType; | 486 | itemCopy.InvType = item.InvType; |
487 | itemCopy.Folder = recipientFolderId; | 487 | itemCopy.Folder = recipientFolderId; |
488 | 488 | ||
489 | if (Permissions.PropagatePermissions()) | 489 | if (Permissions.PropagatePermissions()) |
490 | { | 490 | { |
491 | if (item.InvType == 6) | 491 | if (item.InvType == 6) |
@@ -557,19 +557,19 @@ namespace OpenSim.Region.Environment.Scenes | |||
557 | m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemId.ToString() + ", no root folder"); | 557 | m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemId.ToString() + ", no root folder"); |
558 | return null; | 558 | return null; |
559 | } | 559 | } |
560 | 560 | ||
561 | return null; | 561 | return null; |
562 | } | 562 | } |
563 | 563 | ||
564 | /// <summary> | 564 | /// <summary> |
565 | /// Give an entire inventory folder from one user to another. The entire contents (including all descendent | 565 | /// Give an entire inventory folder from one user to another. The entire contents (including all descendent |
566 | /// folders) is given. | 566 | /// folders) is given. |
567 | /// </summary> | 567 | /// </summary> |
568 | /// <param name="recipientId"></param> | 568 | /// <param name="recipientId"></param> |
569 | /// <param name="senderId">ID of the sender of the item</param> | 569 | /// <param name="senderId">ID of the sender of the item</param> |
570 | /// <param name="folderId"></param> | 570 | /// <param name="folderId"></param> |
571 | /// <param name="recipientParentFolderId"> | 571 | /// <param name="recipientParentFolderId"> |
572 | /// The id of the receipient folder in which the send folder should be placed. If UUID.Zero then the | 572 | /// The id of the receipient folder in which the send folder should be placed. If UUID.Zero then the |
573 | /// recipient folder is the root folder | 573 | /// recipient folder is the root folder |
574 | /// </param> | 574 | /// </param> |
575 | /// <returns> | 575 | /// <returns> |
@@ -588,24 +588,24 @@ namespace OpenSim.Region.Environment.Scenes | |||
588 | 588 | ||
589 | return null; | 589 | return null; |
590 | } | 590 | } |
591 | 591 | ||
592 | if (!senderUserInfo.HasReceivedInventory) | 592 | if (!senderUserInfo.HasReceivedInventory) |
593 | { | 593 | { |
594 | m_log.DebugFormat( | 594 | m_log.DebugFormat( |
595 | "[AGENT INVENTORY]: Could not give inventory folder - have not yet received inventory for {0}", | 595 | "[AGENT INVENTORY]: Could not give inventory folder - have not yet received inventory for {0}", |
596 | senderId); | 596 | senderId); |
597 | 597 | ||
598 | return null; | 598 | return null; |
599 | } | 599 | } |
600 | 600 | ||
601 | InventoryFolderImpl folder = senderUserInfo.RootFolder.FindFolder(folderId); | 601 | InventoryFolderImpl folder = senderUserInfo.RootFolder.FindFolder(folderId); |
602 | 602 | ||
603 | if (null == folder) | 603 | if (null == folder) |
604 | { | 604 | { |
605 | m_log.ErrorFormat( | 605 | m_log.ErrorFormat( |
606 | "[AGENT INVENTORY]: Could not find inventory folder {0} to give", folderId); | 606 | "[AGENT INVENTORY]: Could not find inventory folder {0} to give", folderId); |
607 | 607 | ||
608 | return null; | 608 | return null; |
609 | } | 609 | } |
610 | 610 | ||
611 | CachedUserInfo recipientUserInfo | 611 | CachedUserInfo recipientUserInfo |
@@ -618,30 +618,30 @@ namespace OpenSim.Region.Environment.Scenes | |||
618 | 618 | ||
619 | return null; | 619 | return null; |
620 | } | 620 | } |
621 | 621 | ||
622 | if (recipientParentFolderId == UUID.Zero) | 622 | if (recipientParentFolderId == UUID.Zero) |
623 | recipientParentFolderId = recipientUserInfo.RootFolder.ID; | 623 | recipientParentFolderId = recipientUserInfo.RootFolder.ID; |
624 | 624 | ||
625 | UUID newFolderId = UUID.Random(); | 625 | UUID newFolderId = UUID.Random(); |
626 | recipientUserInfo.CreateFolder(folder.Name, newFolderId, (ushort)folder.Type, recipientParentFolderId); | 626 | recipientUserInfo.CreateFolder(folder.Name, newFolderId, (ushort)folder.Type, recipientParentFolderId); |
627 | 627 | ||
628 | // XXX: Messy - we should really get this back in the CreateFolder call | 628 | // XXX: Messy - we should really get this back in the CreateFolder call |
629 | InventoryFolderImpl copiedFolder = recipientUserInfo.RootFolder.FindFolder(newFolderId); | 629 | InventoryFolderImpl copiedFolder = recipientUserInfo.RootFolder.FindFolder(newFolderId); |
630 | 630 | ||
631 | // Give all the subfolders | 631 | // Give all the subfolders |
632 | List<InventoryFolderImpl> subFolders = folder.RequestListOfFolderImpls(); | 632 | List<InventoryFolderImpl> subFolders = folder.RequestListOfFolderImpls(); |
633 | foreach (InventoryFolderImpl childFolder in subFolders) | 633 | foreach (InventoryFolderImpl childFolder in subFolders) |
634 | { | 634 | { |
635 | GiveInventoryFolder(recipientId, senderId, childFolder.ID, copiedFolder.ID); | 635 | GiveInventoryFolder(recipientId, senderId, childFolder.ID, copiedFolder.ID); |
636 | } | 636 | } |
637 | 637 | ||
638 | // Give all the items | 638 | // Give all the items |
639 | List<InventoryItemBase> items = folder.RequestListOfItems(); | 639 | List<InventoryItemBase> items = folder.RequestListOfItems(); |
640 | foreach (InventoryItemBase item in items) | 640 | foreach (InventoryItemBase item in items) |
641 | { | 641 | { |
642 | GiveInventoryItem(recipientId, senderId, item.ID, copiedFolder.ID); | 642 | GiveInventoryItem(recipientId, senderId, item.ID, copiedFolder.ID); |
643 | } | 643 | } |
644 | 644 | ||
645 | return copiedFolder; | 645 | return copiedFolder; |
646 | } | 646 | } |
647 | 647 | ||
@@ -688,7 +688,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
688 | { | 688 | { |
689 | if (newName != String.Empty) | 689 | if (newName != String.Empty) |
690 | { | 690 | { |
691 | asset.Name = newName; | 691 | asset.Metadata.Name = newName; |
692 | } | 692 | } |
693 | else | 693 | else |
694 | { | 694 | { |
@@ -728,10 +728,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
728 | private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data) | 728 | private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data) |
729 | { | 729 | { |
730 | AssetBase asset = new AssetBase(); | 730 | AssetBase asset = new AssetBase(); |
731 | asset.Name = name; | 731 | asset.Metadata.Name = name; |
732 | asset.Description = description; | 732 | asset.Metadata.Description = description; |
733 | asset.Type = assetType; | 733 | asset.Metadata.Type = assetType; |
734 | asset.FullID = UUID.Random(); | 734 | asset.Metadata.FullID = UUID.Random(); |
735 | asset.Data = (data == null) ? new byte[1] : data; | 735 | asset.Data = (data == null) ? new byte[1] : data; |
736 | 736 | ||
737 | return asset; | 737 | return asset; |
@@ -831,11 +831,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
831 | item.Owner = remoteClient.AgentId; | 831 | item.Owner = remoteClient.AgentId; |
832 | item.Creator = remoteClient.AgentId; | 832 | item.Creator = remoteClient.AgentId; |
833 | item.ID = UUID.Random(); | 833 | item.ID = UUID.Random(); |
834 | item.AssetID = asset.FullID; | 834 | item.AssetID = asset.Metadata.FullID; |
835 | item.Description = asset.Description; | 835 | item.Description = asset.Metadata.Description; |
836 | item.Name = name; | 836 | item.Name = name; |
837 | item.Flags = flags; | 837 | item.Flags = flags; |
838 | item.AssetType = asset.Type; | 838 | item.AssetType = asset.Metadata.Type; |
839 | item.InvType = invType; | 839 | item.InvType = invType; |
840 | item.Folder = folderID; | 840 | item.Folder = folderID; |
841 | item.CurrentPermissions = currentMask; | 841 | item.CurrentPermissions = currentMask; |
@@ -879,7 +879,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
879 | 879 | ||
880 | if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) | 880 | if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) |
881 | return; | 881 | return; |
882 | 882 | ||
883 | if (transactionID == UUID.Zero) | 883 | if (transactionID == UUID.Zero) |
884 | { | 884 | { |
885 | CachedUserInfo userInfo | 885 | CachedUserInfo userInfo |
@@ -890,7 +890,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
890 | ScenePresence presence; | 890 | ScenePresence presence; |
891 | TryGetAvatar(remoteClient.AgentId, out presence); | 891 | TryGetAvatar(remoteClient.AgentId, out presence); |
892 | byte[] data = null; | 892 | byte[] data = null; |
893 | 893 | ||
894 | if (invType == 3 && presence != null) // OpenMetaverse.asset.assettype.landmark = 3 - needs to be turned into an enum | 894 | if (invType == 3 && presence != null) // OpenMetaverse.asset.assettype.landmark = 3 - needs to be turned into an enum |
895 | { | 895 | { |
896 | Vector3 pos = presence.AbsolutePosition; | 896 | Vector3 pos = presence.AbsolutePosition; |
@@ -905,7 +905,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
905 | AssetBase asset = CreateAsset(name, description, assetType, data); | 905 | AssetBase asset = CreateAsset(name, description, assetType, data); |
906 | AssetCache.AddAsset(asset); | 906 | AssetCache.AddAsset(asset); |
907 | 907 | ||
908 | CreateNewInventoryItem(remoteClient, folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate); | 908 | CreateNewInventoryItem(remoteClient, folderID, asset.Metadata.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate); |
909 | } | 909 | } |
910 | else | 910 | else |
911 | { | 911 | { |
@@ -1429,7 +1429,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1429 | } | 1429 | } |
1430 | } | 1430 | } |
1431 | else // Updating existing item with new perms etc | 1431 | else // Updating existing item with new perms etc |
1432 | { | 1432 | { |
1433 | IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); | 1433 | IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); |
1434 | if (agentTransactions != null) | 1434 | if (agentTransactions != null) |
1435 | { | 1435 | { |
@@ -1511,7 +1511,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1511 | } | 1511 | } |
1512 | } | 1512 | } |
1513 | else // script has been rezzed directly into a prim's inventory | 1513 | else // script has been rezzed directly into a prim's inventory |
1514 | { | 1514 | { |
1515 | SceneObjectPart part = GetSceneObjectPart(itemBase.Folder); | 1515 | SceneObjectPart part = GetSceneObjectPart(itemBase.Folder); |
1516 | if (part == null) | 1516 | if (part == null) |
1517 | return; | 1517 | return; |
@@ -1521,10 +1521,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
1521 | 1521 | ||
1522 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) | 1522 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) |
1523 | return; | 1523 | return; |
1524 | 1524 | ||
1525 | if (!Permissions.CanCreateObjectInventory( | 1525 | if (!Permissions.CanCreateObjectInventory( |
1526 | itemBase.InvType, part.UUID, remoteClient.AgentId)) | 1526 | itemBase.InvType, part.UUID, remoteClient.AgentId)) |
1527 | return; | 1527 | return; |
1528 | 1528 | ||
1529 | 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}")); | 1529 | 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}")); |
1530 | AssetCache.AddAsset(asset); | 1530 | AssetCache.AddAsset(asset); |
@@ -1550,7 +1550,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1550 | taskItem.Flags = itemBase.Flags; | 1550 | taskItem.Flags = itemBase.Flags; |
1551 | taskItem.PermsGranter = UUID.Zero; | 1551 | taskItem.PermsGranter = UUID.Zero; |
1552 | taskItem.PermsMask = 0; | 1552 | taskItem.PermsMask = 0; |
1553 | taskItem.AssetID = asset.FullID; | 1553 | taskItem.AssetID = asset.Metadata.FullID; |
1554 | 1554 | ||
1555 | part.Inventory.AddInventoryItem(taskItem, false); | 1555 | part.Inventory.AddInventoryItem(taskItem, false); |
1556 | part.GetProperties(remoteClient); | 1556 | part.GetProperties(remoteClient); |
@@ -1737,7 +1737,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1737 | grp.UUID, | 1737 | grp.UUID, |
1738 | remoteClient.AgentId); | 1738 | remoteClient.AgentId); |
1739 | permissionToDelete = permissionToTake; | 1739 | permissionToDelete = permissionToTake; |
1740 | 1740 | ||
1741 | if (permissionToDelete) | 1741 | if (permissionToDelete) |
1742 | { | 1742 | { |
1743 | AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return"); | 1743 | AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return"); |
@@ -1794,8 +1794,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1794 | /// </summary> | 1794 | /// </summary> |
1795 | /// <param name="action"></param> | 1795 | /// <param name="action"></param> |
1796 | /// <param name="folderID"></param> | 1796 | /// <param name="folderID"></param> |
1797 | /// <param name="objectGroup"></param> | 1797 | /// <param name="objectGroup"></param> |
1798 | /// <param name="remoteClient"> </param> | 1798 | /// <param name="remoteClient"> </param> |
1799 | public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, | 1799 | public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, |
1800 | SceneObjectGroup objectGroup, IClientAPI remoteClient) | 1800 | SceneObjectGroup objectGroup, IClientAPI remoteClient) |
1801 | { | 1801 | { |
@@ -1807,7 +1807,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1807 | // | 1807 | // |
1808 | CachedUserInfo userInfo; | 1808 | CachedUserInfo userInfo; |
1809 | 1809 | ||
1810 | if (action == DeRezAction.Take || action == DeRezAction.TakeCopy || | 1810 | if (action == DeRezAction.Take || action == DeRezAction.TakeCopy || |
1811 | action == DeRezAction.SaveToExistingUserInventoryItem) | 1811 | action == DeRezAction.SaveToExistingUserInventoryItem) |
1812 | { | 1812 | { |
1813 | // Take or take copy require a taker | 1813 | // Take or take copy require a taker |
@@ -1850,25 +1850,25 @@ namespace OpenSim.Region.Environment.Scenes | |||
1850 | // | 1850 | // |
1851 | 1851 | ||
1852 | InventoryFolderBase folder = null; | 1852 | InventoryFolderBase folder = null; |
1853 | InventoryItemBase item = null; | 1853 | InventoryItemBase item = null; |
1854 | 1854 | ||
1855 | if (DeRezAction.SaveToExistingUserInventoryItem == action) | 1855 | if (DeRezAction.SaveToExistingUserInventoryItem == action) |
1856 | { | 1856 | { |
1857 | item = userInfo.RootFolder.FindItem( | 1857 | item = userInfo.RootFolder.FindItem( |
1858 | objectGroup.RootPart.FromUserInventoryItemID); | 1858 | objectGroup.RootPart.FromUserInventoryItemID); |
1859 | 1859 | ||
1860 | if (null == item) | 1860 | if (null == item) |
1861 | { | 1861 | { |
1862 | m_log.DebugFormat( | 1862 | m_log.DebugFormat( |
1863 | "[AGENT INVENTORY]: Object {0} {1} scheduled for save to inventory has already been deleted.", | 1863 | "[AGENT INVENTORY]: Object {0} {1} scheduled for save to inventory has already been deleted.", |
1864 | objectGroup.Name, objectGroup.UUID); | 1864 | objectGroup.Name, objectGroup.UUID); |
1865 | return UUID.Zero; | 1865 | return UUID.Zero; |
1866 | } | 1866 | } |
1867 | } | 1867 | } |
1868 | else | 1868 | else |
1869 | { | 1869 | { |
1870 | // Folder magic | 1870 | // Folder magic |
1871 | // | 1871 | // |
1872 | if (action == DeRezAction.Delete) | 1872 | if (action == DeRezAction.Delete) |
1873 | { | 1873 | { |
1874 | // Deleting someone else's item | 1874 | // Deleting someone else's item |
@@ -1940,7 +1940,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1940 | item.InvType = (int)InventoryType.Object; | 1940 | item.InvType = (int)InventoryType.Object; |
1941 | item.Folder = folder.ID; | 1941 | item.Folder = folder.ID; |
1942 | item.Owner = userInfo.UserProfile.ID; | 1942 | item.Owner = userInfo.UserProfile.ID; |
1943 | 1943 | ||
1944 | } | 1944 | } |
1945 | 1945 | ||
1946 | AssetBase asset = CreateAsset( | 1946 | AssetBase asset = CreateAsset( |
@@ -1949,16 +1949,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
1949 | (sbyte)AssetType.Object, | 1949 | (sbyte)AssetType.Object, |
1950 | Utils.StringToBytes(sceneObjectXml)); | 1950 | Utils.StringToBytes(sceneObjectXml)); |
1951 | AssetCache.AddAsset(asset); | 1951 | AssetCache.AddAsset(asset); |
1952 | assetID = asset.FullID; | 1952 | assetID = asset.Metadata.FullID; |
1953 | 1953 | ||
1954 | if (DeRezAction.SaveToExistingUserInventoryItem == action) | 1954 | if (DeRezAction.SaveToExistingUserInventoryItem == action) |
1955 | { | 1955 | { |
1956 | item.AssetID = asset.FullID; | 1956 | item.AssetID = asset.Metadata.FullID; |
1957 | userInfo.UpdateItem(item); | 1957 | userInfo.UpdateItem(item); |
1958 | } | 1958 | } |
1959 | else | 1959 | else |
1960 | { | 1960 | { |
1961 | item.AssetID = asset.FullID; | 1961 | item.AssetID = asset.Metadata.FullID; |
1962 | 1962 | ||
1963 | if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && Permissions.PropagatePermissions()) | 1963 | if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && Permissions.PropagatePermissions()) |
1964 | { | 1964 | { |
@@ -1991,12 +1991,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
1991 | 1991 | ||
1992 | // TODO: add the new fields (Flags, Sale info, etc) | 1992 | // TODO: add the new fields (Flags, Sale info, etc) |
1993 | item.CreationDate = Util.UnixTimeSinceEpoch(); | 1993 | item.CreationDate = Util.UnixTimeSinceEpoch(); |
1994 | item.Description = asset.Description; | 1994 | item.Description = asset.Metadata.Description; |
1995 | item.Name = asset.Name; | 1995 | item.Name = asset.Metadata.Name; |
1996 | item.AssetType = asset.Type; | 1996 | item.AssetType = asset.Metadata.Type; |
1997 | 1997 | ||
1998 | userInfo.AddItem(item); | 1998 | userInfo.AddItem(item); |
1999 | 1999 | ||
2000 | if (remoteClient != null && item.Owner == remoteClient.AgentId) | 2000 | if (remoteClient != null && item.Owner == remoteClient.AgentId) |
2001 | { | 2001 | { |
2002 | remoteClient.SendInventoryItemCreateUpdate(item); | 2002 | remoteClient.SendInventoryItemCreateUpdate(item); |
@@ -2008,10 +2008,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2008 | { | 2008 | { |
2009 | notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item); | 2009 | notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item); |
2010 | } | 2010 | } |
2011 | } | 2011 | } |
2012 | } | 2012 | } |
2013 | } | 2013 | } |
2014 | 2014 | ||
2015 | return assetID; | 2015 | return assetID; |
2016 | } | 2016 | } |
2017 | 2017 | ||
@@ -2025,11 +2025,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
2025 | m_log.InfoFormat("[ATTACHMENT]: Save request for {0} which is unchanged", grp.UUID); | 2025 | m_log.InfoFormat("[ATTACHMENT]: Save request for {0} which is unchanged", grp.UUID); |
2026 | return; | 2026 | return; |
2027 | } | 2027 | } |
2028 | 2028 | ||
2029 | m_log.InfoFormat( | 2029 | m_log.InfoFormat( |
2030 | "[ATTACHMENT]: Updating asset for attachment {0}, attachpoint {1}", | 2030 | "[ATTACHMENT]: Updating asset for attachment {0}, attachpoint {1}", |
2031 | grp.UUID, grp.GetAttachmentPoint()); | 2031 | grp.UUID, grp.GetAttachmentPoint()); |
2032 | 2032 | ||
2033 | string sceneObjectXml = objectGroup.ToXmlString(); | 2033 | string sceneObjectXml = objectGroup.ToXmlString(); |
2034 | 2034 | ||
2035 | CachedUserInfo userInfo = | 2035 | CachedUserInfo userInfo = |
@@ -2077,10 +2077,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2077 | Utils.StringToBytes(sceneObjectXml)); | 2077 | Utils.StringToBytes(sceneObjectXml)); |
2078 | AssetCache.AddAsset(asset); | 2078 | AssetCache.AddAsset(asset); |
2079 | 2079 | ||
2080 | item.AssetID = asset.FullID; | 2080 | item.AssetID = asset.Metadata.FullID; |
2081 | item.Description = asset.Description; | 2081 | item.Description = asset.Metadata.Description; |
2082 | item.Name = asset.Name; | 2082 | item.Name = asset.Metadata.Name; |
2083 | item.AssetType = asset.Type; | 2083 | item.AssetType = asset.Metadata.Type; |
2084 | item.InvType = (int)InventoryType.Object; | 2084 | item.InvType = (int)InventoryType.Object; |
2085 | item.Folder = foundFolder; | 2085 | item.Folder = foundFolder; |
2086 | 2086 | ||
@@ -2118,10 +2118,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2118 | item.Creator = grp.RootPart.CreatorID; | 2118 | item.Creator = grp.RootPart.CreatorID; |
2119 | item.Owner = remoteClient.AgentId; | 2119 | item.Owner = remoteClient.AgentId; |
2120 | item.ID = UUID.Random(); | 2120 | item.ID = UUID.Random(); |
2121 | item.AssetID = asset.FullID; | 2121 | item.AssetID = asset.Metadata.FullID; |
2122 | item.Description = asset.Description; | 2122 | item.Description = asset.Metadata.Description; |
2123 | item.Name = asset.Name; | 2123 | item.Name = asset.Metadata.Name; |
2124 | item.AssetType = asset.Type; | 2124 | item.AssetType = asset.Metadata.Type; |
2125 | item.InvType = (int)InventoryType.Object; | 2125 | item.InvType = (int)InventoryType.Object; |
2126 | 2126 | ||
2127 | item.Folder = UUID.Zero; // Objects folder! | 2127 | item.Folder = UUID.Zero; // Objects folder! |
@@ -2241,20 +2241,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
2241 | if (rezAsset != null) | 2241 | if (rezAsset != null) |
2242 | { | 2242 | { |
2243 | UUID itemId = UUID.Zero; | 2243 | UUID itemId = UUID.Zero; |
2244 | 2244 | ||
2245 | // If we have permission to copy then link the rezzed object back to the user inventory | 2245 | // If we have permission to copy then link the rezzed object back to the user inventory |
2246 | // item that it came from. This allows us to enable 'save object to inventory' | 2246 | // item that it came from. This allows us to enable 'save object to inventory' |
2247 | if (!Permissions.BypassPermissions()) | 2247 | if (!Permissions.BypassPermissions()) |
2248 | { | 2248 | { |
2249 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == (uint)PermissionMask.Copy) | 2249 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == (uint)PermissionMask.Copy) |
2250 | { | 2250 | { |
2251 | itemId = item.ID; | 2251 | itemId = item.ID; |
2252 | } | 2252 | } |
2253 | } | 2253 | } |
2254 | 2254 | ||
2255 | string xmlData = Utils.BytesToString(rezAsset.Data); | 2255 | string xmlData = Utils.BytesToString(rezAsset.Data); |
2256 | SceneObjectGroup group = new SceneObjectGroup(itemId, xmlData, true); | 2256 | SceneObjectGroup group = new SceneObjectGroup(itemId, xmlData, true); |
2257 | 2257 | ||
2258 | if (!Permissions.CanRezObject( | 2258 | if (!Permissions.CanRezObject( |
2259 | group.Children.Count, remoteClient.AgentId, pos) | 2259 | group.Children.Count, remoteClient.AgentId, pos) |
2260 | && !attachment) | 2260 | && !attachment) |
@@ -2351,12 +2351,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
2351 | group.ClearPartAttachmentData(); | 2351 | group.ClearPartAttachmentData(); |
2352 | } | 2352 | } |
2353 | } | 2353 | } |
2354 | 2354 | ||
2355 | if (!attachment) | 2355 | if (!attachment) |
2356 | { | 2356 | { |
2357 | // Fire on_rez | 2357 | // Fire on_rez |
2358 | group.CreateScriptInstances(0, true, DefaultScriptEngine, 0); | 2358 | group.CreateScriptInstances(0, true, DefaultScriptEngine, 0); |
2359 | 2359 | ||
2360 | rootPart.ScheduleFullUpdate(); | 2360 | rootPart.ScheduleFullUpdate(); |
2361 | } | 2361 | } |
2362 | 2362 | ||
@@ -2500,7 +2500,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2500 | DeRezObject(null, grp.RootPart.LocalId, | 2500 | DeRezObject(null, grp.RootPart.LocalId, |
2501 | grp.RootPart.GroupID, DeRezAction.Return, UUID.Zero); | 2501 | grp.RootPart.GroupID, DeRezAction.Return, UUID.Zero); |
2502 | } | 2502 | } |
2503 | 2503 | ||
2504 | return true; | 2504 | return true; |
2505 | } | 2505 | } |
2506 | 2506 | ||
@@ -2632,7 +2632,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2632 | } | 2632 | } |
2633 | 2633 | ||
2634 | } | 2634 | } |
2635 | 2635 | ||
2636 | m_sceneGraph.DetachSingleAttachmentToInv(itemID, remoteClient); | 2636 | m_sceneGraph.DetachSingleAttachmentToInv(itemID, remoteClient); |
2637 | } | 2637 | } |
2638 | 2638 | ||