From fda39c11bf8e440414f44e8233aa67818da51036 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 22 Jun 2012 01:33:27 +0100 Subject: Fix bug where attachments would not retain position if just rotated and not moved. This was because we were not setting AttachedPos in SOG.UpdateGroupPositionPR, unlike UpdateGroupPosition --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 18877c1e..1e900a0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2911,6 +2911,11 @@ namespace OpenSim.Region.Framework.Scenes m_scene.PhysicsScene.AddPhysicsActorTaint(actor); } + if (IsAttachment) + { + m_rootPart.AttachedPos = pos; + } + AbsolutePosition = pos; HasGroupChanged = true; -- cgit v1.1 From 6d3ee8bb39d47ed7b32e8905fa0b2fc31c5a9f80 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sat, 23 Jun 2012 04:11:31 -0400 Subject: Fix script "Running" behavior Unchecking "Running" box in script editor now persists. This fixes http://opensimulator.org/mantis/view.php?id=6057 --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index e413281..9ff8467 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -2143,10 +2143,24 @@ namespace OpenSim.Region.Framework.Scenes if (part == null) return; + IScriptModule[] engines = RequestModuleInterfaces(); + if (running) + { + foreach (IScriptModule engine in engines) + { + engine.SetRunEnable(itemID, true); + } EventManager.TriggerStartScript(part.LocalId, itemID); + } else + { + foreach (IScriptModule engine in engines) + { + engine.SetRunEnable(itemID, false); + } EventManager.TriggerStopScript(part.LocalId, itemID); + } } public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) -- cgit v1.1 From 5301648cff6b451fef4cca0baf8cda1bdb1455a6 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 25 Jun 2012 21:08:19 +0100 Subject: In AttachmentsModule.DetachSingleAttachmentToInvInternal(), remove attachment before changing properties for correct inventory serialization. Serialization of attachments requires IsAttachment = false so that correct positions are serialized instead of avatar position. However, doing this when a hud is still attached allows race conditions with update threads, resulting in hud artifacts on other viewers. This change sets SOG.IsDeleted before serialization changes take place (IsDeleted itself is not a serialized property). LLClientView then screens out any deleted SOGs before sending updates to viewers. --- OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index 453e077..81add43 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs @@ -187,8 +187,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests TestScene scene = new SceneHelpers().SetupScene(); SceneObjectPart part = SceneHelpers.AddSceneObject(scene); + + Assert.That(part.ParentGroup.IsDeleted, Is.False); + scene.DeleteSceneObject(part.ParentGroup, false); + Assert.That(part.ParentGroup.IsDeleted, Is.True); + SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); Assert.That(retrievedPart, Is.Null); } @@ -219,8 +224,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(retrievedPart, Is.Not.Null); + Assert.That(part.ParentGroup.IsDeleted, Is.False); + sogd.InventoryDeQueueAndDelete(); + Assert.That(part.ParentGroup.IsDeleted, Is.True); + SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId); Assert.That(retrievedPart2, Is.Null); } -- cgit v1.1 From e5b739aaebace6b028f3f6bf05d21ff7a7c5affe Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 25 Jun 2012 22:48:13 +0100 Subject: When attachments are being saved and deleted for a closing root agent, delete first to avoid a hud race condition with update threads. If delete doesn't occur first then the update thread can outrace the IsAttachment = false necessary to save attachments and send hud artifacts to other viewers. --- OpenSim/Region/Framework/Scenes/Scene.cs | 24 +++++++++++++----------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 --- 2 files changed, 13 insertions(+), 14 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 385febf..d449116 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -500,6 +500,7 @@ namespace OpenSim.Region.Framework.Scenes public IAttachmentsModule AttachmentsModule { get; set; } public IEntityTransferModule EntityTransferModule { get; private set; } public IAgentAssetTransactions AgentTransactionsModule { get; private set; } + public IUserManagement UserManagementModule { get; private set; } public IAvatarFactoryModule AvatarFactory { @@ -1243,6 +1244,7 @@ namespace OpenSim.Region.Framework.Scenes EntityTransferModule = RequestModuleInterface(); m_groupsModule = RequestModuleInterface(); AgentTransactionsModule = RequestModuleInterface(); + UserManagementModule = RequestModuleInterface(); } #endregion @@ -2021,9 +2023,8 @@ namespace OpenSim.Region.Framework.Scenes sceneObject.SetGroup(groupID, null); } - IUserManagement uman = RequestModuleInterface(); - if (uman != null) - sceneObject.RootPart.CreatorIdentification = uman.GetUserUUI(ownerID); + if (UserManagementModule != null) + sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID); sceneObject.ScheduleGroupForFullUpdate(); @@ -2711,14 +2712,13 @@ namespace OpenSim.Region.Framework.Scenes /// private void CacheUserName(ScenePresence sp, AgentCircuitData aCircuit) { - IUserManagement uMan = RequestModuleInterface(); - if (uMan != null) + if (UserManagementModule != null) { string first = aCircuit.firstname, last = aCircuit.lastname; if (sp.PresenceType == PresenceType.Npc) { - uMan.AddUser(aCircuit.AgentID, first, last); + UserManagementModule.AddUser(aCircuit.AgentID, first, last); } else { @@ -2737,7 +2737,7 @@ namespace OpenSim.Region.Framework.Scenes } } - uMan.AddUser(aCircuit.AgentID, first, last, homeURL); + UserManagementModule.AddUser(aCircuit.AgentID, first, last, homeURL); } } } @@ -3292,17 +3292,19 @@ namespace OpenSim.Region.Framework.Scenes if (!isChildAgent) { - if (AttachmentsModule != null && avatar.PresenceType != PresenceType.Npc) + if (AttachmentsModule != null) { - IUserManagement uMan = RequestModuleInterface(); // Don't save attachments for HG visitors, it // messes up their inventory. When a HG visitor logs // out on a foreign grid, their attachments will be // reloaded in the state they were in when they left // the home grid. This is best anyway as the visited // grid may use an incompatible script engine. - if (uMan == null || uMan.IsLocalGridUser(avatar.UUID)) - AttachmentsModule.SaveChangedAttachments(avatar, false); + bool saveChanged + = avatar.PresenceType != PresenceType.Npc + && (UserManagementModule == null || UserManagementModule.IsLocalGridUser(avatar.UUID)); + + AttachmentsModule.DeRezAttachments(avatar, saveChanged, false); } ForEachClient( diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3909fd4..909c7c8 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3416,9 +3416,6 @@ namespace OpenSim.Region.Framework.Scenes public void Close() { - if (!IsChildAgent && m_scene.AttachmentsModule != null) - m_scene.AttachmentsModule.DeleteAttachmentsFromScene(this, false); - // Clear known regions KnownRegions = new Dictionary(); -- cgit v1.1