aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorUbitUmarov2017-05-31 23:31:02 +0100
committerUbitUmarov2017-05-31 23:31:02 +0100
commitc68e7b66218a6f85fdca71be2740bf9a15e92f37 (patch)
tree47c76a43f7bcc0543ece9d8efe880e09bac27345 /OpenSim/Region/Framework
parentmantis 8182: update/fix GenerateRandomAnimation(). not updating libomv avatar... (diff)
downloadopensim-SC_OLD-c68e7b66218a6f85fdca71be2740bf9a15e92f37.zip
opensim-SC_OLD-c68e7b66218a6f85fdca71be2740bf9a15e92f37.tar.gz
opensim-SC_OLD-c68e7b66218a6f85fdca71be2740bf9a15e92f37.tar.bz2
opensim-SC_OLD-c68e7b66218a6f85fdca71be2740bf9a15e92f37.tar.xz
change child agents close control; disablesimulator is not a caps event message
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEventQueue.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs64
2 files changed, 28 insertions, 38 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs
index 7af56cb..7edd75a 100644
--- a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs
@@ -39,7 +39,7 @@ namespace OpenSim.Region.Framework.Interfaces
39 bool Enqueue(OSD o, UUID avatarID); 39 bool Enqueue(OSD o, UUID avatarID);
40 40
41 // These are required to decouple Scenes from EventQueueHelper 41 // These are required to decouple Scenes from EventQueueHelper
42 void DisableSimulator(ulong handle, UUID avatarID); 42// void DisableSimulator(ulong handle, UUID avatarID);
43 void EnableSimulator(ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY); 43 void EnableSimulator(ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY);
44 void EstablishAgentCommunication(UUID avatarID, IPEndPoint endPoint, 44 void EstablishAgentCommunication(UUID avatarID, IPEndPoint endPoint,
45 string capsPath, ulong regionHandle, int regionSizeX, int regionSizeY); 45 string capsPath, ulong regionHandle, int regionSizeX, int regionSizeY);
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");