From e77f91311678154390d09b586fbd8162cd3bb601 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 16 Nov 2016 22:34:56 +0000 Subject: [PATCH] minor: dont let rcvd agentupdates time jump back --- OpenSim/Framework/AgentUpdateArgs.cs | 1 + .../ClientStack/Linden/UDP/LLClientView.cs | 7 +++- .../Region/Framework/Scenes/ScenePresence.cs | 38 +++++++++++++------ 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/OpenSim/Framework/AgentUpdateArgs.cs b/OpenSim/Framework/AgentUpdateArgs.cs index eaa7902d8d..f04d692092 100644 --- a/OpenSim/Framework/AgentUpdateArgs.cs +++ b/OpenSim/Framework/AgentUpdateArgs.cs @@ -82,6 +82,7 @@ namespace OpenSim.Framework public Vector3 ClientAgentPosition; public bool UseClientAgentPosition; public bool NeedsCameraCollision; + public uint lastpacketSequence; public AgentUpdateArgs() { diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 46c6a19e9d..8d07bae155 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -6251,9 +6251,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP return false; } + uint seq = packet.Header.Sequence; + TotalAgentUpdates++; // dont let ignored updates pollute this throttles - if(SceneAgent == null || SceneAgent.IsChildAgent || SceneAgent.IsInTransit) + if(SceneAgent == null || SceneAgent.IsChildAgent || + SceneAgent.IsInTransit || seq <= m_thisAgentUpdateArgs.lastpacketSequence ) { // throttle reset is done at MoveAgentIntoRegion() // called by scenepresence on completemovement @@ -6261,6 +6264,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP return true; } + m_thisAgentUpdateArgs.lastpacketSequence = seq; + bool movement = CheckAgentMovementUpdateSignificance(x); bool camera = CheckAgentCameraUpdateSignificance(x); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3378eade7c..f73d54e249 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 ///