From cb80d8a29c0af24421a51087ddb56ad35a5c49b8 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 9 Dec 2012 15:31:11 -0800 Subject: UserManagementModule: search the local cache for names too. Inventory transfers: don't do async on asset transfers or now. --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 ad40d6b..e0f3c99 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -692,7 +692,7 @@ namespace OpenSim.Region.Framework.Scenes { IInventoryAccessModule invAccess = RequestModuleInterface(); if (invAccess != null) - Util.FireAndForget(delegate { invAccess.TransferInventoryAssets(itemCopy, senderId, recipient); }); + invAccess.TransferInventoryAssets(itemCopy, senderId, recipient); } if (!Permissions.BypassPermissions()) -- cgit v1.1 From b8178f5a509caf897dac0660db47ea9a5224194a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 9 Dec 2012 22:03:21 -0800 Subject: Switched the order by which foreign inventory and foreign assets are brought in, to avoid race conditions on the client. --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (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 e0f3c99..5c8b097 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -688,12 +688,10 @@ namespace OpenSim.Region.Framework.Scenes itemCopy.SalePrice = item.SalePrice; itemCopy.SaleType = item.SaleType; - if (AddInventoryItem(itemCopy)) - { - IInventoryAccessModule invAccess = RequestModuleInterface(); - if (invAccess != null) - invAccess.TransferInventoryAssets(itemCopy, senderId, recipient); - } + IInventoryAccessModule invAccess = RequestModuleInterface(); + if (invAccess != null) + invAccess.TransferInventoryAssets(itemCopy, senderId, recipient); + AddInventoryItem(itemCopy); if (!Permissions.BypassPermissions()) { -- cgit v1.1 From 88b094cbf76e9775163ebfdfa23ddb052b62b460 Mon Sep 17 00:00:00 2001 From: Dan Lake Date: Thu, 13 Dec 2012 13:05:28 -0800 Subject: Simplify sit code a bit by determining correct animation in HandleSit instead of HandleSitRequest. This eliminates m_nextSitAnimation, an unneeded state-saving variable in ScenePresence --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 36 ++++-------------------- 1 file changed, 6 insertions(+), 30 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6f36c0b..58721b0 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -212,8 +212,6 @@ namespace OpenSim.Region.Framework.Scenes private Quaternion m_headrotation = Quaternion.Identity; - private string m_nextSitAnimation = String.Empty; - //PauPaw:Proper PID Controler for autopilot************ public bool MovingToTarget { get; private set; } public Vector3 MoveToPositionTarget { get; private set; } @@ -1955,25 +1953,10 @@ namespace OpenSim.Region.Framework.Scenes StandUp(); } -// if (!String.IsNullOrEmpty(sitAnimation)) -// { -// m_nextSitAnimation = sitAnimation; -// } -// else -// { - m_nextSitAnimation = "SIT"; -// } - - //SceneObjectPart part = m_scene.GetSceneObjectPart(targetID); SceneObjectPart part = FindNextAvailableSitTarget(targetID); if (part != null) { - if (!String.IsNullOrEmpty(part.SitAnimation)) - { - m_nextSitAnimation = part.SitAnimation; - } - m_requestedSitTargetID = part.LocalId; m_requestedSitTargetUUID = targetID; @@ -2188,18 +2171,6 @@ namespace OpenSim.Region.Framework.Scenes public void HandleAgentSit(IClientAPI remoteClient, UUID agentID) { - if (!String.IsNullOrEmpty(m_nextSitAnimation)) - { - HandleAgentSit(remoteClient, agentID, m_nextSitAnimation); - } - else - { - HandleAgentSit(remoteClient, agentID, "SIT"); - } - } - - public void HandleAgentSit(IClientAPI remoteClient, UUID agentID, string sitAnimation) - { SceneObjectPart part = m_scene.GetSceneObjectPart(m_requestedSitTargetID); if (part != null) @@ -2246,7 +2217,12 @@ namespace OpenSim.Region.Framework.Scenes Velocity = Vector3.Zero; RemoveFromPhysicalScene(); - + + String sitAnimation = "SIT"; + if (!String.IsNullOrEmpty(part.SitAnimation)) + { + sitAnimation = part.SitAnimation; + } Animator.TrySetMovementAnimation(sitAnimation); SendAvatarDataToAllAgents(); } -- cgit v1.1 From 750ad2d3afd6fcf32a9e04794d860e117559a78f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 14 Dec 2012 22:15:40 +0000 Subject: Fix issue where calling llVolumeDetect(FALSE) would not remove phantom flag, causing subsequent issues if physics was re-enabled. Added regression tests Addresses http://opensimulator.org/mantis/view.php?id=6365 --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 3 +- .../Scenes/Tests/SceneObjectStatusTests.cs | 41 +++++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index f79ac96..ff67d6d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -3993,13 +3993,14 @@ namespace OpenSim.Region.Framework.Scenes VolumeDetectActive = true; } } - else + else if (SetVD != wasVD) { // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like // (mumbles, well, at least if you have infinte CPU powers :-)) if (pa != null) pa.SetVolumeDetect(0); + RemFlag(PrimFlags.Phantom); VolumeDetectActive = false; } diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs index 093cbd2..8eb3191 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectStatusTests.cs @@ -78,6 +78,26 @@ namespace OpenSim.Region.Framework.Scenes.Tests } [Test] + public void TestSetNonPhysicsVolumeDetectSinglePrim() + { + TestHelpers.InMethod(); + + m_scene.AddSceneObject(m_so1); + + SceneObjectPart rootPart = m_so1.RootPart; + Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); + + m_so1.ScriptSetVolumeDetect(true); + +// Console.WriteLine("so.RootPart.Flags [{0}]", so.RootPart.Flags); + Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Phantom)); + + m_so1.ScriptSetVolumeDetect(false); + + Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); + } + + [Test] public void TestSetPhysicsSinglePrim() { TestHelpers.InMethod(); @@ -89,13 +109,32 @@ namespace OpenSim.Region.Framework.Scenes.Tests m_so1.ScriptSetPhysicsStatus(true); -// Console.WriteLine("so.RootPart.Flags [{0}]", so.RootPart.Flags); Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Physics)); m_so1.ScriptSetPhysicsStatus(false); Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); } + + [Test] + public void TestSetPhysicsVolumeDetectSinglePrim() + { + TestHelpers.InMethod(); + + m_scene.AddSceneObject(m_so1); + + SceneObjectPart rootPart = m_so1.RootPart; + Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.None)); + + m_so1.ScriptSetPhysicsStatus(true); + m_so1.ScriptSetVolumeDetect(true); + + Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Phantom | PrimFlags.Physics)); + + m_so1.ScriptSetVolumeDetect(false); + + Assert.That(rootPart.Flags, Is.EqualTo(PrimFlags.Physics)); + } [Test] public void TestSetPhysicsLinkset() -- cgit v1.1 From 56ec177b3b5b8f5b30d1024cfe6fbf8c59e36c6f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 14 Dec 2012 23:42:23 +0000 Subject: minor: Add commented out log lines to ScenePresenceAnimator for future debug use (such as logging anim pack contents sent to clients) --- .../Framework/Scenes/Animation/ScenePresenceAnimator.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index bb33f07..5b16b67 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -26,9 +26,10 @@ */ using System; -using System.Threading; using System.Collections.Generic; +using System.Linq; using System.Reflection; +using System.Threading; using log4net; using OpenMetaverse; using OpenSim.Framework; @@ -113,6 +114,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation if (m_scenePresence.IsChildAgent) return; +// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Removing animation {0} for {1}", animID, m_scenePresence.Name); + if (m_animations.Remove(animID)) SendAnimPack(); } @@ -503,6 +506,12 @@ namespace OpenSim.Region.Framework.Scenes.Animation if (m_scenePresence.IsChildAgent) return; +// m_log.DebugFormat( +// "[SCENE PRESENCE ANIMATOR]: Sending anim pack with animations '{0}', sequence '{1}', uuids '{2}'", +// string.Join(",", Array.ConvertAll(animations, a => a.ToString())), +// string.Join(",", Array.ConvertAll(seqs, s => s.ToString())), +// string.Join(",", Array.ConvertAll(objectIDs, o => o.ToString()))); + m_scenePresence.Scene.ForEachClient( delegate(IClientAPI client) { -- cgit v1.1 From 494e6a5f114372ca417607ff6af3c6d5a3aaae9e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 15 Dec 2012 00:30:17 +0000 Subject: minor: If the physics module tells us that an object has gone out of bounds, more helpfully log the name, id, position and region of that object. --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ff67d6d..af7fae3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2266,11 +2266,14 @@ namespace OpenSim.Region.Framework.Scenes public void PhysicsOutOfBounds(Vector3 pos) { - m_log.Error("[PHYSICS]: Physical Object went out of bounds."); + // Note: This is only being called on the root prim at this time. + + m_log.ErrorFormat( + "[SCENE OBJECT PART]: Physical object {0}, localID {1} went out of bounds at {2} in {3}. Stopping at {4} and making non-physical.", + Name, LocalId, pos, ParentGroup.Scene.Name, AbsolutePosition); RemFlag(PrimFlags.Physics); DoPhysicsPropertyUpdate(false, true); - //ParentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); } public void PhysicsRequestingTerseUpdate() -- cgit v1.1