diff options
Diffstat (limited to '')
7 files changed, 193 insertions, 129 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs index 7b70790..1dd8938 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs | |||
@@ -56,8 +56,8 @@ namespace OpenSim.Region.ClientStack.Linden | |||
56 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 56 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] |
57 | public class SimulatorFeaturesModule : ISharedRegionModule, ISimulatorFeaturesModule | 57 | public class SimulatorFeaturesModule : ISharedRegionModule, ISimulatorFeaturesModule |
58 | { | 58 | { |
59 | private static readonly ILog m_log = | 59 | // private static readonly ILog m_log = |
60 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 60 | // LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
61 | 61 | ||
62 | private Scene m_scene; | 62 | private Scene m_scene; |
63 | 63 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index c274a5b..928d43f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -46,7 +46,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
46 | { | 46 | { |
47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
48 | 48 | ||
49 | protected Scene m_scene = null; | 49 | private Scene m_scene = null; |
50 | private IDialogModule m_dialogModule; | ||
50 | 51 | ||
51 | public string Name { get { return "Attachments Module"; } } | 52 | public string Name { get { return "Attachments Module"; } } |
52 | public Type ReplaceableInterface { get { return null; } } | 53 | public Type ReplaceableInterface { get { return null; } } |
@@ -56,6 +57,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
56 | public void AddRegion(Scene scene) | 57 | public void AddRegion(Scene scene) |
57 | { | 58 | { |
58 | m_scene = scene; | 59 | m_scene = scene; |
60 | m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>(); | ||
59 | m_scene.RegisterModuleInterface<IAttachmentsModule>(this); | 61 | m_scene.RegisterModuleInterface<IAttachmentsModule>(this); |
60 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; | 62 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; |
61 | // TODO: Should probably be subscribing to CloseClient too, but this doesn't yet give us IClientAPI | 63 | // TODO: Should probably be subscribing to CloseClient too, but this doesn't yet give us IClientAPI |
@@ -228,7 +230,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
228 | 230 | ||
229 | itemID = group.GetFromItemID(); | 231 | itemID = group.GetFromItemID(); |
230 | if (itemID == UUID.Zero) | 232 | if (itemID == UUID.Zero) |
231 | m_scene.attachObjectAssetStore(sp.ControllingClient, group, sp.UUID, out itemID); | 233 | itemID = AddSceneObjectAsAttachment(sp.ControllingClient, group).ID; |
232 | 234 | ||
233 | ShowAttachInUserInventory(sp, AttachmentPt, itemID, group); | 235 | ShowAttachInUserInventory(sp, AttachmentPt, itemID, group); |
234 | 236 | ||
@@ -563,7 +565,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
563 | // the client/server crashes rather than logging out normally, the attachment's scripts will resume | 565 | // the client/server crashes rather than logging out normally, the attachment's scripts will resume |
564 | // without state on relog. Arguably, this is what we want anyway. | 566 | // without state on relog. Arguably, this is what we want anyway. |
565 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, false); | 567 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, false); |
566 | 568 | ||
567 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); | 569 | InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId); |
568 | item = m_scene.InventoryService.GetItem(item); | 570 | item = m_scene.InventoryService.GetItem(item); |
569 | 571 | ||
@@ -656,5 +658,97 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
656 | // it get cleaned up | 658 | // it get cleaned up |
657 | so.RootPart.RemFlag(PrimFlags.TemporaryOnRez); | 659 | so.RootPart.RemFlag(PrimFlags.TemporaryOnRez); |
658 | } | 660 | } |
661 | |||
662 | /// <summary> | ||
663 | /// Add a scene object that was previously free in the scene as an attachment to an avatar. | ||
664 | /// </summary> | ||
665 | /// <param name="remoteClient"></param> | ||
666 | /// <param name="grp"></param> | ||
667 | /// <returns>The user inventory item created that holds the attachment.</returns> | ||
668 | private InventoryItemBase AddSceneObjectAsAttachment(IClientAPI remoteClient, SceneObjectGroup grp) | ||
669 | { | ||
670 | // m_log.DebugFormat("[SCENE]: Called AddSceneObjectAsAttachment for object {0} {1} for {2} {3} {4}", grp.Name, grp.LocalId, remoteClient.Name, remoteClient.AgentId, AgentId); | ||
671 | |||
672 | Vector3 inventoryStoredPosition = new Vector3 | ||
673 | (((grp.AbsolutePosition.X > (int)Constants.RegionSize) | ||
674 | ? Constants.RegionSize - 6 | ||
675 | : grp.AbsolutePosition.X) | ||
676 | , | ||
677 | (grp.AbsolutePosition.Y > (int)Constants.RegionSize) | ||
678 | ? Constants.RegionSize - 6 | ||
679 | : grp.AbsolutePosition.Y, | ||
680 | grp.AbsolutePosition.Z); | ||
681 | |||
682 | Vector3 originalPosition = grp.AbsolutePosition; | ||
683 | |||
684 | grp.AbsolutePosition = inventoryStoredPosition; | ||
685 | |||
686 | // If we're being called from a script, then trying to serialize that same script's state will not complete | ||
687 | // in any reasonable time period. Therefore, we'll avoid it. The worst that can happen is that if | ||
688 | // the client/server crashes rather than logging out normally, the attachment's scripts will resume | ||
689 | // without state on relog. Arguably, this is what we want anyway. | ||
690 | string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp, false); | ||
691 | |||
692 | grp.AbsolutePosition = originalPosition; | ||
693 | |||
694 | AssetBase asset = m_scene.CreateAsset( | ||
695 | grp.GetPartName(grp.LocalId), | ||
696 | grp.GetPartDescription(grp.LocalId), | ||
697 | (sbyte)AssetType.Object, | ||
698 | Utils.StringToBytes(sceneObjectXml), | ||
699 | remoteClient.AgentId); | ||
700 | |||
701 | m_scene.AssetService.Store(asset); | ||
702 | |||
703 | InventoryItemBase item = new InventoryItemBase(); | ||
704 | item.CreatorId = grp.RootPart.CreatorID.ToString(); | ||
705 | item.CreatorData = grp.RootPart.CreatorData; | ||
706 | item.Owner = remoteClient.AgentId; | ||
707 | item.ID = UUID.Random(); | ||
708 | item.AssetID = asset.FullID; | ||
709 | item.Description = asset.Description; | ||
710 | item.Name = asset.Name; | ||
711 | item.AssetType = asset.Type; | ||
712 | item.InvType = (int)InventoryType.Object; | ||
713 | |||
714 | InventoryFolderBase folder = m_scene.InventoryService.GetFolderForType(remoteClient.AgentId, AssetType.Object); | ||
715 | if (folder != null) | ||
716 | item.Folder = folder.ID; | ||
717 | else // oopsies | ||
718 | item.Folder = UUID.Zero; | ||
719 | |||
720 | if ((remoteClient.AgentId != grp.RootPart.OwnerID) && m_scene.Permissions.PropagatePermissions()) | ||
721 | { | ||
722 | item.BasePermissions = grp.RootPart.NextOwnerMask; | ||
723 | item.CurrentPermissions = grp.RootPart.NextOwnerMask; | ||
724 | item.NextPermissions = grp.RootPart.NextOwnerMask; | ||
725 | item.EveryOnePermissions = grp.RootPart.EveryoneMask & grp.RootPart.NextOwnerMask; | ||
726 | item.GroupPermissions = grp.RootPart.GroupMask & grp.RootPart.NextOwnerMask; | ||
727 | } | ||
728 | else | ||
729 | { | ||
730 | item.BasePermissions = grp.RootPart.BaseMask; | ||
731 | item.CurrentPermissions = grp.RootPart.OwnerMask; | ||
732 | item.NextPermissions = grp.RootPart.NextOwnerMask; | ||
733 | item.EveryOnePermissions = grp.RootPart.EveryoneMask; | ||
734 | item.GroupPermissions = grp.RootPart.GroupMask; | ||
735 | } | ||
736 | item.CreationDate = Util.UnixTimeSinceEpoch(); | ||
737 | |||
738 | // sets itemID so client can show item as 'attached' in inventory | ||
739 | grp.SetFromItemID(item.ID); | ||
740 | |||
741 | if (m_scene.AddInventoryItem(item)) | ||
742 | { | ||
743 | remoteClient.SendInventoryItemCreateUpdate(item, 0); | ||
744 | } | ||
745 | else | ||
746 | { | ||
747 | if (m_dialogModule != null) | ||
748 | m_dialogModule.SendAlertToUser(remoteClient, "Operation failed"); | ||
749 | } | ||
750 | |||
751 | return item; | ||
752 | } | ||
659 | } | 753 | } |
660 | } | 754 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs index 6695a9d..859f6ff 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs | |||
@@ -81,7 +81,38 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
81 | } | 81 | } |
82 | 82 | ||
83 | [Test] | 83 | [Test] |
84 | public void TestAddAttachment() | 84 | public void TestAddAttachmentFromGround() |
85 | { | ||
86 | TestHelpers.InMethod(); | ||
87 | // log4net.Config.XmlConfigurator.Configure(); | ||
88 | |||
89 | UUID userId = TestHelpers.ParseTail(0x1); | ||
90 | string attName = "att"; | ||
91 | |||
92 | UserAccountHelpers.CreateUserWithInventory(scene, userId); | ||
93 | ScenePresence presence = SceneHelpers.AddScenePresence(scene, userId); | ||
94 | SceneObjectGroup so = SceneHelpers.AddSceneObject(scene, attName).ParentGroup; | ||
95 | |||
96 | m_attMod.AttachObject(presence.ControllingClient, so, (uint)AttachmentPoint.Chest, false); | ||
97 | |||
98 | // Check status on scene presence | ||
99 | Assert.That(presence.HasAttachments(), Is.True); | ||
100 | List<SceneObjectGroup> attachments = presence.Attachments; | ||
101 | Assert.That(attachments.Count, Is.EqualTo(1)); | ||
102 | SceneObjectGroup attSo = attachments[0]; | ||
103 | Assert.That(attSo.Name, Is.EqualTo(attName)); | ||
104 | Assert.That(attSo.GetAttachmentPoint(), Is.EqualTo((byte)AttachmentPoint.Chest)); | ||
105 | Assert.That(attSo.IsAttachment); | ||
106 | Assert.That(attSo.UsesPhysics, Is.False); | ||
107 | Assert.That(attSo.IsTemporary, Is.False); | ||
108 | |||
109 | // Check item status | ||
110 | Assert.That(presence.Appearance.GetAttachpoint( | ||
111 | attSo.GetFromItemID()), Is.EqualTo((int)AttachmentPoint.Chest)); | ||
112 | } | ||
113 | |||
114 | [Test] | ||
115 | public void TestAddAttachmentFromInventory() | ||
85 | { | 116 | { |
86 | TestHelpers.InMethod(); | 117 | TestHelpers.InMethod(); |
87 | // log4net.Config.XmlConfigurator.Configure(); | 118 | // log4net.Config.XmlConfigurator.Configure(); |
@@ -104,8 +135,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
104 | Assert.That(presence.HasAttachments(), Is.True); | 135 | Assert.That(presence.HasAttachments(), Is.True); |
105 | List<SceneObjectGroup> attachments = presence.Attachments; | 136 | List<SceneObjectGroup> attachments = presence.Attachments; |
106 | Assert.That(attachments.Count, Is.EqualTo(1)); | 137 | Assert.That(attachments.Count, Is.EqualTo(1)); |
107 | Assert.That(attachments[0].Name, Is.EqualTo(attName)); | 138 | SceneObjectGroup attSo = attachments[0]; |
108 | Assert.That(attachments[0].GetAttachmentPoint(), Is.EqualTo((byte)AttachmentPoint.Chest)); | 139 | Assert.That(attSo.Name, Is.EqualTo(attName)); |
140 | Assert.That(attSo.GetAttachmentPoint(), Is.EqualTo((byte)AttachmentPoint.Chest)); | ||
141 | Assert.That(attSo.IsAttachment); | ||
142 | Assert.That(attSo.UsesPhysics, Is.False); | ||
143 | Assert.That(attSo.IsTemporary, Is.False); | ||
109 | 144 | ||
110 | // Check item status | 145 | // Check item status |
111 | Assert.That(presence.Appearance.GetAttachpoint(attItemId), Is.EqualTo((int)AttachmentPoint.Chest)); | 146 | Assert.That(presence.Appearance.GetAttachpoint(attItemId), Is.EqualTo((int)AttachmentPoint.Chest)); |
@@ -166,7 +201,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests | |||
166 | List<SceneObjectGroup> attachments = presence.Attachments; | 201 | List<SceneObjectGroup> attachments = presence.Attachments; |
167 | 202 | ||
168 | Assert.That(attachments.Count, Is.EqualTo(1)); | 203 | Assert.That(attachments.Count, Is.EqualTo(1)); |
169 | Assert.That(attachments[0].Name, Is.EqualTo(attName)); | 204 | SceneObjectGroup attSo = attachments[0]; |
205 | Assert.That(attSo.Name, Is.EqualTo(attName)); | ||
206 | Assert.That(attSo.GetAttachmentPoint(), Is.EqualTo((byte)AttachmentPoint.Chest)); | ||
207 | Assert.That(attSo.IsAttachment); | ||
208 | Assert.That(attSo.UsesPhysics, Is.False); | ||
209 | Assert.That(attSo.IsTemporary, Is.False); | ||
170 | } | 210 | } |
171 | 211 | ||
172 | // I'm commenting this test because scene setup NEEDS InventoryService to | 212 | // I'm commenting this test because scene setup NEEDS InventoryService to |
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 | ||