diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/AgentUpdateArgs.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 7 | ||||
-rw-r--r-- | OpenSim/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 eaa7902..f04d692 100644 --- a/OpenSim/Framework/AgentUpdateArgs.cs +++ b/OpenSim/Framework/AgentUpdateArgs.cs | |||
@@ -82,6 +82,7 @@ namespace OpenSim.Framework | |||
82 | public Vector3 ClientAgentPosition; | 82 | public Vector3 ClientAgentPosition; |
83 | public bool UseClientAgentPosition; | 83 | public bool UseClientAgentPosition; |
84 | public bool NeedsCameraCollision; | 84 | public bool NeedsCameraCollision; |
85 | public uint lastpacketSequence; | ||
85 | 86 | ||
86 | public AgentUpdateArgs() | 87 | public AgentUpdateArgs() |
87 | { | 88 | { |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 46c6a19..8d07bae 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 | |||
6251 | return false; | 6251 | return false; |
6252 | } | 6252 | } |
6253 | 6253 | ||
6254 | uint seq = packet.Header.Sequence; | ||
6255 | |||
6254 | TotalAgentUpdates++; | 6256 | TotalAgentUpdates++; |
6255 | // dont let ignored updates pollute this throttles | 6257 | // dont let ignored updates pollute this throttles |
6256 | if(SceneAgent == null || SceneAgent.IsChildAgent || SceneAgent.IsInTransit) | 6258 | if(SceneAgent == null || SceneAgent.IsChildAgent || |
6259 | SceneAgent.IsInTransit || seq <= m_thisAgentUpdateArgs.lastpacketSequence ) | ||
6257 | { | 6260 | { |
6258 | // throttle reset is done at MoveAgentIntoRegion() | 6261 | // throttle reset is done at MoveAgentIntoRegion() |
6259 | // called by scenepresence on completemovement | 6262 | // called by scenepresence on completemovement |
@@ -6261,6 +6264,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6261 | return true; | 6264 | return true; |
6262 | } | 6265 | } |
6263 | 6266 | ||
6267 | m_thisAgentUpdateArgs.lastpacketSequence = seq; | ||
6268 | |||
6264 | bool movement = CheckAgentMovementUpdateSignificance(x); | 6269 | bool movement = CheckAgentMovementUpdateSignificance(x); |
6265 | bool camera = CheckAgentCameraUpdateSignificance(x); | 6270 | bool camera = CheckAgentCameraUpdateSignificance(x); |
6266 | 6271 | ||
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 | |||
2318 | Vector3 tocam = CameraPosition - posAdjusted; | 2318 | Vector3 tocam = CameraPosition - posAdjusted; |
2319 | 2319 | ||
2320 | float distTocamlen = tocam.LengthSquared(); | 2320 | float distTocamlen = tocam.LengthSquared(); |
2321 | if (distTocamlen > 0.08f && distTocamlen < 400) | 2321 | if (distTocamlen > 0.01f && distTocamlen < 400) |
2322 | { | 2322 | { |
2323 | distTocamlen = (float)Math.Sqrt(distTocamlen); | 2323 | distTocamlen = (float)Math.Sqrt(distTocamlen); |
2324 | tocam *= (1.0f / distTocamlen); | 2324 | tocam *= (1.0f / distTocamlen); |
@@ -4378,16 +4378,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
4378 | m_log.DebugFormat( | 4378 | m_log.DebugFormat( |
4379 | "[SCENE PRESENCE]: Closing child agents. Checking {0} regions in {1}", | 4379 | "[SCENE PRESENCE]: Closing child agents. Checking {0} regions in {1}", |
4380 | knownRegions.Count, Scene.RegionInfo.RegionName); | 4380 | knownRegions.Count, Scene.RegionInfo.RegionName); |
4381 | //DumpKnownRegions(); | ||
4382 | 4381 | ||
4383 | Util.RegionHandleToRegionLoc(newRegionHandle, out newRegionX, out newRegionY); | 4382 | Util.RegionHandleToRegionLoc(newRegionHandle, out newRegionX, out newRegionY); |
4384 | 4383 | ||
4385 | uint x, y; | 4384 | uint x, y; |
4386 | spRegionSizeInfo regInfo; | 4385 | spRegionSizeInfo regInfo; |
4387 | 4386 | ||
4388 | // this should not be here | ||
4389 | IEventQueue eventQueue = Scene.RequestModuleInterface<IEventQueue>(); | ||
4390 | |||
4391 | foreach (ulong handle in knownRegions) | 4387 | foreach (ulong handle in knownRegions) |
4392 | { | 4388 | { |
4393 | // Don't close the agent on this region yet | 4389 | // Don't close the agent on this region yet |
@@ -4400,16 +4396,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
4400 | Util.RegionHandleToRegionLoc(handle, out x, out y); | 4396 | Util.RegionHandleToRegionLoc(handle, out x, out y); |
4401 | if (m_knownChildRegionsSizeInfo.TryGetValue(handle, out regInfo)) | 4397 | if (m_knownChildRegionsSizeInfo.TryGetValue(handle, out regInfo)) |
4402 | { | 4398 | { |
4403 | |||
4404 | // m_log.Debug("---> x: " + x + "; newx:" + newRegionX + "; Abs:" + (int)Math.Abs((int)(x - newRegionX))); | ||
4405 | // m_log.Debug("---> y: " + y + "; newy:" + newRegionY + "; Abs:" + (int)Math.Abs((int)(y - newRegionY))); | ||
4406 | if (Util.IsOutsideView(RegionViewDistance, x, newRegionX, y, newRegionY, | 4399 | if (Util.IsOutsideView(RegionViewDistance, x, newRegionX, y, newRegionY, |
4407 | regInfo.sizeX, regInfo.sizeY, newRegionSizeX, newRegionSizeY)) | 4400 | regInfo.sizeX, regInfo.sizeY, newRegionSizeX, newRegionSizeY)) |
4408 | { | 4401 | { |
4409 | byebyeRegions.Add(handle); | 4402 | byebyeRegions.Add(handle); |
4410 | // this should not be here | ||
4411 | // if(eventQueue != null) | ||
4412 | /// eventQueue.DisableSimulator(handle,UUID); | ||
4413 | } | 4403 | } |
4414 | } | 4404 | } |
4415 | else | 4405 | else |
@@ -4445,6 +4435,32 @@ namespace OpenSim.Region.Framework.Scenes | |||
4445 | } | 4435 | } |
4446 | } | 4436 | } |
4447 | 4437 | ||
4438 | public void closeAllChildAgents() | ||
4439 | { | ||
4440 | List<ulong> byebyeRegions = new List<ulong>(); | ||
4441 | List<ulong> knownRegions = KnownRegionHandles; | ||
4442 | foreach (ulong handle in knownRegions) | ||
4443 | { | ||
4444 | if (handle != Scene.RegionInfo.RegionHandle) | ||
4445 | { | ||
4446 | byebyeRegions.Add(handle); | ||
4447 | RemoveNeighbourRegion(handle); | ||
4448 | Scene.CapsModule.DropChildSeed(UUID, handle); | ||
4449 | } | ||
4450 | } | ||
4451 | |||
4452 | if (byebyeRegions.Count > 0) | ||
4453 | { | ||
4454 | m_log.Debug("[SCENE PRESENCE]: Closing " + byebyeRegions.Count + " child agents"); | ||
4455 | |||
4456 | AgentCircuitData acd = Scene.AuthenticateHandler.GetAgentCircuitData(UUID); | ||
4457 | string auth = string.Empty; | ||
4458 | if (acd != null) | ||
4459 | auth = acd.SessionID.ToString(); | ||
4460 | m_scene.SceneGridService.SendCloseChildAgentConnections(ControllingClient.AgentId, auth, byebyeRegions); | ||
4461 | } | ||
4462 | } | ||
4463 | |||
4448 | #endregion | 4464 | #endregion |
4449 | 4465 | ||
4450 | /// <summary> | 4466 | /// <summary> |