diff options
author | Dahlia Trimble | 2009-01-10 09:15:23 +0000 |
---|---|---|
committer | Dahlia Trimble | 2009-01-10 09:15:23 +0000 |
commit | 630ce5b26446883043aa5e6541a4550d0e918659 (patch) | |
tree | 5128485b0d8e94c96593b352a421623cbd053acb /OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |
parent | Include the changes from StrawBerryFride's patch to (diff) | |
download | opensim-SC-630ce5b26446883043aa5e6541a4550d0e918659.zip opensim-SC-630ce5b26446883043aa5e6541a4550d0e918659.tar.gz opensim-SC-630ce5b26446883043aa5e6541a4550d0e918659.tar.bz2 opensim-SC-630ce5b26446883043aa5e6541a4550d0e918659.tar.xz |
Revert progressive texture patch from r8001 until issues can be addressed
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 139 |
1 files changed, 70 insertions, 69 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index bcc0d19..a8387c4 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -31,6 +31,7 @@ using System.Reflection; | |||
31 | using System.Text; | 31 | using System.Text; |
32 | using System.Timers; | 32 | using System.Timers; |
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenMetaverse.Packets; | ||
34 | using log4net; | 35 | using log4net; |
35 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Communications.Cache; | 37 | using OpenSim.Framework.Communications.Cache; |
@@ -42,12 +43,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
42 | public partial class Scene | 43 | public partial class Scene |
43 | { | 44 | { |
44 | private static readonly ILog m_log | 45 | private static readonly ILog m_log |
45 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 47 | ||
47 | /// <summary> | 48 | /// <summary> |
48 | /// Allows asynchronous derezzing of objects from the scene into a client's inventory. | 49 | /// Allows asynchronous derezzing of objects from the scene into a client's inventory. |
49 | /// </summary> | 50 | /// </summary> |
50 | protected AsyncSceneObjectGroupDeleter m_asyncSceneObjectDeleter; | 51 | protected AsyncSceneObjectGroupDeleter m_asyncSceneObjectDeleter; |
51 | 52 | ||
52 | /// <summary> | 53 | /// <summary> |
53 | /// Start all the scripts in the scene which should be started. | 54 | /// Start all the scripts in the scene which should be started. |
@@ -60,14 +61,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
60 | { | 61 | { |
61 | if (group is SceneObjectGroup) | 62 | if (group is SceneObjectGroup) |
62 | { | 63 | { |
63 | ((SceneObjectGroup) group).CreateScriptInstances(0, false, DefaultScriptEngine, 0); | 64 | ((SceneObjectGroup)group).CreateScriptInstances(0, false, DefaultScriptEngine, 0); |
64 | } | 65 | } |
65 | } | 66 | } |
66 | } | 67 | } |
67 | 68 | ||
68 | public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item) | 69 | public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item) |
69 | { | 70 | { |
70 | IMoneyModule money=RequestModuleInterface<IMoneyModule>(); | 71 | IMoneyModule money = RequestModuleInterface<IMoneyModule>(); |
71 | if (money != null) | 72 | if (money != null) |
72 | { | 73 | { |
73 | money.ApplyUploadCharge(agentID); | 74 | money.ApplyUploadCharge(agentID); |
@@ -145,9 +146,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
145 | else | 146 | else |
146 | { | 147 | { |
147 | m_log.ErrorFormat( | 148 | m_log.ErrorFormat( |
148 | "[AGENT INVENTORY]: Could not resolve user {0} for adding an inventory item", | 149 | "[AGENT INVENTORY]: Could not resolve user {0} for adding an inventory item", |
149 | remoteClient.AgentId); | 150 | remoteClient.AgentId); |
150 | } | 151 | } |
151 | } | 152 | } |
152 | 153 | ||
153 | /// <summary> | 154 | /// <summary> |
@@ -175,7 +176,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
175 | remoteClient.SendAgentAlertMessage("Insufficient permissions to edit notecard", false); | 176 | remoteClient.SendAgentAlertMessage("Insufficient permissions to edit notecard", false); |
176 | return UUID.Zero; | 177 | return UUID.Zero; |
177 | } | 178 | } |
178 | 179 | ||
179 | remoteClient.SendAgentAlertMessage("Notecard saved", false); | 180 | remoteClient.SendAgentAlertMessage("Notecard saved", false); |
180 | } | 181 | } |
181 | else if ((InventoryType)item.InvType == InventoryType.LSL) | 182 | else if ((InventoryType)item.InvType == InventoryType.LSL) |
@@ -185,7 +186,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
185 | remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false); | 186 | remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false); |
186 | return UUID.Zero; | 187 | return UUID.Zero; |
187 | } | 188 | } |
188 | 189 | ||
189 | remoteClient.SendAgentAlertMessage("Script saved", false); | 190 | remoteClient.SendAgentAlertMessage("Script saved", false); |
190 | } | 191 | } |
191 | 192 | ||
@@ -204,10 +205,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
204 | else | 205 | else |
205 | { | 206 | { |
206 | m_log.ErrorFormat( | 207 | m_log.ErrorFormat( |
207 | "[AGENT INVENTORY]: Could not resolve user {0} for caps inventory update", | 208 | "[AGENT INVENTORY]: Could not resolve user {0} for caps inventory update", |
208 | remoteClient.AgentId); | 209 | remoteClient.AgentId); |
209 | } | 210 | } |
210 | 211 | ||
211 | return UUID.Zero; | 212 | return UUID.Zero; |
212 | } | 213 | } |
213 | 214 | ||
@@ -283,7 +284,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
283 | { | 284 | { |
284 | part.Inventory.RemoveScriptInstance(item.ItemID); | 285 | part.Inventory.RemoveScriptInstance(item.ItemID); |
285 | } | 286 | } |
286 | 287 | ||
287 | // Update item with new asset | 288 | // Update item with new asset |
288 | item.AssetID = asset.FullID; | 289 | item.AssetID = asset.FullID; |
289 | group.UpdateInventoryItem(item); | 290 | group.UpdateInventoryItem(item); |
@@ -335,9 +336,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
335 | /// <param name="name">The name of the updated item</param> | 336 | /// <param name="name">The name of the updated item</param> |
336 | /// <param name="description">The description of the updated item</param> | 337 | /// <param name="description">The description of the updated item</param> |
337 | /// <param name="nextOwnerMask">The permissions of the updated item</param> | 338 | /// <param name="nextOwnerMask">The permissions of the updated item</param> |
338 | /* public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, | 339 | /* public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, |
339 | UUID itemID, string name, string description, | 340 | UUID itemID, string name, string description, |
340 | uint nextOwnerMask)*/ | 341 | uint nextOwnerMask)*/ |
341 | public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, | 342 | public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, |
342 | UUID itemID, InventoryItemBase itemUpd) | 343 | UUID itemID, InventoryItemBase itemUpd) |
343 | { | 344 | { |
@@ -426,7 +427,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
426 | { | 427 | { |
427 | return GiveInventoryItem(recipient, senderId, itemId, UUID.Zero); | 428 | return GiveInventoryItem(recipient, senderId, itemId, UUID.Zero); |
428 | } | 429 | } |
429 | 430 | ||
430 | /// <summary> | 431 | /// <summary> |
431 | /// Give an inventory item from one user to another | 432 | /// Give an inventory item from one user to another |
432 | /// </summary> | 433 | /// </summary> |
@@ -485,7 +486,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
485 | itemCopy.AssetType = item.AssetType; | 486 | itemCopy.AssetType = item.AssetType; |
486 | itemCopy.InvType = item.InvType; | 487 | itemCopy.InvType = item.InvType; |
487 | itemCopy.Folder = recipientFolderId; | 488 | itemCopy.Folder = recipientFolderId; |
488 | 489 | ||
489 | if (Permissions.PropagatePermissions()) | 490 | if (Permissions.PropagatePermissions()) |
490 | { | 491 | { |
491 | if (item.InvType == 6) | 492 | if (item.InvType == 6) |
@@ -502,7 +503,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
502 | if ((item.CurrentPermissions & 8) != 0) // Propagate slam bit | 503 | if ((item.CurrentPermissions & 8) != 0) // Propagate slam bit |
503 | { | 504 | { |
504 | itemCopy.CurrentPermissions = item.NextPermissions; | 505 | itemCopy.CurrentPermissions = item.NextPermissions; |
505 | itemCopy.BasePermissions=itemCopy.CurrentPermissions; | 506 | itemCopy.BasePermissions = itemCopy.CurrentPermissions; |
506 | itemCopy.CurrentPermissions |= 8; | 507 | itemCopy.CurrentPermissions |= 8; |
507 | } | 508 | } |
508 | 509 | ||
@@ -557,10 +558,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
557 | m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemId.ToString() + ", no root folder"); | 558 | m_log.Error("[AGENT INVENTORY]: Failed to find item " + itemId.ToString() + ", no root folder"); |
558 | return null; | 559 | return null; |
559 | } | 560 | } |
560 | 561 | ||
561 | return null; | 562 | return null; |
562 | } | 563 | } |
563 | 564 | ||
564 | /// <summary> | 565 | /// <summary> |
565 | /// Give an entire inventory folder from one user to another. The entire contents (including all descendent | 566 | /// Give an entire inventory folder from one user to another. The entire contents (including all descendent |
566 | /// folders) is given. | 567 | /// folders) is given. |
@@ -588,24 +589,24 @@ namespace OpenSim.Region.Environment.Scenes | |||
588 | 589 | ||
589 | return null; | 590 | return null; |
590 | } | 591 | } |
591 | 592 | ||
592 | if (!senderUserInfo.HasReceivedInventory) | 593 | if (!senderUserInfo.HasReceivedInventory) |
593 | { | 594 | { |
594 | m_log.DebugFormat( | 595 | m_log.DebugFormat( |
595 | "[AGENT INVENTORY]: Could not give inventory folder - have not yet received inventory for {0}", | 596 | "[AGENT INVENTORY]: Could not give inventory folder - have not yet received inventory for {0}", |
596 | senderId); | 597 | senderId); |
597 | 598 | ||
598 | return null; | 599 | return null; |
599 | } | 600 | } |
600 | 601 | ||
601 | InventoryFolderImpl folder = senderUserInfo.RootFolder.FindFolder(folderId); | 602 | InventoryFolderImpl folder = senderUserInfo.RootFolder.FindFolder(folderId); |
602 | 603 | ||
603 | if (null == folder) | 604 | if (null == folder) |
604 | { | 605 | { |
605 | m_log.ErrorFormat( | 606 | m_log.ErrorFormat( |
606 | "[AGENT INVENTORY]: Could not find inventory folder {0} to give", folderId); | 607 | "[AGENT INVENTORY]: Could not find inventory folder {0} to give", folderId); |
607 | 608 | ||
608 | return null; | 609 | return null; |
609 | } | 610 | } |
610 | 611 | ||
611 | CachedUserInfo recipientUserInfo | 612 | CachedUserInfo recipientUserInfo |
@@ -618,30 +619,30 @@ namespace OpenSim.Region.Environment.Scenes | |||
618 | 619 | ||
619 | return null; | 620 | return null; |
620 | } | 621 | } |
621 | 622 | ||
622 | if (recipientParentFolderId == UUID.Zero) | 623 | if (recipientParentFolderId == UUID.Zero) |
623 | recipientParentFolderId = recipientUserInfo.RootFolder.ID; | 624 | recipientParentFolderId = recipientUserInfo.RootFolder.ID; |
624 | 625 | ||
625 | UUID newFolderId = UUID.Random(); | 626 | UUID newFolderId = UUID.Random(); |
626 | recipientUserInfo.CreateFolder(folder.Name, newFolderId, (ushort)folder.Type, recipientParentFolderId); | 627 | recipientUserInfo.CreateFolder(folder.Name, newFolderId, (ushort)folder.Type, recipientParentFolderId); |
627 | 628 | ||
628 | // XXX: Messy - we should really get this back in the CreateFolder call | 629 | // XXX: Messy - we should really get this back in the CreateFolder call |
629 | InventoryFolderImpl copiedFolder = recipientUserInfo.RootFolder.FindFolder(newFolderId); | 630 | InventoryFolderImpl copiedFolder = recipientUserInfo.RootFolder.FindFolder(newFolderId); |
630 | 631 | ||
631 | // Give all the subfolders | 632 | // Give all the subfolders |
632 | List<InventoryFolderImpl> subFolders = folder.RequestListOfFolderImpls(); | 633 | List<InventoryFolderImpl> subFolders = folder.RequestListOfFolderImpls(); |
633 | foreach (InventoryFolderImpl childFolder in subFolders) | 634 | foreach (InventoryFolderImpl childFolder in subFolders) |
634 | { | 635 | { |
635 | GiveInventoryFolder(recipientId, senderId, childFolder.ID, copiedFolder.ID); | 636 | GiveInventoryFolder(recipientId, senderId, childFolder.ID, copiedFolder.ID); |
636 | } | 637 | } |
637 | 638 | ||
638 | // Give all the items | 639 | // Give all the items |
639 | List<InventoryItemBase> items = folder.RequestListOfItems(); | 640 | List<InventoryItemBase> items = folder.RequestListOfItems(); |
640 | foreach (InventoryItemBase item in items) | 641 | foreach (InventoryItemBase item in items) |
641 | { | 642 | { |
642 | GiveInventoryItem(recipientId, senderId, item.ID, copiedFolder.ID); | 643 | GiveInventoryItem(recipientId, senderId, item.ID, copiedFolder.ID); |
643 | } | 644 | } |
644 | 645 | ||
645 | return copiedFolder; | 646 | return copiedFolder; |
646 | } | 647 | } |
647 | 648 | ||
@@ -879,7 +880,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
879 | 880 | ||
880 | if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) | 881 | if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) |
881 | return; | 882 | return; |
882 | 883 | ||
883 | if (transactionID == UUID.Zero) | 884 | if (transactionID == UUID.Zero) |
884 | { | 885 | { |
885 | CachedUserInfo userInfo | 886 | CachedUserInfo userInfo |
@@ -890,7 +891,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
890 | ScenePresence presence; | 891 | ScenePresence presence; |
891 | TryGetAvatar(remoteClient.AgentId, out presence); | 892 | TryGetAvatar(remoteClient.AgentId, out presence); |
892 | byte[] data = null; | 893 | byte[] data = null; |
893 | 894 | ||
894 | if (invType == 3 && presence != null) // OpenMetaverse.asset.assettype.landmark = 3 - needs to be turned into an enum | 895 | if (invType == 3 && presence != null) // OpenMetaverse.asset.assettype.landmark = 3 - needs to be turned into an enum |
895 | { | 896 | { |
896 | Vector3 pos = presence.AbsolutePosition; | 897 | Vector3 pos = presence.AbsolutePosition; |
@@ -989,8 +990,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
989 | { | 990 | { |
990 | if (ent is SceneObjectGroup) | 991 | if (ent is SceneObjectGroup) |
991 | { | 992 | { |
992 | if (((SceneObjectGroup) ent).HasChildPrim(localID)) | 993 | if (((SceneObjectGroup)ent).HasChildPrim(localID)) |
993 | return (SceneObjectGroup) ent; | 994 | return (SceneObjectGroup)ent; |
994 | } | 995 | } |
995 | } | 996 | } |
996 | return null; | 997 | return null; |
@@ -1425,7 +1426,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1425 | } | 1426 | } |
1426 | } | 1427 | } |
1427 | else // Updating existing item with new perms etc | 1428 | else // Updating existing item with new perms etc |
1428 | { | 1429 | { |
1429 | IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); | 1430 | IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); |
1430 | if (agentTransactions != null) | 1431 | if (agentTransactions != null) |
1431 | { | 1432 | { |
@@ -1507,7 +1508,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1507 | } | 1508 | } |
1508 | } | 1509 | } |
1509 | else // script has been rezzed directly into a prim's inventory | 1510 | else // script has been rezzed directly into a prim's inventory |
1510 | { | 1511 | { |
1511 | SceneObjectPart part = GetSceneObjectPart(itemBase.Folder); | 1512 | SceneObjectPart part = GetSceneObjectPart(itemBase.Folder); |
1512 | if (part == null) | 1513 | if (part == null) |
1513 | return; | 1514 | return; |
@@ -1517,10 +1518,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
1517 | 1518 | ||
1518 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) | 1519 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) |
1519 | return; | 1520 | return; |
1520 | 1521 | ||
1521 | if (!Permissions.CanCreateObjectInventory( | 1522 | if (!Permissions.CanCreateObjectInventory( |
1522 | itemBase.InvType, part.UUID, remoteClient.AgentId)) | 1523 | itemBase.InvType, part.UUID, remoteClient.AgentId)) |
1523 | return; | 1524 | return; |
1524 | 1525 | ||
1525 | 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}")); | 1526 | 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}")); |
1526 | AssetCache.AddAsset(asset); | 1527 | AssetCache.AddAsset(asset); |
@@ -1733,7 +1734,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1733 | grp.UUID, | 1734 | grp.UUID, |
1734 | remoteClient.AgentId); | 1735 | remoteClient.AgentId); |
1735 | permissionToDelete = permissionToTake; | 1736 | permissionToDelete = permissionToTake; |
1736 | 1737 | ||
1737 | if (permissionToDelete) | 1738 | if (permissionToDelete) |
1738 | { | 1739 | { |
1739 | AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return"); | 1740 | AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return"); |
@@ -1803,7 +1804,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1803 | // | 1804 | // |
1804 | CachedUserInfo userInfo; | 1805 | CachedUserInfo userInfo; |
1805 | 1806 | ||
1806 | if (action == DeRezAction.Take || action == DeRezAction.TakeCopy || | 1807 | if (action == DeRezAction.Take || action == DeRezAction.TakeCopy || |
1807 | action == DeRezAction.SaveToExistingUserInventoryItem) | 1808 | action == DeRezAction.SaveToExistingUserInventoryItem) |
1808 | { | 1809 | { |
1809 | // Take or take copy require a taker | 1810 | // Take or take copy require a taker |
@@ -1846,18 +1847,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
1846 | // | 1847 | // |
1847 | 1848 | ||
1848 | InventoryFolderBase folder = null; | 1849 | InventoryFolderBase folder = null; |
1849 | InventoryItemBase item = null; | 1850 | InventoryItemBase item = null; |
1850 | 1851 | ||
1851 | if (DeRezAction.SaveToExistingUserInventoryItem == action) | 1852 | if (DeRezAction.SaveToExistingUserInventoryItem == action) |
1852 | { | 1853 | { |
1853 | item = userInfo.RootFolder.FindItem( | 1854 | item = userInfo.RootFolder.FindItem( |
1854 | objectGroup.RootPart.FromUserInventoryItemID); | 1855 | objectGroup.RootPart.FromUserInventoryItemID); |
1855 | 1856 | ||
1856 | if (null == item) | 1857 | if (null == item) |
1857 | { | 1858 | { |
1858 | m_log.DebugFormat( | 1859 | m_log.DebugFormat( |
1859 | "[AGENT INVENTORY]: Object {0} {1} scheduled for save to inventory has already been deleted.", | 1860 | "[AGENT INVENTORY]: Object {0} {1} scheduled for save to inventory has already been deleted.", |
1860 | objectGroup.Name, objectGroup.UUID); | 1861 | objectGroup.Name, objectGroup.UUID); |
1861 | return UUID.Zero; | 1862 | return UUID.Zero; |
1862 | } | 1863 | } |
1863 | } | 1864 | } |
@@ -1936,7 +1937,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1936 | item.InvType = (int)InventoryType.Object; | 1937 | item.InvType = (int)InventoryType.Object; |
1937 | item.Folder = folder.ID; | 1938 | item.Folder = folder.ID; |
1938 | item.Owner = userInfo.UserProfile.ID; | 1939 | item.Owner = userInfo.UserProfile.ID; |
1939 | 1940 | ||
1940 | } | 1941 | } |
1941 | 1942 | ||
1942 | AssetBase asset = CreateAsset( | 1943 | AssetBase asset = CreateAsset( |
@@ -1946,10 +1947,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
1946 | Utils.StringToBytes(sceneObjectXml)); | 1947 | Utils.StringToBytes(sceneObjectXml)); |
1947 | AssetCache.AddAsset(asset); | 1948 | AssetCache.AddAsset(asset); |
1948 | assetID = asset.FullID; | 1949 | assetID = asset.FullID; |
1949 | 1950 | ||
1950 | if (DeRezAction.SaveToExistingUserInventoryItem == action) | 1951 | if (DeRezAction.SaveToExistingUserInventoryItem == action) |
1951 | { | 1952 | { |
1952 | item.AssetID = asset.FullID; | 1953 | item.AssetID = asset.FullID; |
1953 | userInfo.UpdateItem(item); | 1954 | userInfo.UpdateItem(item); |
1954 | } | 1955 | } |
1955 | else | 1956 | else |
@@ -1958,8 +1959,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1958 | 1959 | ||
1959 | if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && Permissions.PropagatePermissions()) | 1960 | if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && Permissions.PropagatePermissions()) |
1960 | { | 1961 | { |
1961 | uint perms=objectGroup.GetEffectivePermissions(); | 1962 | uint perms = objectGroup.GetEffectivePermissions(); |
1962 | uint nextPerms=(perms & 7) << 13; | 1963 | uint nextPerms = (perms & 7) << 13; |
1963 | if ((nextPerms & (uint)PermissionMask.Copy) == 0) | 1964 | if ((nextPerms & (uint)PermissionMask.Copy) == 0) |
1964 | perms &= ~(uint)PermissionMask.Copy; | 1965 | perms &= ~(uint)PermissionMask.Copy; |
1965 | if ((nextPerms & (uint)PermissionMask.Transfer) == 0) | 1966 | if ((nextPerms & (uint)PermissionMask.Transfer) == 0) |
@@ -1990,7 +1991,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1990 | item.AssetType = asset.Type; | 1991 | item.AssetType = asset.Type; |
1991 | 1992 | ||
1992 | userInfo.AddItem(item); | 1993 | userInfo.AddItem(item); |
1993 | 1994 | ||
1994 | if (remoteClient != null && item.Owner == remoteClient.AgentId) | 1995 | if (remoteClient != null && item.Owner == remoteClient.AgentId) |
1995 | { | 1996 | { |
1996 | remoteClient.SendInventoryItemCreateUpdate(item); | 1997 | remoteClient.SendInventoryItemCreateUpdate(item); |
@@ -2002,10 +2003,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2002 | { | 2003 | { |
2003 | notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item); | 2004 | notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item); |
2004 | } | 2005 | } |
2005 | } | 2006 | } |
2006 | } | 2007 | } |
2007 | } | 2008 | } |
2008 | 2009 | ||
2009 | return assetID; | 2010 | return assetID; |
2010 | } | 2011 | } |
2011 | 2012 | ||
@@ -2019,11 +2020,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
2019 | m_log.InfoFormat("[ATTACHMENT]: Save request for {0} which is unchanged", grp.UUID); | 2020 | m_log.InfoFormat("[ATTACHMENT]: Save request for {0} which is unchanged", grp.UUID); |
2020 | return; | 2021 | return; |
2021 | } | 2022 | } |
2022 | 2023 | ||
2023 | m_log.InfoFormat( | 2024 | m_log.InfoFormat( |
2024 | "[ATTACHMENT]: Updating asset for attachment {0}, attachpoint {1}", | 2025 | "[ATTACHMENT]: Updating asset for attachment {0}, attachpoint {1}", |
2025 | grp.UUID, grp.GetAttachmentPoint()); | 2026 | grp.UUID, grp.GetAttachmentPoint()); |
2026 | 2027 | ||
2027 | string sceneObjectXml = objectGroup.ToXmlString(); | 2028 | string sceneObjectXml = objectGroup.ToXmlString(); |
2028 | 2029 | ||
2029 | CachedUserInfo userInfo = | 2030 | CachedUserInfo userInfo = |
@@ -2213,7 +2214,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2213 | 2214 | ||
2214 | Vector3 pos = GetNewRezLocation( | 2215 | Vector3 pos = GetNewRezLocation( |
2215 | RayStart, RayEnd, RayTargetID, Quaternion.Identity, | 2216 | RayStart, RayEnd, RayTargetID, Quaternion.Identity, |
2216 | BypassRayCast, bRayEndIsIntersection,true,scale, false); | 2217 | BypassRayCast, bRayEndIsIntersection, true, scale, false); |
2217 | 2218 | ||
2218 | // Rez object | 2219 | // Rez object |
2219 | CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); | 2220 | CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); |
@@ -2235,20 +2236,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
2235 | if (rezAsset != null) | 2236 | if (rezAsset != null) |
2236 | { | 2237 | { |
2237 | UUID itemId = UUID.Zero; | 2238 | UUID itemId = UUID.Zero; |
2238 | 2239 | ||
2239 | // If we have permission to copy then link the rezzed object back to the user inventory | 2240 | // If we have permission to copy then link the rezzed object back to the user inventory |
2240 | // item that it came from. This allows us to enable 'save object to inventory' | 2241 | // item that it came from. This allows us to enable 'save object to inventory' |
2241 | if (!Permissions.BypassPermissions()) | 2242 | if (!Permissions.BypassPermissions()) |
2242 | { | 2243 | { |
2243 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == (uint)PermissionMask.Copy) | 2244 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == (uint)PermissionMask.Copy) |
2244 | { | 2245 | { |
2245 | itemId = item.ID; | 2246 | itemId = item.ID; |
2246 | } | 2247 | } |
2247 | } | 2248 | } |
2248 | 2249 | ||
2249 | string xmlData = Utils.BytesToString(rezAsset.Data); | 2250 | string xmlData = Utils.BytesToString(rezAsset.Data); |
2250 | SceneObjectGroup group = new SceneObjectGroup(itemId, xmlData, true); | 2251 | SceneObjectGroup group = new SceneObjectGroup(itemId, xmlData, true); |
2251 | 2252 | ||
2252 | if (!Permissions.CanRezObject( | 2253 | if (!Permissions.CanRezObject( |
2253 | group.Children.Count, remoteClient.AgentId, pos) | 2254 | group.Children.Count, remoteClient.AgentId, pos) |
2254 | && !attachment) | 2255 | && !attachment) |
@@ -2345,12 +2346,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
2345 | group.ClearPartAttachmentData(); | 2346 | group.ClearPartAttachmentData(); |
2346 | } | 2347 | } |
2347 | } | 2348 | } |
2348 | 2349 | ||
2349 | if (!attachment) | 2350 | if (!attachment) |
2350 | { | 2351 | { |
2351 | // Fire on_rez | 2352 | // Fire on_rez |
2352 | group.CreateScriptInstances(0, true, DefaultScriptEngine, 0); | 2353 | group.CreateScriptInstances(0, true, DefaultScriptEngine, 0); |
2353 | 2354 | ||
2354 | rootPart.ScheduleFullUpdate(); | 2355 | rootPart.ScheduleFullUpdate(); |
2355 | } | 2356 | } |
2356 | 2357 | ||
@@ -2489,7 +2490,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2489 | DeRezObject(null, grp.RootPart.LocalId, | 2490 | DeRezObject(null, grp.RootPart.LocalId, |
2490 | grp.RootPart.GroupID, DeRezAction.Return, UUID.Zero); | 2491 | grp.RootPart.GroupID, DeRezAction.Return, UUID.Zero); |
2491 | } | 2492 | } |
2492 | 2493 | ||
2493 | return true; | 2494 | return true; |
2494 | } | 2495 | } |
2495 | 2496 | ||
@@ -2621,7 +2622,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2621 | } | 2622 | } |
2622 | 2623 | ||
2623 | } | 2624 | } |
2624 | 2625 | ||
2625 | m_sceneGraph.DetachSingleAttachmentToInv(itemID, remoteClient); | 2626 | m_sceneGraph.DetachSingleAttachmentToInv(itemID, remoteClient); |
2626 | } | 2627 | } |
2627 | 2628 | ||