From 1fabdcc43cc2d62ff03888166582b25884056e94 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 26 Jul 2013 01:04:16 +0100 Subject: If a returning teleport starts to reuse a downgraded child connection that was a previous root agent, do not close that child agent at the end of the 15 sec teleport timer. This prevents an issue if the user teleports back to the neighbour simulator of a source before 15 seconds have elapsed. This more closely emulates observed linden behaviour, though the timeout there is 50 secs and applies to all the pre-teleport agents. Currently sticks a DoNotClose flag on ScenePresence though this may be temporary as possibly it could be incorporated into the ETM state machine --- OpenSim/Region/Framework/Scenes/Scene.cs | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 84fdef0..f4622b6 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3682,19 +3682,26 @@ namespace OpenSim.Region.Framework.Scenes { ScenePresence sp = GetScenePresence(agent.AgentID); - if (sp != null && !sp.IsChildAgent) + if (sp != null) { - // 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 (sp.ControllingClient != null) - sp.ControllingClient.Close(true); + 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); + + if (sp.ControllingClient != null) + sp.ControllingClient.Close(true); - sp = null; + sp = null; + } + else + { + sp.DoNotClose = true; + } } // Optimistic: add or update the circuit data with the new agent circuit data and teleport flags. -- cgit v1.1 From 72ed49af5f864e50fa4453849a94dd9d46533cba Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 26 Jul 2013 01:38:04 +0100 Subject: Reset DoNotClose scene presence teleport flag before pausing. Rename DoNotClose to DoNotCloseAfterTeleport --- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f4622b6..705660d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3700,7 +3700,7 @@ namespace OpenSim.Region.Framework.Scenes } else { - sp.DoNotClose = true; + sp.DoNotCloseAfterTeleport = true; } } -- cgit v1.1 From 878ce1e6b2b96043052015732286141f5b71310b Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 25 Jul 2013 23:44:58 -0700 Subject: This should fix all issues with teleports. One should be able to TP as fast as needed. (Although sometimes Justin's state machine kicks in and doesn't let you) The EventQueues are a hairy mess, and it's very easy to mess things up. But it looks like this commit makes them work right. Here's what's going on: - Child and root agents are only closed after 15 sec, maybe - If the user comes back, they aren't closed, and everything is reused - On the receiving side, clients and scene presences are reused if they already exist - Caps are always recreated (this is where I spent most of my time!). It turns out that, because the agents carry the seeds around, the seed gets the same URL, except for the root agent coming back to a far away region, which gets a new seed (because we don't know what was its seed in the departing region, and we can't send it back to the client when the agent returns there). --- OpenSim/Region/Framework/Scenes/Scene.cs | 61 +++++++++++++++----------------- 1 file changed, 29 insertions(+), 32 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 705660d..6d0b13f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2805,6 +2805,7 @@ namespace OpenSim.Region.Framework.Scenes { ScenePresence sp; bool vialogin; + bool reallyNew = true; // Validation occurs in LLUDPServer // @@ -2856,6 +2857,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.WarnFormat( "[SCENE]: Already found {0} scene presence for {1} in {2} when asked to add new scene presence", sp.IsChildAgent ? "child" : "root", sp.Name, RegionInfo.RegionName); + reallyNew = false; } // We must set this here so that TriggerOnNewClient and TriggerOnClientLogin can determine whether the @@ -2867,7 +2869,9 @@ namespace OpenSim.Region.Framework.Scenes // places. However, we still need to do it here for NPCs. CacheUserName(sp, aCircuit); - EventManager.TriggerOnNewClient(client); + if (reallyNew) + EventManager.TriggerOnNewClient(client); + if (vialogin) EventManager.TriggerOnClientLogin(client); } @@ -3426,15 +3430,8 @@ namespace OpenSim.Region.Framework.Scenes if (closeChildAgents && isChildAgent) { // Tell a single agent to disconnect from the region. - IEventQueue eq = RequestModuleInterface(); - if (eq != null) - { - eq.DisableSimulator(RegionInfo.RegionHandle, avatar.UUID); - } - else - { - avatar.ControllingClient.SendShutdownConnectionNotice(); - } + // Let's do this via UDP + avatar.ControllingClient.SendShutdownConnectionNotice(); } // Only applies to root agents. @@ -3686,21 +3683,29 @@ namespace OpenSim.Region.Framework.Scenes { 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); - - if (sp.ControllingClient != null) - sp.ControllingClient.Close(true); + // We have a root agent. Is it in transit? + if (!EntityTransferModule.IsInTransit(sp.UUID)) + { + // 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 (sp.ControllingClient != null) + sp.ControllingClient.Close(true); - sp = null; + sp = null; + } + else + m_log.WarnFormat("[SCENE]: Existing root scene presence for {0} {1} in {2}, but agent is in trasit", sp.Name, sp.UUID, RegionInfo.RegionName); } else { + // We have a child agent here sp.DoNotCloseAfterTeleport = true; + //m_log.WarnFormat("[SCENE]: Existing child scene presence for {0} {1} in {2}", sp.Name, sp.UUID, RegionInfo.RegionName); } } @@ -3785,9 +3790,12 @@ namespace OpenSim.Region.Framework.Scenes agent.AgentID, RegionInfo.RegionName); sp.AdjustKnownSeeds(); - + if (CapsModule != null) + { CapsModule.SetAgentCapsSeeds(agent); + CapsModule.CreateCaps(agent.AgentID); + } } } @@ -5545,17 +5553,6 @@ namespace OpenSim.Region.Framework.Scenes { reason = "You are banned from the region"; - if (EntityTransferModule.IsInTransit(agentID)) - { - reason = "Agent is still in transit from this region"; - - m_log.WarnFormat( - "[SCENE]: Denying agent {0} entry into {1} since region still has them registered as in transit", - agentID, RegionInfo.RegionName); - - return false; - } - if (Permissions.IsGod(agentID)) { reason = String.Empty; -- cgit v1.1 From dd2c211e62b25f19386c1f4b5bc7ace40efa429a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 26 Jul 2013 07:40:55 -0700 Subject: Comment debug message --- OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 6d0b13f..dec493b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3698,8 +3698,8 @@ namespace OpenSim.Region.Framework.Scenes sp = null; } - else - m_log.WarnFormat("[SCENE]: Existing root scene presence for {0} {1} in {2}, but agent is in trasit", sp.Name, sp.UUID, RegionInfo.RegionName); + //else + // m_log.WarnFormat("[SCENE]: Existing root scene presence for {0} {1} in {2}, but agent is in trasit", sp.Name, sp.UUID, RegionInfo.RegionName); } else { -- cgit v1.1