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.cs80
1 files changed, 0 insertions, 80 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index afc1a4f..9358e7b 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1871,86 +1871,6 @@ namespace OpenSim.Region.Framework.Scenes
1871 } 1871 }
1872 } 1872 }
1873 1873
1874 public UUID attachObjectAssetStore(IClientAPI remoteClient, SceneObjectGroup grp, UUID AgentId, out UUID itemID)
1875 {
1876 itemID = UUID.Zero;
1877 if (grp != null)
1878 {
1879 Vector3 inventoryStoredPosition = new Vector3
1880 (((grp.AbsolutePosition.X > (int)Constants.RegionSize)
1881 ? 250
1882 : grp.AbsolutePosition.X)
1883 ,
1884 (grp.AbsolutePosition.X > (int)Constants.RegionSize)
1885 ? 250
1886 : grp.AbsolutePosition.X,
1887 grp.AbsolutePosition.Z);
1888
1889 Vector3 originalPosition = grp.AbsolutePosition;
1890
1891 grp.AbsolutePosition = inventoryStoredPosition;
1892
1893 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp);
1894
1895 grp.AbsolutePosition = originalPosition;
1896
1897 AssetBase asset = CreateAsset(
1898 grp.GetPartName(grp.LocalId),
1899 grp.GetPartDescription(grp.LocalId),
1900 (sbyte)AssetType.Object,
1901 Utils.StringToBytes(sceneObjectXml),
1902 remoteClient.AgentId);
1903 AssetService.Store(asset);
1904
1905 InventoryItemBase item = new InventoryItemBase();
1906 item.CreatorId = grp.RootPart.CreatorID.ToString();
1907 item.CreatorData = grp.RootPart.CreatorData;
1908 item.Owner = remoteClient.AgentId;
1909 item.ID = UUID.Random();
1910 item.AssetID = asset.FullID;
1911 item.Description = asset.Description;
1912 item.Name = asset.Name;
1913 item.AssetType = asset.Type;
1914 item.InvType = (int)InventoryType.Object;
1915
1916 InventoryFolderBase folder = InventoryService.GetFolderForType(remoteClient.AgentId, AssetType.Object);
1917 if (folder != null)
1918 item.Folder = folder.ID;
1919 else // oopsies
1920 item.Folder = UUID.Zero;
1921
1922 if ((remoteClient.AgentId != grp.RootPart.OwnerID) && Permissions.PropagatePermissions())
1923 {
1924 item.BasePermissions = grp.RootPart.NextOwnerMask;
1925 item.CurrentPermissions = grp.RootPart.NextOwnerMask;
1926 item.NextPermissions = grp.RootPart.NextOwnerMask;
1927 item.EveryOnePermissions = grp.RootPart.EveryoneMask & grp.RootPart.NextOwnerMask;
1928 item.GroupPermissions = grp.RootPart.GroupMask & grp.RootPart.NextOwnerMask;
1929 }
1930 else
1931 {
1932 item.BasePermissions = grp.RootPart.BaseMask;
1933 item.CurrentPermissions = grp.RootPart.OwnerMask;
1934 item.NextPermissions = grp.RootPart.NextOwnerMask;
1935 item.EveryOnePermissions = grp.RootPart.EveryoneMask;
1936 item.GroupPermissions = grp.RootPart.GroupMask;
1937 }
1938 item.CreationDate = Util.UnixTimeSinceEpoch();
1939
1940 // sets itemID so client can show item as 'attached' in inventory
1941 grp.SetFromItemID(item.ID);
1942
1943 if (AddInventoryItem(item))
1944 remoteClient.SendInventoryItemCreateUpdate(item, 0);
1945 else
1946 m_dialogModule.SendAlertToUser(remoteClient, "Operation failed");
1947
1948 itemID = item.ID;
1949 return item.AssetID;
1950 }
1951 return UUID.Zero;
1952 }
1953
1954 /// <summary> 1874 /// <summary>
1955 /// Event Handler Rez an object into a scene 1875 /// Event Handler Rez an object into a scene
1956 /// Calls the non-void event handler 1876 /// Calls the non-void event handler