From e77f91311678154390d09b586fbd8162cd3bb601 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 16 Nov 2016 22:34:56 +0000 Subject: minor: dont let rcvd agentupdates time jump back --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 38 +++++++++++++++++------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3378ead..f73d54e 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2318,7 +2318,7 @@ namespace OpenSim.Region.Framework.Scenes Vector3 tocam = CameraPosition - posAdjusted; float distTocamlen = tocam.LengthSquared(); - if (distTocamlen > 0.08f && distTocamlen < 400) + if (distTocamlen > 0.01f && distTocamlen < 400) { distTocamlen = (float)Math.Sqrt(distTocamlen); tocam *= (1.0f / distTocamlen); @@ -4378,16 +4378,12 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat( "[SCENE PRESENCE]: Closing child agents. Checking {0} regions in {1}", knownRegions.Count, Scene.RegionInfo.RegionName); - //DumpKnownRegions(); Util.RegionHandleToRegionLoc(newRegionHandle, out newRegionX, out newRegionY); uint x, y; spRegionSizeInfo regInfo; - // this should not be here - IEventQueue eventQueue = Scene.RequestModuleInterface(); - foreach (ulong handle in knownRegions) { // Don't close the agent on this region yet @@ -4400,16 +4396,10 @@ namespace OpenSim.Region.Framework.Scenes Util.RegionHandleToRegionLoc(handle, out x, out y); if (m_knownChildRegionsSizeInfo.TryGetValue(handle, out regInfo)) { - - // m_log.Debug("---> x: " + x + "; newx:" + newRegionX + "; Abs:" + (int)Math.Abs((int)(x - newRegionX))); - // m_log.Debug("---> y: " + y + "; newy:" + newRegionY + "; Abs:" + (int)Math.Abs((int)(y - newRegionY))); if (Util.IsOutsideView(RegionViewDistance, x, newRegionX, y, newRegionY, regInfo.sizeX, regInfo.sizeY, newRegionSizeX, newRegionSizeY)) { byebyeRegions.Add(handle); - // this should not be here -// if(eventQueue != null) -/// eventQueue.DisableSimulator(handle,UUID); } } else @@ -4445,6 +4435,32 @@ namespace OpenSim.Region.Framework.Scenes } } + public void closeAllChildAgents() + { + List byebyeRegions = new List(); + List knownRegions = KnownRegionHandles; + foreach (ulong handle in knownRegions) + { + if (handle != Scene.RegionInfo.RegionHandle) + { + byebyeRegions.Add(handle); + RemoveNeighbourRegion(handle); + Scene.CapsModule.DropChildSeed(UUID, handle); + } + } + + if (byebyeRegions.Count > 0) + { + m_log.Debug("[SCENE PRESENCE]: Closing " + byebyeRegions.Count + " child agents"); + + AgentCircuitData acd = Scene.AuthenticateHandler.GetAgentCircuitData(UUID); + string auth = string.Empty; + if (acd != null) + auth = acd.SessionID.ToString(); + m_scene.SceneGridService.SendCloseChildAgentConnections(ControllingClient.AgentId, auth, byebyeRegions); + } + } + #endregion /// -- cgit v1.1