From 8c0b9080a4fb013d559966fc8c8175fb16162c2d Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 18 Feb 2013 21:09:14 +0100 Subject: Fix an issue where the viewer would request the seed cap before there was a handler for it. --- OpenSim/Region/Framework/Scenes/Scene.cs | 50 ++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e58aadc..7fcbed4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3622,7 +3622,7 @@ namespace OpenSim.Region.Framework.Scenes // TODO: We shouldn't use closeChildAgents here - it's being used by the NPC module to stop // unnecessary operations. This should go away once NPCs have no accompanying IClientAPI if (closeChildAgents && CapsModule != null) - CapsModule.RemoveCaps(agentID); + CapsModule.RemoveCaps(agentID, avatar.ControllingClient.CircuitCode); // // REFACTORING PROBLEM -- well not really a problem, but just to point out that whatever // // this method is doing is HORRIBLE!!! @@ -3853,20 +3853,36 @@ namespace OpenSim.Region.Framework.Scenes return false; } - ScenePresence sp = GetScenePresence(agent.AgentID); - if (sp != null && !sp.IsChildAgent) + // If we have noo presence here or if that presence is a zombie root + // presence that will be kicled, we need a new CAPS object. + if (sp == null || (sp != null && !sp.IsChildAgent)) { - // We have a zombie from a crashed session. - // Or the same user is trying to be root twice here, won't work. - // Kill it. - m_log.WarnFormat( - "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.", - sp.Name, sp.UUID, RegionInfo.RegionName); + if (CapsModule != null) + { + lock (agent) + { + CapsModule.SetAgentCapsSeeds(agent); + CapsModule.CreateCaps(agent.AgentID, agent.circuitcode); + } + } + } + + if (sp != null) + { + if (!sp.IsChildAgent) + { + // We have a zombie from a crashed session. + // Or the same user is trying to be root twice here, won't work. + // Kill it. + m_log.WarnFormat( + "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.", + sp.Name, sp.UUID, RegionInfo.RegionName); - sp.ControllingClient.Close(true, true); - sp = null; + sp.ControllingClient.Close(true, true); + sp = null; + } } lock (agent) @@ -3907,7 +3923,9 @@ namespace OpenSim.Region.Framework.Scenes if (vialogin || (!m_seeIntoBannedRegion)) { if (!AuthorizeUser(agent, out reason)) + { return false; + } } } catch (Exception e) @@ -3922,11 +3940,6 @@ namespace OpenSim.Region.Framework.Scenes RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname, agent.AgentID, agent.circuitcode); - if (CapsModule != null) - { - CapsModule.SetAgentCapsSeeds(agent); - CapsModule.CreateCaps(agent.AgentID); - } } else { @@ -3952,6 +3965,11 @@ namespace OpenSim.Region.Framework.Scenes agent.teleportFlags = teleportFlags; m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); + if (CapsModule != null) + { + CapsModule.ActivateCaps(agent.circuitcode); + } + if (vialogin) { // CleanDroppedAttachments(); -- cgit v1.1 From 34bb2fd015178dd97efb0f6c83f61a079781dcae Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 3 Mar 2013 12:48:36 +0100 Subject: Make Keyframe motion cross regions again --- OpenSim/Region/Framework/Scenes/KeyframeMotion.cs | 1 + OpenSim/Region/Framework/Scenes/Scene.cs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs index 6dc6504..b102e48 100644 --- a/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs +++ b/OpenSim/Region/Framework/Scenes/KeyframeMotion.cs @@ -276,6 +276,7 @@ namespace OpenSim.Region.Framework.Scenes } newMotion.m_timerStopped = false; + newMotion.m_running = true; newMotion.m_isCrossing = false; newMotion.m_waitingCrossing = false; } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 7fcbed4..05d5ccd 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2769,8 +2769,6 @@ namespace OpenSim.Region.Framework.Scenes if (newPosition != Vector3.Zero) newObject.RootPart.GroupPosition = newPosition; - if (newObject.RootPart.KeyframeMotion != null) - newObject.RootPart.KeyframeMotion.UpdateSceneObject(newObject); if (!AddSceneObject(newObject)) { @@ -2798,6 +2796,9 @@ namespace OpenSim.Region.Framework.Scenes // before we restart the scripts, or else some functions won't work. newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); newObject.ResumeScripts(); + + if (newObject.RootPart.KeyframeMotion != null) + newObject.RootPart.KeyframeMotion.UpdateSceneObject(newObject); } // Do this as late as possible so that listeners have full access to the incoming object -- cgit v1.1