aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
authorUbitUmarov2016-11-16 22:34:56 +0000
committerUbitUmarov2016-11-16 22:34:56 +0000
commite77f91311678154390d09b586fbd8162cd3bb601 (patch)
tree705a746173a4c95b52573cfc0b561a09fdee9d9b /OpenSim/Region/Framework/Scenes/ScenePresence.cs
parent fix parsing of a vector4 and storing on a lsl quaternion needed for lightSha... (diff)
downloadopensim-SC_OLD-e77f91311678154390d09b586fbd8162cd3bb601.zip
opensim-SC_OLD-e77f91311678154390d09b586fbd8162cd3bb601.tar.gz
opensim-SC_OLD-e77f91311678154390d09b586fbd8162cd3bb601.tar.bz2
opensim-SC_OLD-e77f91311678154390d09b586fbd8162cd3bb601.tar.xz
minor: dont let rcvd agentupdates time jump back
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs38
1 files changed, 27 insertions, 11 deletions
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>