aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs64
1 files changed, 27 insertions, 37 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 55ccb0a..f1e27a5 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1884,7 +1884,8 @@ namespace OpenSim.Region.Framework.Scenes
1884 { 1884 {
1885 get 1885 get
1886 { 1886 {
1887 return new List<ulong>(KnownRegions.Keys); 1887 lock (m_knownChildRegions)
1888 return new List<ulong>(m_knownChildRegions.Keys);
1888 } 1889 }
1889 } 1890 }
1890 1891
@@ -4407,26 +4408,15 @@ namespace OpenSim.Region.Framework.Scenes
4407 4408
4408 } 4409 }
4409 4410
4410 /* useless. Either use MakeChild or delete the presence
4411 public void Reset()
4412 {
4413 // m_log.DebugFormat("[SCENE PRESENCE]: Resetting {0} in {1}", Name, Scene.RegionInfo.RegionName);
4414
4415 // Put the child agent back at the center
4416 AbsolutePosition
4417 = new Vector3(((float)m_scene.RegionInfo.RegionSizeX * 0.5f), ((float)m_scene.RegionInfo.RegionSizeY * 0.5f), 70);
4418
4419 Animator.ResetAnimations();
4420 }
4421 */
4422 /// <summary> 4411 /// <summary>
4423 /// Computes which child agents to close when the scene presence moves to another region. 4412 /// Computes which child agents to close when the scene presence moves to another region.
4424 /// Removes those regions from m_knownRegions. 4413 /// Removes those regions from m_knownRegions.
4425 /// </summary> 4414 /// </summary>
4426 /// <param name="newRegionX">The new region's x on the map</param> 4415 /// <param name="newRegionHandle">The new region's handle</param>
4427 /// <param name="newRegionY">The new region's y on the map</param> 4416 /// <param name="newRegionSizeX">The new region's size x</param>
4417 /// <param name="newRegionSizeY">The new region's size y</param>
4428 /// <returns></returns> 4418 /// <returns></returns>
4429 public void CloseChildAgents(bool logout, ulong newRegionHandle, int newRegionSizeX, int newRegionSizeY) 4419 public List<ulong> GetChildAgentsToClose(ulong newRegionHandle, int newRegionSizeX, int newRegionSizeY)
4430 { 4420 {
4431 uint newRegionX, newRegionY; 4421 uint newRegionX, newRegionY;
4432 List<ulong> byebyeRegions = new List<ulong>(); 4422 List<ulong> byebyeRegions = new List<ulong>();
@@ -4442,37 +4432,37 @@ namespace OpenSim.Region.Framework.Scenes
4442 4432
4443 foreach (ulong handle in knownRegions) 4433 foreach (ulong handle in knownRegions)
4444 { 4434 {
4445 // Don't close the agent on this region yet 4435 if(newRegionY == 0) // HG
4446 if (handle != Scene.RegionInfo.RegionHandle) 4436 byebyeRegions.Add(handle);
4437 else
4447 { 4438 {
4448 if (logout) 4439 Util.RegionHandleToRegionLoc(handle, out x, out y);
4449 byebyeRegions.Add(handle); 4440 if (m_knownChildRegionsSizeInfo.TryGetValue(handle, out regInfo))
4450 else
4451 { 4441 {
4452 Util.RegionHandleToRegionLoc(handle, out x, out y); 4442// if (Util.IsOutsideView(RegionViewDistance, x, newRegionX, y, newRegionY,
4453 if (m_knownChildRegionsSizeInfo.TryGetValue(handle, out regInfo)) 4443 // for now need to close all but first order bc RegionViewDistance it the target value not ours
4444 if (Util.IsOutsideView(255, x, newRegionX, y, newRegionY,
4445 regInfo.sizeX, regInfo.sizeY, newRegionSizeX, newRegionSizeY))
4454 { 4446 {
4455 if (Util.IsOutsideView(RegionViewDistance, x, newRegionX, y, newRegionY, 4447 byebyeRegions.Add(handle);
4456 regInfo.sizeX, regInfo.sizeY, newRegionSizeX, newRegionSizeY))
4457 {
4458 byebyeRegions.Add(handle);
4459 }
4460 } 4448 }
4461 else 4449 }
4450 else
4451 {
4452 if (Util.IsOutsideView(RegionViewDistance, x, newRegionX, y, newRegionY,
4453 (int)Constants.RegionSize, (int)Constants.RegionSize, newRegionSizeX, newRegionSizeY))
4462 { 4454 {
4463 if (Util.IsOutsideView(RegionViewDistance, x, newRegionX, y, newRegionY, 4455 byebyeRegions.Add(handle);
4464 (int)Constants.RegionSize, (int)Constants.RegionSize, newRegionSizeX, newRegionSizeY))
4465 {
4466 byebyeRegions.Add(handle);
4467 // this should not be here
4468// if(eventQueue != null)
4469// eventQueue.DisableSimulator(handle,UUID);
4470 }
4471 } 4456 }
4472 } 4457 }
4473 } 4458 }
4474 } 4459 }
4460 return byebyeRegions;
4461 }
4475 4462
4463 public void CloseChildAgents(List<ulong> byebyeRegions)
4464 {
4465 byebyeRegions.Remove(Scene.RegionInfo.RegionHandle);
4476 if (byebyeRegions.Count > 0) 4466 if (byebyeRegions.Count > 0)
4477 { 4467 {
4478 m_log.Debug("[SCENE PRESENCE]: Closing " + byebyeRegions.Count + " child agents"); 4468 m_log.Debug("[SCENE PRESENCE]: Closing " + byebyeRegions.Count + " child agents");