aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-08-25 22:46:49 +0100
committerJustin Clark-Casey (justincc)2010-08-25 22:46:49 +0100
commit46c6c35d4868e4ff538bdc2c65a7fade936c0ce1 (patch)
tree39dc65383f6294205882bb7e51df5c9a420e053a /OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
parentTypo (diff)
downloadopensim-SC_OLD-46c6c35d4868e4ff538bdc2c65a7fade936c0ce1.zip
opensim-SC_OLD-46c6c35d4868e4ff538bdc2c65a7fade936c0ce1.tar.gz
opensim-SC_OLD-46c6c35d4868e4ff538bdc2c65a7fade936c0ce1.tar.bz2
opensim-SC_OLD-46c6c35d4868e4ff538bdc2c65a7fade936c0ce1.tar.xz
refactor: Push item retrieval and fixing part of Scene.RezObject() down into SceneObjectPartInventory
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs59
1 files changed, 6 insertions, 53 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 01be491..9fef8f4 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1969,60 +1969,13 @@ namespace OpenSim.Region.Framework.Scenes
1969 if (null == item) 1969 if (null == item)
1970 return null; 1970 return null;
1971 1971
1972 UUID ownerID = item.OwnerID; 1972 SceneObjectGroup group = sourcePart.Inventory.GetRezReadySceneObject(item);
1973 AssetBase rezAsset = AssetService.Get(item.AssetID.ToString()); 1973
1974 1974 if (null == group)
1975 if (null == rezAsset)
1976 return null;
1977
1978 string xmlData = Utils.BytesToString(rezAsset.Data);
1979 SceneObjectGroup group = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
1980
1981 if (!Permissions.CanRezObject(group.Children.Count, ownerID, pos))
1982 return null; 1975 return null;
1983
1984 group.ResetIDs();
1985
1986 SceneObjectPart rootPart = group.GetChildPart(group.UUID);
1987
1988 // Since renaming the item in the inventory does not affect the name stored
1989 // in the serialization, transfer the correct name from the inventory to the
1990 // object itself before we rez.
1991 rootPart.Name = item.Name;
1992 rootPart.Description = item.Description;
1993
1994 List<SceneObjectPart> partList = new List<SceneObjectPart>(group.Children.Values);
1995
1996 group.SetGroup(sourcePart.GroupID, null);
1997
1998 if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0)
1999 {
2000 if (Permissions.PropagatePermissions())
2001 {
2002 foreach (SceneObjectPart part in partList)
2003 {
2004 part.EveryoneMask = item.EveryonePermissions;
2005 part.NextOwnerMask = item.NextPermissions;
2006 }
2007
2008 group.ApplyNextOwnerPermissions();
2009 }
2010 }
2011
2012 foreach (SceneObjectPart part in partList)
2013 {
2014 if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0)
2015 {
2016 part.LastOwnerID = part.OwnerID;
2017 part.OwnerID = item.OwnerID;
2018 part.Inventory.ChangeInventoryOwner(item.OwnerID);
2019 }
2020
2021 part.EveryoneMask = item.EveryonePermissions;
2022 part.NextOwnerMask = item.NextPermissions;
2023 }
2024 1976
2025 rootPart.TrimPermissions(); 1977 if (!Permissions.CanRezObject(group.Children.Count, item.OwnerID, pos))
1978 return null;
2026 1979
2027 if (!Permissions.BypassPermissions()) 1980 if (!Permissions.BypassPermissions())
2028 { 1981 {
@@ -2038,7 +1991,7 @@ namespace OpenSim.Region.Framework.Scenes
2038 1991
2039 group.ScheduleGroupForFullUpdate(); 1992 group.ScheduleGroupForFullUpdate();
2040 1993
2041 return rootPart.ParentGroup; 1994 return group;
2042 } 1995 }
2043 1996
2044 public virtual bool returnObjects(SceneObjectGroup[] returnobjects, UUID AgentId) 1997 public virtual bool returnObjects(SceneObjectGroup[] returnobjects, UUID AgentId)