diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index ea2d9b5395..31db778c4a 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1054,7 +1054,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // DECREASING THE WAIT TIME HERE WILL EITHER RESULT IN A VIEWER CRASH OR // IN THE AVIE BEING PLACED IN INFINITY FOR A COUPLE OF SECONDS. Thread.Sleep(15000); - sp.Scene.IncomingCloseAgent(sp.UUID, false); + + if (!sp.DoNotClose) + { + sp.Scene.IncomingCloseAgent(sp.UUID, false); + } + else + { + sp.DoNotClose = false; + } } else // now we have a child agent in this region. diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 84fdef0df6..f4622b698d 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. diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f9190d9999..d3e1946875 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -717,6 +717,13 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Used by the entity transfer module to signal when the presence should not be closed because a subsequent + /// teleport is reusing the connection. + /// + /// May be refactored or move somewhere else soon. + public bool DoNotClose { get; set; } + private float m_speedModifier = 1.0f; public float SpeedModifier