aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorRobert Adams2014-03-20 22:10:27 -0700
committerRobert Adams2014-05-31 12:19:50 -0700
commit22dade6463ce55945c5059af0dc115318297dc1c (patch)
tree6e537b8856c5484ab54014625b38f45003aa6bd1 /OpenSim/Region
parentvarregion: send terrain patches from where the avatar outward if the parameter (diff)
downloadopensim-SC_OLD-22dade6463ce55945c5059af0dc115318297dc1c.zip
opensim-SC_OLD-22dade6463ce55945c5059af0dc115318297dc1c.tar.gz
opensim-SC_OLD-22dade6463ce55945c5059af0dc115318297dc1c.tar.bz2
opensim-SC_OLD-22dade6463ce55945c5059af0dc115318297dc1c.tar.xz
varregion: More tweeking to only sending patches within avatar draw distance.
Still has problems with child avatars.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs13
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs19
3 files changed, 20 insertions, 18 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index e583590..70b0e0a 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -820,7 +820,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
820 agentCircuit.Id0 = currentAgentCircuit.Id0; 820 agentCircuit.Id0 = currentAgentCircuit.Id0;
821 } 821 }
822 822
823 if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY)) 823 // if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY))
824 if (NeedsNewAgent(sp.Scene.DefaultDrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY))
824 { 825 {
825 // brand new agent, let's create a new caps seed 826 // brand new agent, let's create a new caps seed
826 agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); 827 agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath();
@@ -894,7 +895,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
894 895
895 IClientIPEndpoint ipepClient; 896 IClientIPEndpoint ipepClient;
896 string capsPath = String.Empty; 897 string capsPath = String.Empty;
897 if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY)) 898 if (NeedsNewAgent(sp.Scene.DefaultDrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY))
898 { 899 {
899 m_log.DebugFormat( 900 m_log.DebugFormat(
900 "[ENTITY TRANSFER MODULE]: Determined that region {0} at {1},{2} needs new child agent for incoming agent {3} from {4}", 901 "[ENTITY TRANSFER MODULE]: Determined that region {0} at {1},{2} needs new child agent for incoming agent {3} from {4}",
@@ -1070,7 +1071,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1070 1071
1071 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone 1072 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
1072 1073
1073 if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) 1074 if (NeedsClosing(sp.Scene.DefaultDrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
1074 { 1075 {
1075 if (!sp.Scene.IncomingPreCloseClient(sp)) 1076 if (!sp.Scene.IncomingPreCloseClient(sp))
1076 return; 1077 return;
@@ -1140,7 +1141,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1140 1141
1141 IClientIPEndpoint ipepClient; 1142 IClientIPEndpoint ipepClient;
1142 string capsPath = String.Empty; 1143 string capsPath = String.Empty;
1143 if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY)) 1144 if (NeedsNewAgent(sp.Scene.DefaultDrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY))
1144 { 1145 {
1145 m_log.DebugFormat( 1146 m_log.DebugFormat(
1146 "[ENTITY TRANSFER MODULE]: Determined that region {0} at {1},{2} needs new child agent for agent {3} from {4}", 1147 "[ENTITY TRANSFER MODULE]: Determined that region {0} at {1},{2} needs new child agent for agent {3} from {4}",
@@ -1236,7 +1237,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1236 sp.MakeChildAgent(); 1237 sp.MakeChildAgent();
1237 1238
1238 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone 1239 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
1239 if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) 1240 if (NeedsClosing(sp.Scene.DefaultDrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
1240 { 1241 {
1241 if (!sp.Scene.IncomingPreCloseClient(sp)) 1242 if (!sp.Scene.IncomingPreCloseClient(sp))
1242 return; 1243 return;
@@ -2366,7 +2367,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
2366 { 2367 {
2367 // The area to check is as big as the current region. 2368 // The area to check is as big as the current region.
2368 // We presume all adjacent regions are the same size as this region. 2369 // We presume all adjacent regions are the same size as this region.
2369 uint dd = Math.Max((uint)avatar.DrawDistance, 2370 uint dd = Math.Max((uint)avatar.Scene.DefaultDrawDistance,
2370 Math.Max(Scene.RegionInfo.RegionSizeX, Scene.RegionInfo.RegionSizeY)); 2371 Math.Max(Scene.RegionInfo.RegionSizeX, Scene.RegionInfo.RegionSizeY));
2371 2372
2372 uint startX = Util.RegionToWorldLoc(pRegionLocX) - dd + Constants.RegionSize/2; 2373 uint startX = Util.RegionToWorldLoc(pRegionLocX) - dd + Constants.RegionSize/2;
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
index 0d7321d..ad17d6d 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -1054,7 +1054,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
1054 if (presence == null) 1054 if (presence == null)
1055 return ret; 1055 return ret;
1056 1056
1057 // See if there are patches within our view distance to send. 1057 // Compute the area of patches within our draw distance
1058 int startX = (((int) (presence.AbsolutePosition.X - presence.DrawDistance))/Constants.TerrainPatchSize) - 2; 1058 int startX = (((int) (presence.AbsolutePosition.X - presence.DrawDistance))/Constants.TerrainPatchSize) - 2;
1059 startX = Math.Max(startX, 0); 1059 startX = Math.Max(startX, 0);
1060 startX = Math.Min(startX, (int)m_scene.RegionInfo.RegionSizeX/Constants.TerrainPatchSize); 1060 startX = Math.Min(startX, (int)m_scene.RegionInfo.RegionSizeX/Constants.TerrainPatchSize);
@@ -1067,8 +1067,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain
1067 int endY = (((int) (presence.AbsolutePosition.Y + presence.DrawDistance))/Constants.TerrainPatchSize) + 2; 1067 int endY = (((int) (presence.AbsolutePosition.Y + presence.DrawDistance))/Constants.TerrainPatchSize) + 2;
1068 endY = Math.Max(endY, 0); 1068 endY = Math.Max(endY, 0);
1069 endY = Math.Min(endY, (int)m_scene.RegionInfo.RegionSizeY/Constants.TerrainPatchSize); 1069 endY = Math.Min(endY, (int)m_scene.RegionInfo.RegionSizeY/Constants.TerrainPatchSize);
1070 // m_log.DebugFormat("{0} GetModifiedPatchesInViewDistance. start=<{1},{2}>, end=<{3},{4}>", 1070 m_log.DebugFormat("{0} GetModifiedPatchesInViewDistance. ddist={1}, start=<{2},{3}>, end=<{4},{5}>",
1071 // LogHeader, startX, startY, endX, endY); 1071 LogHeader, presence.DrawDistance, startX, startY, endX, endY);
1072 for (int x = startX; x < endX; x++) 1072 for (int x = startX; x < endX; x++)
1073 { 1073 {
1074 for (int y = startY; y < endY; y++) 1074 for (int y = startY; y < endY; y++)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 37353c1..063ac73 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -873,7 +873,8 @@ namespace OpenSim.Region.Framework.Scenes
873 m_sendCoarseLocationsMethod = SendCoarseLocationsDefault; 873 m_sendCoarseLocationsMethod = SendCoarseLocationsDefault;
874 Animator = new ScenePresenceAnimator(this); 874 Animator = new ScenePresenceAnimator(this);
875 PresenceType = type; 875 PresenceType = type;
876 DrawDistance = world.DefaultDrawDistance; 876 // DrawDistance = world.DefaultDrawDistance;
877 DrawDistance = Constants.RegionSize;
877 RegionHandle = world.RegionInfo.RegionHandle; 878 RegionHandle = world.RegionInfo.RegionHandle;
878 ControllingClient = client; 879 ControllingClient = client;
879 Firstname = ControllingClient.FirstName; 880 Firstname = ControllingClient.FirstName;
@@ -1918,8 +1919,8 @@ namespace OpenSim.Region.Framework.Scenes
1918 // When we get to the point of re-computing neighbors everytime this 1919 // When we get to the point of re-computing neighbors everytime this
1919 // changes, then start using the agent's drawdistance rather than the 1920 // changes, then start using the agent's drawdistance rather than the
1920 // region's draw distance. 1921 // region's draw distance.
1921 // DrawDistance = agentData.Far; 1922 DrawDistance = agentData.Far;
1922 DrawDistance = Scene.DefaultDrawDistance; 1923 // DrawDistance = Scene.DefaultDrawDistance;
1923 1924
1924 m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0; 1925 m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0;
1925 m_leftButtonDown = (flags & AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN) != 0; 1926 m_leftButtonDown = (flags & AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN) != 0;
@@ -2277,8 +2278,8 @@ namespace OpenSim.Region.Framework.Scenes
2277 // When we get to the point of re-computing neighbors everytime this 2278 // When we get to the point of re-computing neighbors everytime this
2278 // changes, then start using the agent's drawdistance rather than the 2279 // changes, then start using the agent's drawdistance rather than the
2279 // region's draw distance. 2280 // region's draw distance.
2280 // DrawDistance = agentData.Far; 2281 DrawDistance = agentData.Far;
2281 DrawDistance = Scene.DefaultDrawDistance; 2282 // DrawDistance = Scene.DefaultDrawDistance;
2282 2283
2283 // Check if Client has camera in 'follow cam' or 'build' mode. 2284 // Check if Client has camera in 'follow cam' or 'build' mode.
2284 Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation); 2285 Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation);
@@ -3824,8 +3825,8 @@ namespace OpenSim.Region.Framework.Scenes
3824 // When we get to the point of re-computing neighbors everytime this 3825 // When we get to the point of re-computing neighbors everytime this
3825 // changes, then start using the agent's drawdistance rather than the 3826 // changes, then start using the agent's drawdistance rather than the
3826 // region's draw distance. 3827 // region's draw distance.
3827 // DrawDistance = cAgentData.Far; 3828 DrawDistance = cAgentData.Far;
3828 DrawDistance = Scene.DefaultDrawDistance; 3829 // DrawDistance = Scene.DefaultDrawDistance;
3829 3830
3830 if (cAgentData.Position != marker) // UGH!! 3831 if (cAgentData.Position != marker) // UGH!!
3831 m_pos = cAgentData.Position + offset; 3832 m_pos = cAgentData.Position + offset;
@@ -3935,8 +3936,8 @@ namespace OpenSim.Region.Framework.Scenes
3935 // When we get to the point of re-computing neighbors everytime this 3936 // When we get to the point of re-computing neighbors everytime this
3936 // changes, then start using the agent's drawdistance rather than the 3937 // changes, then start using the agent's drawdistance rather than the
3937 // region's draw distance. 3938 // region's draw distance.
3938 // DrawDistance = cAgent.Far; 3939 DrawDistance = cAgent.Far;
3939 DrawDistance = Scene.DefaultDrawDistance; 3940 // DrawDistance = Scene.DefaultDrawDistance;
3940 3941
3941 if ((cAgent.Throttles != null) && cAgent.Throttles.Length > 0) 3942 if ((cAgent.Throttles != null) && cAgent.Throttles.Length > 0)
3942 ControllingClient.SetChildAgentThrottle(cAgent.Throttles); 3943 ControllingClient.SetChildAgentThrottle(cAgent.Throttles);