aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/EntityBase.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs88
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs72
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs3
4 files changed, 50 insertions, 120 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EntityBase.cs b/OpenSim/Region/Framework/Scenes/EntityBase.cs
index 6fd38e5..213431a 100644
--- a/OpenSim/Region/Framework/Scenes/EntityBase.cs
+++ b/OpenSim/Region/Framework/Scenes/EntityBase.cs
@@ -66,12 +66,7 @@ namespace OpenSim.Region.Framework.Scenes
66 /// <summary> 66 /// <summary>
67 /// Signals whether this entity was in a scene but has since been removed from it. 67 /// Signals whether this entity was in a scene but has since been removed from it.
68 /// </summary> 68 /// </summary>
69 public bool IsDeleted 69 public bool IsDeleted { get; protected internal set; }
70 {
71 get { return m_isDeleted; }
72 set { m_isDeleted = value; }
73 }
74 protected bool m_isDeleted;
75 70
76 protected Vector3 m_pos; 71 protected Vector3 m_pos;
77 72
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 94126f0..9358e7b 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1871,94 +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// m_log.DebugFormat("[SCENE]: Called attachObjectAssetStore for object {0} {1} for {2} {3} {4}", grp.Name, grp.LocalId, remoteClient.Name, remoteClient.AgentId, AgentId);
1877
1878 itemID = UUID.Zero;
1879 if (grp != null)
1880 {
1881 Vector3 inventoryStoredPosition = new Vector3
1882 (((grp.AbsolutePosition.X > (int)Constants.RegionSize)
1883 ? 250
1884 : grp.AbsolutePosition.X)
1885 ,
1886 (grp.AbsolutePosition.Y > (int)Constants.RegionSize)
1887 ? 250
1888 : grp.AbsolutePosition.Y,
1889 grp.AbsolutePosition.Z);
1890
1891 Vector3 originalPosition = grp.AbsolutePosition;
1892
1893 grp.AbsolutePosition = inventoryStoredPosition;
1894
1895 // If we're being called from a script, then trying to serialize that same script's state will not complete
1896 // in any reasonable time period. Therefore, we'll avoid it. The worst that can happen is that if
1897 // the client/server crashes rather than logging out normally, the attachment's scripts will resume
1898 // without state on relog. Arguably, this is what we want anyway.
1899 string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, false);
1900
1901 grp.AbsolutePosition = originalPosition;
1902
1903 AssetBase asset = CreateAsset(
1904 grp.GetPartName(grp.LocalId),
1905 grp.GetPartDescription(grp.LocalId),
1906 (sbyte)AssetType.Object,
1907 Utils.StringToBytes(sceneObjectXml),
1908 remoteClient.AgentId);
1909
1910 AssetService.Store(asset);
1911
1912 InventoryItemBase item = new InventoryItemBase();
1913 item.CreatorId = grp.RootPart.CreatorID.ToString();
1914 item.CreatorData = grp.RootPart.CreatorData;
1915 item.Owner = remoteClient.AgentId;
1916 item.ID = UUID.Random();
1917 item.AssetID = asset.FullID;
1918 item.Description = asset.Description;
1919 item.Name = asset.Name;
1920 item.AssetType = asset.Type;
1921 item.InvType = (int)InventoryType.Object;
1922
1923 InventoryFolderBase folder = InventoryService.GetFolderForType(remoteClient.AgentId, AssetType.Object);
1924 if (folder != null)
1925 item.Folder = folder.ID;
1926 else // oopsies
1927 item.Folder = UUID.Zero;
1928
1929 if ((remoteClient.AgentId != grp.RootPart.OwnerID) && Permissions.PropagatePermissions())
1930 {
1931 item.BasePermissions = grp.RootPart.NextOwnerMask;
1932 item.CurrentPermissions = grp.RootPart.NextOwnerMask;
1933 item.NextPermissions = grp.RootPart.NextOwnerMask;
1934 item.EveryOnePermissions = grp.RootPart.EveryoneMask & grp.RootPart.NextOwnerMask;
1935 item.GroupPermissions = grp.RootPart.GroupMask & grp.RootPart.NextOwnerMask;
1936 }
1937 else
1938 {
1939 item.BasePermissions = grp.RootPart.BaseMask;
1940 item.CurrentPermissions = grp.RootPart.OwnerMask;
1941 item.NextPermissions = grp.RootPart.NextOwnerMask;
1942 item.EveryOnePermissions = grp.RootPart.EveryoneMask;
1943 item.GroupPermissions = grp.RootPart.GroupMask;
1944 }
1945 item.CreationDate = Util.UnixTimeSinceEpoch();
1946
1947 // sets itemID so client can show item as 'attached' in inventory
1948 grp.SetFromItemID(item.ID);
1949
1950 if (AddInventoryItem(item))
1951 remoteClient.SendInventoryItemCreateUpdate(item, 0);
1952 else
1953 m_dialogModule.SendAlertToUser(remoteClient, "Operation failed");
1954
1955 itemID = item.ID;
1956 return item.AssetID;
1957 }
1958
1959 return UUID.Zero;
1960 }
1961
1962 /// <summary> 1874 /// <summary>
1963 /// Event Handler Rez an object into a scene 1875 /// Event Handler Rez an object into a scene
1964 /// Calls the non-void event handler 1876 /// Calls the non-void event handler
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index fe96152..8f0fa55 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -167,6 +167,44 @@ namespace OpenSim.Region.Framework.Scenes
167 } 167 }
168 } 168 }
169 169
170 /// <summary>
171 /// Is this scene object phantom?
172 /// </summary>
173 /// <remarks>
174 /// Updating must currently take place through UpdatePrimFlags()
175 /// </remarks>
176 public bool IsPhantom
177 {
178 get { return (RootPart.Flags & PrimFlags.Phantom) != 0; }
179 }
180
181 /// <summary>
182 /// Does this scene object use physics?
183 /// </summary>
184 /// <remarks>
185 /// Updating must currently take place through UpdatePrimFlags()
186 /// </remarks>
187 public bool UsesPhysics
188 {
189 get { return (RootPart.Flags & PrimFlags.TemporaryOnRez) != 0; }
190 }
191
192 /// <summary>
193 /// Is this scene object temporary?
194 /// </summary>
195 /// <remarks>
196 /// Updating must currently take place through UpdatePrimFlags()
197 /// </remarks>
198 public bool IsTemporary
199 {
200 get { return (RootPart.Flags & PrimFlags.TemporaryOnRez) != 0; }
201 }
202
203 public bool IsVolumeDetect
204 {
205 get { return RootPart.VolumeDetectActive; }
206 }
207
170 public float scriptScore; 208 public float scriptScore;
171 209
172 private Vector3 lastPhysGroupPos; 210 private Vector3 lastPhysGroupPos;
@@ -1510,36 +1548,24 @@ namespace OpenSim.Region.Framework.Scenes
1510 SetRootPart(part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, 0, userExposed)); 1548 SetRootPart(part.Copy(m_scene.AllocateLocalId(), OwnerID, GroupID, 0, userExposed));
1511 } 1549 }
1512 1550
1513 public void ScriptSetPhysicsStatus(bool UsePhysics) 1551 public void ScriptSetPhysicsStatus(bool usePhysics)
1514 { 1552 {
1515 bool IsTemporary = ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0); 1553 UpdatePrimFlags(RootPart.LocalId, usePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
1516 bool IsPhantom = ((RootPart.Flags & PrimFlags.Phantom) != 0);
1517 bool IsVolumeDetect = RootPart.VolumeDetectActive;
1518 UpdatePrimFlags(RootPart.LocalId, UsePhysics, IsTemporary, IsPhantom, IsVolumeDetect);
1519 } 1554 }
1520 1555
1521 public void ScriptSetTemporaryStatus(bool TemporaryStatus) 1556 public void ScriptSetTemporaryStatus(bool makeTemporary)
1522 { 1557 {
1523 bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); 1558 UpdatePrimFlags(RootPart.LocalId, UsesPhysics, makeTemporary, IsPhantom, IsVolumeDetect);
1524 bool IsPhantom = ((RootPart.Flags & PrimFlags.Phantom) != 0);
1525 bool IsVolumeDetect = RootPart.VolumeDetectActive;
1526 UpdatePrimFlags(RootPart.LocalId, UsePhysics, TemporaryStatus, IsPhantom, IsVolumeDetect);
1527 } 1559 }
1528 1560
1529 public void ScriptSetPhantomStatus(bool PhantomStatus) 1561 public void ScriptSetPhantomStatus(bool makePhantom)
1530 { 1562 {
1531 bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); 1563 UpdatePrimFlags(RootPart.LocalId, UsesPhysics, IsTemporary, makePhantom, IsVolumeDetect);
1532 bool IsTemporary = ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0);
1533 bool IsVolumeDetect = RootPart.VolumeDetectActive;
1534 UpdatePrimFlags(RootPart.LocalId, UsePhysics, IsTemporary, PhantomStatus, IsVolumeDetect);
1535 } 1564 }
1536 1565
1537 public void ScriptSetVolumeDetect(bool VDStatus) 1566 public void ScriptSetVolumeDetect(bool makeVolumeDetect)
1538 { 1567 {
1539 bool UsePhysics = ((RootPart.Flags & PrimFlags.Physics) != 0); 1568 UpdatePrimFlags(RootPart.LocalId, UsesPhysics, IsTemporary, IsPhantom, makeVolumeDetect);
1540 bool IsTemporary = ((RootPart.Flags & PrimFlags.TemporaryOnRez) != 0);
1541 bool IsPhantom = ((RootPart.Flags & PrimFlags.Phantom) != 0);
1542 UpdatePrimFlags(RootPart.LocalId, UsePhysics, IsTemporary, IsPhantom, VDStatus);
1543 1569
1544 /* 1570 /*
1545 ScriptSetPhantomStatus(false); // What ever it was before, now it's not phantom anymore 1571 ScriptSetPhantomStatus(false); // What ever it was before, now it's not phantom anymore
@@ -1806,7 +1832,7 @@ namespace OpenSim.Region.Framework.Scenes
1806 // an object has been deleted from a scene before update was processed. 1832 // an object has been deleted from a scene before update was processed.
1807 // A more fundamental overhaul of the update mechanism is required to eliminate all 1833 // A more fundamental overhaul of the update mechanism is required to eliminate all
1808 // the race conditions. 1834 // the race conditions.
1809 if (m_isDeleted) 1835 if (IsDeleted)
1810 return; 1836 return;
1811 1837
1812 // Even temporary objects take part in physics (e.g. temp-on-rez bullets) 1838 // Even temporary objects take part in physics (e.g. temp-on-rez bullets)
@@ -2116,7 +2142,7 @@ namespace OpenSim.Region.Framework.Scenes
2116 } 2142 }
2117 2143
2118 m_scene.UnlinkSceneObject(objectGroup, true); 2144 m_scene.UnlinkSceneObject(objectGroup, true);
2119 objectGroup.m_isDeleted = true; 2145 objectGroup.IsDeleted = true;
2120 2146
2121 objectGroup.m_parts.Clear(); 2147 objectGroup.m_parts.Clear();
2122 2148
@@ -3359,7 +3385,7 @@ namespace OpenSim.Region.Framework.Scenes
3359 public virtual ISceneObject CloneForNewScene() 3385 public virtual ISceneObject CloneForNewScene()
3360 { 3386 {
3361 SceneObjectGroup sog = Copy(false); 3387 SceneObjectGroup sog = Copy(false);
3362 sog.m_isDeleted = false; 3388 sog.IsDeleted = false;
3363 return sog; 3389 return sog;
3364 } 3390 }
3365 3391
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 9518161..fc89473 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3809,9 +3809,6 @@ namespace OpenSim.Region.Framework.Scenes
3809 List<AvatarAttachment> attachments = m_appearance.GetAttachments(); 3809 List<AvatarAttachment> attachments = m_appearance.GetAttachments();
3810 foreach (AvatarAttachment attach in attachments) 3810 foreach (AvatarAttachment attach in attachments)
3811 { 3811 {
3812 if (m_isDeleted)
3813 return;
3814
3815 int p = attach.AttachPoint; 3812 int p = attach.AttachPoint;
3816 UUID itemID = attach.ItemID; 3813 UUID itemID = attach.ItemID;
3817 3814