aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authorTeravus Ovares2009-01-19 17:11:57 +0000
committerTeravus Ovares2009-01-19 17:11:57 +0000
commit8e01f75784bd7b719a6957de40daf949eb01fcdf (patch)
tree4d1a703e7417093f7d75fc0f6f588e01b295ca9c /OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
parent* Remove unused prims.ParentID field from SQLite and MySQL (diff)
downloadopensim-SC-8e01f75784bd7b719a6957de40daf949eb01fcdf.zip
opensim-SC-8e01f75784bd7b719a6957de40daf949eb01fcdf.tar.gz
opensim-SC-8e01f75784bd7b719a6957de40daf949eb01fcdf.tar.bz2
opensim-SC-8e01f75784bd7b719a6957de40daf949eb01fcdf.tar.xz
* Progressive texture patch + PriorityQueue put into the LLClient namespace.
* Updates LibOMV to r2362
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs137
1 files changed, 68 insertions, 69 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 4db735a..ed299eb 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -31,7 +31,6 @@ using System.Reflection;
31using System.Text; 31using System.Text;
32using System.Timers; 32using System.Timers;
33using OpenMetaverse; 33using OpenMetaverse;
34using OpenMetaverse.Packets;
35using log4net; 34using log4net;
36using OpenSim.Framework; 35using OpenSim.Framework;
37using OpenSim.Framework.Communications.Cache; 36using OpenSim.Framework.Communications.Cache;
@@ -43,12 +42,12 @@ namespace OpenSim.Region.Environment.Scenes
43 public partial class Scene 42 public partial class Scene
44 { 43 {
45 private static readonly ILog m_log 44 private static readonly ILog m_log
46 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 46
48 /// <summary> 47 /// <summary>
49 /// 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.
50 /// </summary> 49 /// </summary>
51 protected AsyncSceneObjectGroupDeleter m_asyncSceneObjectDeleter; 50 protected AsyncSceneObjectGroupDeleter m_asyncSceneObjectDeleter;
52 51
53 /// <summary> 52 /// <summary>
54 /// Start all the scripts in the scene which should be started. 53 /// Start all the scripts in the scene which should be started.
@@ -61,14 +60,14 @@ namespace OpenSim.Region.Environment.Scenes
61 { 60 {
62 if (group is SceneObjectGroup) 61 if (group is SceneObjectGroup)
63 { 62 {
64 ((SceneObjectGroup)group).CreateScriptInstances(0, false, DefaultScriptEngine, 0); 63 ((SceneObjectGroup) group).CreateScriptInstances(0, false, DefaultScriptEngine, 0);
65 } 64 }
66 } 65 }
67 } 66 }
68 67
69 public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item) 68 public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item)
70 { 69 {
71 IMoneyModule money = RequestModuleInterface<IMoneyModule>(); 70 IMoneyModule money=RequestModuleInterface<IMoneyModule>();
72 if (money != null) 71 if (money != null)
73 { 72 {
74 money.ApplyUploadCharge(agentID); 73 money.ApplyUploadCharge(agentID);
@@ -146,9 +145,9 @@ namespace OpenSim.Region.Environment.Scenes
146 else 145 else
147 { 146 {
148 m_log.ErrorFormat( 147 m_log.ErrorFormat(
149 "[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",
150 remoteClient.AgentId); 149 remoteClient.AgentId);
151 } 150 }
152 } 151 }
153 152
154 /// <summary> 153 /// <summary>
@@ -176,7 +175,7 @@ namespace OpenSim.Region.Environment.Scenes
176 remoteClient.SendAgentAlertMessage("Insufficient permissions to edit notecard", false); 175 remoteClient.SendAgentAlertMessage("Insufficient permissions to edit notecard", false);
177 return UUID.Zero; 176 return UUID.Zero;
178 } 177 }
179 178
180 remoteClient.SendAgentAlertMessage("Notecard saved", false); 179 remoteClient.SendAgentAlertMessage("Notecard saved", false);
181 } 180 }
182 else if ((InventoryType)item.InvType == InventoryType.LSL) 181 else if ((InventoryType)item.InvType == InventoryType.LSL)
@@ -186,7 +185,7 @@ namespace OpenSim.Region.Environment.Scenes
186 remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false); 185 remoteClient.SendAgentAlertMessage("Insufficient permissions to edit script", false);
187 return UUID.Zero; 186 return UUID.Zero;
188 } 187 }
189 188
190 remoteClient.SendAgentAlertMessage("Script saved", false); 189 remoteClient.SendAgentAlertMessage("Script saved", false);
191 } 190 }
192 191
@@ -205,10 +204,10 @@ namespace OpenSim.Region.Environment.Scenes
205 else 204 else
206 { 205 {
207 m_log.ErrorFormat( 206 m_log.ErrorFormat(
208 "[AGENT INVENTORY]: Could not resolve user {0} for caps inventory update", 207 "[AGENT INVENTORY]: Could not resolve user {0} for caps inventory update",
209 remoteClient.AgentId); 208 remoteClient.AgentId);
210 } 209 }
211 210
212 return UUID.Zero; 211 return UUID.Zero;
213 } 212 }
214 213
@@ -284,7 +283,7 @@ namespace OpenSim.Region.Environment.Scenes
284 { 283 {
285 part.Inventory.RemoveScriptInstance(item.ItemID); 284 part.Inventory.RemoveScriptInstance(item.ItemID);
286 } 285 }
287 286
288 // Update item with new asset 287 // Update item with new asset
289 item.AssetID = asset.FullID; 288 item.AssetID = asset.FullID;
290 group.UpdateInventoryItem(item); 289 group.UpdateInventoryItem(item);
@@ -336,9 +335,9 @@ namespace OpenSim.Region.Environment.Scenes
336 /// <param name="name">The name of the updated item</param> 335 /// <param name="name">The name of the updated item</param>
337 /// <param name="description">The description of the updated item</param> 336 /// <param name="description">The description of the updated item</param>
338 /// <param name="nextOwnerMask">The permissions of the updated item</param> 337 /// <param name="nextOwnerMask">The permissions of the updated item</param>
339 /* public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, 338/* public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID,
340 UUID itemID, string name, string description, 339 UUID itemID, string name, string description,
341 uint nextOwnerMask)*/ 340 uint nextOwnerMask)*/
342 public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID, 341 public void UpdateInventoryItemAsset(IClientAPI remoteClient, UUID transactionID,
343 UUID itemID, InventoryItemBase itemUpd) 342 UUID itemID, InventoryItemBase itemUpd)
344 { 343 {
@@ -427,7 +426,7 @@ namespace OpenSim.Region.Environment.Scenes
427 { 426 {
428 return GiveInventoryItem(recipient, senderId, itemId, UUID.Zero); 427 return GiveInventoryItem(recipient, senderId, itemId, UUID.Zero);
429 } 428 }
430 429
431 /// <summary> 430 /// <summary>
432 /// Give an inventory item from one user to another 431 /// Give an inventory item from one user to another
433 /// </summary> 432 /// </summary>
@@ -486,7 +485,7 @@ namespace OpenSim.Region.Environment.Scenes
486 itemCopy.AssetType = item.AssetType; 485 itemCopy.AssetType = item.AssetType;
487 itemCopy.InvType = item.InvType; 486 itemCopy.InvType = item.InvType;
488 itemCopy.Folder = recipientFolderId; 487 itemCopy.Folder = recipientFolderId;
489 488
490 if (Permissions.PropagatePermissions()) 489 if (Permissions.PropagatePermissions())
491 { 490 {
492 if (item.InvType == 6) 491 if (item.InvType == 6)
@@ -558,10 +557,10 @@ namespace OpenSim.Region.Environment.Scenes
558 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");
559 return null; 558 return null;
560 } 559 }
561 560
562 return null; 561 return null;
563 } 562 }
564 563
565 /// <summary> 564 /// <summary>
566 /// 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
567 /// folders) is given. 566 /// folders) is given.
@@ -589,24 +588,24 @@ namespace OpenSim.Region.Environment.Scenes
589 588
590 return null; 589 return null;
591 } 590 }
592 591
593 if (!senderUserInfo.HasReceivedInventory) 592 if (!senderUserInfo.HasReceivedInventory)
594 { 593 {
595 m_log.DebugFormat( 594 m_log.DebugFormat(
596 "[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}",
597 senderId); 596 senderId);
598 597
599 return null; 598 return null;
600 } 599 }
601 600
602 InventoryFolderImpl folder = senderUserInfo.RootFolder.FindFolder(folderId); 601 InventoryFolderImpl folder = senderUserInfo.RootFolder.FindFolder(folderId);
603 602
604 if (null == folder) 603 if (null == folder)
605 { 604 {
606 m_log.ErrorFormat( 605 m_log.ErrorFormat(
607 "[AGENT INVENTORY]: Could not find inventory folder {0} to give", folderId); 606 "[AGENT INVENTORY]: Could not find inventory folder {0} to give", folderId);
608 607
609 return null; 608 return null;
610 } 609 }
611 610
612 CachedUserInfo recipientUserInfo 611 CachedUserInfo recipientUserInfo
@@ -619,30 +618,30 @@ namespace OpenSim.Region.Environment.Scenes
619 618
620 return null; 619 return null;
621 } 620 }
622 621
623 if (recipientParentFolderId == UUID.Zero) 622 if (recipientParentFolderId == UUID.Zero)
624 recipientParentFolderId = recipientUserInfo.RootFolder.ID; 623 recipientParentFolderId = recipientUserInfo.RootFolder.ID;
625 624
626 UUID newFolderId = UUID.Random(); 625 UUID newFolderId = UUID.Random();
627 recipientUserInfo.CreateFolder(folder.Name, newFolderId, (ushort)folder.Type, recipientParentFolderId); 626 recipientUserInfo.CreateFolder(folder.Name, newFolderId, (ushort)folder.Type, recipientParentFolderId);
628 627
629 // 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
630 InventoryFolderImpl copiedFolder = recipientUserInfo.RootFolder.FindFolder(newFolderId); 629 InventoryFolderImpl copiedFolder = recipientUserInfo.RootFolder.FindFolder(newFolderId);
631 630
632 // Give all the subfolders 631 // Give all the subfolders
633 List<InventoryFolderImpl> subFolders = folder.RequestListOfFolderImpls(); 632 List<InventoryFolderImpl> subFolders = folder.RequestListOfFolderImpls();
634 foreach (InventoryFolderImpl childFolder in subFolders) 633 foreach (InventoryFolderImpl childFolder in subFolders)
635 { 634 {
636 GiveInventoryFolder(recipientId, senderId, childFolder.ID, copiedFolder.ID); 635 GiveInventoryFolder(recipientId, senderId, childFolder.ID, copiedFolder.ID);
637 } 636 }
638 637
639 // Give all the items 638 // Give all the items
640 List<InventoryItemBase> items = folder.RequestListOfItems(); 639 List<InventoryItemBase> items = folder.RequestListOfItems();
641 foreach (InventoryItemBase item in items) 640 foreach (InventoryItemBase item in items)
642 { 641 {
643 GiveInventoryItem(recipientId, senderId, item.ID, copiedFolder.ID); 642 GiveInventoryItem(recipientId, senderId, item.ID, copiedFolder.ID);
644 } 643 }
645 644
646 return copiedFolder; 645 return copiedFolder;
647 } 646 }
648 647
@@ -880,7 +879,7 @@ namespace OpenSim.Region.Environment.Scenes
880 879
881 if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId)) 880 if (!Permissions.CanCreateUserInventory(invType, remoteClient.AgentId))
882 return; 881 return;
883 882
884 if (transactionID == UUID.Zero) 883 if (transactionID == UUID.Zero)
885 { 884 {
886 CachedUserInfo userInfo 885 CachedUserInfo userInfo
@@ -891,7 +890,7 @@ namespace OpenSim.Region.Environment.Scenes
891 ScenePresence presence; 890 ScenePresence presence;
892 TryGetAvatar(remoteClient.AgentId, out presence); 891 TryGetAvatar(remoteClient.AgentId, out presence);
893 byte[] data = null; 892 byte[] data = null;
894 893
895 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
896 { 895 {
897 Vector3 pos = presence.AbsolutePosition; 896 Vector3 pos = presence.AbsolutePosition;
@@ -990,8 +989,8 @@ namespace OpenSim.Region.Environment.Scenes
990 { 989 {
991 if (ent is SceneObjectGroup) 990 if (ent is SceneObjectGroup)
992 { 991 {
993 if (((SceneObjectGroup)ent).HasChildPrim(localID)) 992 if (((SceneObjectGroup) ent).HasChildPrim(localID))
994 return (SceneObjectGroup)ent; 993 return (SceneObjectGroup) ent;
995 } 994 }
996 } 995 }
997 return null; 996 return null;
@@ -1430,7 +1429,7 @@ namespace OpenSim.Region.Environment.Scenes
1430 } 1429 }
1431 } 1430 }
1432 else // Updating existing item with new perms etc 1431 else // Updating existing item with new perms etc
1433 { 1432 {
1434 IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>(); 1433 IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>();
1435 if (agentTransactions != null) 1434 if (agentTransactions != null)
1436 { 1435 {
@@ -1512,7 +1511,7 @@ namespace OpenSim.Region.Environment.Scenes
1512 } 1511 }
1513 } 1512 }
1514 else // script has been rezzed directly into a prim's inventory 1513 else // script has been rezzed directly into a prim's inventory
1515 { 1514 {
1516 SceneObjectPart part = GetSceneObjectPart(itemBase.Folder); 1515 SceneObjectPart part = GetSceneObjectPart(itemBase.Folder);
1517 if (part == null) 1516 if (part == null)
1518 return; 1517 return;
@@ -1522,10 +1521,10 @@ namespace OpenSim.Region.Environment.Scenes
1522 1521
1523 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) 1522 if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0)
1524 return; 1523 return;
1525 1524
1526 if (!Permissions.CanCreateObjectInventory( 1525 if (!Permissions.CanCreateObjectInventory(
1527 itemBase.InvType, part.UUID, remoteClient.AgentId)) 1526 itemBase.InvType, part.UUID, remoteClient.AgentId))
1528 return; 1527 return;
1529 1528
1530 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}"));
1531 AssetCache.AddAsset(asset); 1530 AssetCache.AddAsset(asset);
@@ -1738,7 +1737,7 @@ namespace OpenSim.Region.Environment.Scenes
1738 grp.UUID, 1737 grp.UUID,
1739 remoteClient.AgentId); 1738 remoteClient.AgentId);
1740 permissionToDelete = permissionToTake; 1739 permissionToDelete = permissionToTake;
1741 1740
1742 if (permissionToDelete) 1741 if (permissionToDelete)
1743 { 1742 {
1744 AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return"); 1743 AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return");
@@ -1808,7 +1807,7 @@ namespace OpenSim.Region.Environment.Scenes
1808 // 1807 //
1809 CachedUserInfo userInfo; 1808 CachedUserInfo userInfo;
1810 1809
1811 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy || 1810 if (action == DeRezAction.Take || action == DeRezAction.TakeCopy ||
1812 action == DeRezAction.SaveToExistingUserInventoryItem) 1811 action == DeRezAction.SaveToExistingUserInventoryItem)
1813 { 1812 {
1814 // Take or take copy require a taker 1813 // Take or take copy require a taker
@@ -1851,18 +1850,18 @@ namespace OpenSim.Region.Environment.Scenes
1851 // 1850 //
1852 1851
1853 InventoryFolderBase folder = null; 1852 InventoryFolderBase folder = null;
1854 InventoryItemBase item = null; 1853 InventoryItemBase item = null;
1855 1854
1856 if (DeRezAction.SaveToExistingUserInventoryItem == action) 1855 if (DeRezAction.SaveToExistingUserInventoryItem == action)
1857 { 1856 {
1858 item = userInfo.RootFolder.FindItem( 1857 item = userInfo.RootFolder.FindItem(
1859 objectGroup.RootPart.FromUserInventoryItemID); 1858 objectGroup.RootPart.FromUserInventoryItemID);
1860 1859
1861 if (null == item) 1860 if (null == item)
1862 { 1861 {
1863 m_log.DebugFormat( 1862 m_log.DebugFormat(
1864 "[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.",
1865 objectGroup.Name, objectGroup.UUID); 1864 objectGroup.Name, objectGroup.UUID);
1866 return UUID.Zero; 1865 return UUID.Zero;
1867 } 1866 }
1868 } 1867 }
@@ -1941,7 +1940,7 @@ namespace OpenSim.Region.Environment.Scenes
1941 item.InvType = (int)InventoryType.Object; 1940 item.InvType = (int)InventoryType.Object;
1942 item.Folder = folder.ID; 1941 item.Folder = folder.ID;
1943 item.Owner = userInfo.UserProfile.ID; 1942 item.Owner = userInfo.UserProfile.ID;
1944 1943
1945 } 1944 }
1946 1945
1947 AssetBase asset = CreateAsset( 1946 AssetBase asset = CreateAsset(
@@ -1951,10 +1950,10 @@ namespace OpenSim.Region.Environment.Scenes
1951 Utils.StringToBytes(sceneObjectXml)); 1950 Utils.StringToBytes(sceneObjectXml));
1952 AssetCache.AddAsset(asset); 1951 AssetCache.AddAsset(asset);
1953 assetID = asset.FullID; 1952 assetID = asset.FullID;
1954 1953
1955 if (DeRezAction.SaveToExistingUserInventoryItem == action) 1954 if (DeRezAction.SaveToExistingUserInventoryItem == action)
1956 { 1955 {
1957 item.AssetID = asset.FullID; 1956 item.AssetID = asset.FullID;
1958 userInfo.UpdateItem(item); 1957 userInfo.UpdateItem(item);
1959 } 1958 }
1960 else 1959 else
@@ -1963,8 +1962,8 @@ namespace OpenSim.Region.Environment.Scenes
1963 1962
1964 if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && Permissions.PropagatePermissions()) 1963 if (remoteClient != null && (remoteClient.AgentId != objectGroup.RootPart.OwnerID) && Permissions.PropagatePermissions())
1965 { 1964 {
1966 uint perms = objectGroup.GetEffectivePermissions(); 1965 uint perms=objectGroup.GetEffectivePermissions();
1967 uint nextPerms = (perms & 7) << 13; 1966 uint nextPerms=(perms & 7) << 13;
1968 if ((nextPerms & (uint)PermissionMask.Copy) == 0) 1967 if ((nextPerms & (uint)PermissionMask.Copy) == 0)
1969 perms &= ~(uint)PermissionMask.Copy; 1968 perms &= ~(uint)PermissionMask.Copy;
1970 if ((nextPerms & (uint)PermissionMask.Transfer) == 0) 1969 if ((nextPerms & (uint)PermissionMask.Transfer) == 0)
@@ -1997,7 +1996,7 @@ namespace OpenSim.Region.Environment.Scenes
1997 item.AssetType = asset.Type; 1996 item.AssetType = asset.Type;
1998 1997
1999 userInfo.AddItem(item); 1998 userInfo.AddItem(item);
2000 1999
2001 if (remoteClient != null && item.Owner == remoteClient.AgentId) 2000 if (remoteClient != null && item.Owner == remoteClient.AgentId)
2002 { 2001 {
2003 remoteClient.SendInventoryItemCreateUpdate(item); 2002 remoteClient.SendInventoryItemCreateUpdate(item);
@@ -2009,10 +2008,10 @@ namespace OpenSim.Region.Environment.Scenes
2009 { 2008 {
2010 notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item); 2009 notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item);
2011 } 2010 }
2012 } 2011 }
2013 } 2012 }
2014 } 2013 }
2015 2014
2016 return assetID; 2015 return assetID;
2017 } 2016 }
2018 2017
@@ -2026,11 +2025,11 @@ namespace OpenSim.Region.Environment.Scenes
2026 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);
2027 return; 2026 return;
2028 } 2027 }
2029 2028
2030 m_log.InfoFormat( 2029 m_log.InfoFormat(
2031 "[ATTACHMENT]: Updating asset for attachment {0}, attachpoint {1}", 2030 "[ATTACHMENT]: Updating asset for attachment {0}, attachpoint {1}",
2032 grp.UUID, grp.GetAttachmentPoint()); 2031 grp.UUID, grp.GetAttachmentPoint());
2033 2032
2034 string sceneObjectXml = objectGroup.ToXmlString(); 2033 string sceneObjectXml = objectGroup.ToXmlString();
2035 2034
2036 CachedUserInfo userInfo = 2035 CachedUserInfo userInfo =
@@ -2220,7 +2219,7 @@ namespace OpenSim.Region.Environment.Scenes
2220 2219
2221 Vector3 pos = GetNewRezLocation( 2220 Vector3 pos = GetNewRezLocation(
2222 RayStart, RayEnd, RayTargetID, Quaternion.Identity, 2221 RayStart, RayEnd, RayTargetID, Quaternion.Identity,
2223 BypassRayCast, bRayEndIsIntersection, true, scale, false); 2222 BypassRayCast, bRayEndIsIntersection,true,scale, false);
2224 2223
2225 // Rez object 2224 // Rez object
2226 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 2225 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
@@ -2242,20 +2241,20 @@ namespace OpenSim.Region.Environment.Scenes
2242 if (rezAsset != null) 2241 if (rezAsset != null)
2243 { 2242 {
2244 UUID itemId = UUID.Zero; 2243 UUID itemId = UUID.Zero;
2245 2244
2246 // 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
2247 // 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'
2248 if (!Permissions.BypassPermissions()) 2247 if (!Permissions.BypassPermissions())
2249 { 2248 {
2250 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == (uint)PermissionMask.Copy) 2249 if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == (uint)PermissionMask.Copy)
2251 { 2250 {
2252 itemId = item.ID; 2251 itemId = item.ID;
2253 } 2252 }
2254 } 2253 }
2255 2254
2256 string xmlData = Utils.BytesToString(rezAsset.Data); 2255 string xmlData = Utils.BytesToString(rezAsset.Data);
2257 SceneObjectGroup group = new SceneObjectGroup(itemId, xmlData, true); 2256 SceneObjectGroup group = new SceneObjectGroup(itemId, xmlData, true);
2258 2257
2259 if (!Permissions.CanRezObject( 2258 if (!Permissions.CanRezObject(
2260 group.Children.Count, remoteClient.AgentId, pos) 2259 group.Children.Count, remoteClient.AgentId, pos)
2261 && !attachment) 2260 && !attachment)
@@ -2352,12 +2351,12 @@ namespace OpenSim.Region.Environment.Scenes
2352 group.ClearPartAttachmentData(); 2351 group.ClearPartAttachmentData();
2353 } 2352 }
2354 } 2353 }
2355 2354
2356 if (!attachment) 2355 if (!attachment)
2357 { 2356 {
2358 // Fire on_rez 2357 // Fire on_rez
2359 group.CreateScriptInstances(0, true, DefaultScriptEngine, 0); 2358 group.CreateScriptInstances(0, true, DefaultScriptEngine, 0);
2360 2359
2361 rootPart.ScheduleFullUpdate(); 2360 rootPart.ScheduleFullUpdate();
2362 } 2361 }
2363 2362
@@ -2501,7 +2500,7 @@ namespace OpenSim.Region.Environment.Scenes
2501 DeRezObject(null, grp.RootPart.LocalId, 2500 DeRezObject(null, grp.RootPart.LocalId,
2502 grp.RootPart.GroupID, DeRezAction.Return, UUID.Zero); 2501 grp.RootPart.GroupID, DeRezAction.Return, UUID.Zero);
2503 } 2502 }
2504 2503
2505 return true; 2504 return true;
2506 } 2505 }
2507 2506
@@ -2633,7 +2632,7 @@ namespace OpenSim.Region.Environment.Scenes
2633 } 2632 }
2634 2633
2635 } 2634 }
2636 2635
2637 m_sceneGraph.DetachSingleAttachmentToInv(itemID, remoteClient); 2636 m_sceneGraph.DetachSingleAttachmentToInv(itemID, remoteClient);
2638 } 2637 }
2639 2638