aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs69
1 files changed, 12 insertions, 57 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 48508f8..8760c84 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1852,53 +1852,6 @@ namespace OpenSim.Region.Framework.Scenes
1852 } 1852 }
1853 } 1853 }
1854 1854
1855 public void UpdateKnownItem(IClientAPI remoteClient, SceneObjectGroup grp, UUID itemID, UUID agentID)
1856 {
1857 SceneObjectGroup objectGroup = grp;
1858 if (objectGroup != null)
1859 {
1860 if (!grp.HasGroupChanged)
1861 {
1862 m_log.InfoFormat("[ATTACHMENT]: Save request for {0} which is unchanged", grp.UUID);
1863 return;
1864 }
1865
1866 m_log.InfoFormat(
1867 "[ATTACHMENT]: Updating asset for attachment {0}, attachpoint {1}",
1868 grp.UUID, grp.GetAttachmentPoint());
1869
1870 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup);
1871
1872 InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
1873 item = InventoryService.GetItem(item);
1874
1875 if (item != null)
1876 {
1877 AssetBase asset = CreateAsset(
1878 objectGroup.GetPartName(objectGroup.LocalId),
1879 objectGroup.GetPartDescription(objectGroup.LocalId),
1880 (sbyte)AssetType.Object,
1881 Utils.StringToBytes(sceneObjectXml),
1882 remoteClient.AgentId);
1883 AssetService.Store(asset);
1884
1885 item.AssetID = asset.FullID;
1886 item.Description = asset.Description;
1887 item.Name = asset.Name;
1888 item.AssetType = asset.Type;
1889 item.InvType = (int)InventoryType.Object;
1890
1891 InventoryService.UpdateItem(item);
1892
1893 // this gets called when the agent loggs off!
1894 if (remoteClient != null)
1895 {
1896 remoteClient.SendInventoryItemCreateUpdate(item, 0);
1897 }
1898 }
1899 }
1900 }
1901
1902 public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId, out UUID itemID) 1855 public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId, out UUID itemID)
1903 { 1856 {
1904 itemID = UUID.Zero; 1857 itemID = UUID.Zero;
@@ -2104,11 +2057,12 @@ namespace OpenSim.Region.Framework.Scenes
2104 sog.SetGroup(groupID, remoteClient); 2057 sog.SetGroup(groupID, remoteClient);
2105 sog.ScheduleGroupForFullUpdate(); 2058 sog.ScheduleGroupForFullUpdate();
2106 2059
2060 List<SceneObjectPart> partList = null;
2107 lock (sog.Children) 2061 lock (sog.Children)
2108 { 2062 partList = new List<SceneObjectPart>(sog.Children.Values);
2109 foreach (SceneObjectPart child in sog.Children.Values) 2063
2110 child.Inventory.ChangeInventoryOwner(ownerID); 2064 foreach (SceneObjectPart child in partList)
2111 } 2065 child.Inventory.ChangeInventoryOwner(ownerID);
2112 } 2066 }
2113 else 2067 else
2114 { 2068 {
@@ -2117,14 +2071,15 @@ namespace OpenSim.Region.Framework.Scenes
2117 2071
2118 if (sog.GroupID != groupID) 2072 if (sog.GroupID != groupID)
2119 continue; 2073 continue;
2120 2074
2075 List<SceneObjectPart> partList = null;
2121 lock (sog.Children) 2076 lock (sog.Children)
2077 partList = new List<SceneObjectPart>(sog.Children.Values);
2078
2079 foreach (SceneObjectPart child in partList)
2122 { 2080 {
2123 foreach (SceneObjectPart child in sog.Children.Values) 2081 child.LastOwnerID = child.OwnerID;
2124 { 2082 child.Inventory.ChangeInventoryOwner(groupID);
2125 child.LastOwnerID = child.OwnerID;
2126 child.Inventory.ChangeInventoryOwner(groupID);
2127 }
2128 } 2083 }
2129 2084
2130 sog.SetOwnerId(groupID); 2085 sog.SetOwnerId(groupID);