diff options
author | UbitUmarov | 2019-04-05 14:43:48 +0100 |
---|---|---|
committer | UbitUmarov | 2019-04-05 14:43:48 +0100 |
commit | 5ed2b5c990a9d0037a15347cb8bb4db1a105c5e8 (patch) | |
tree | fc665c2db43d017bed7a30ca84073814e7c16823 /OpenSim | |
parent | temp workaround on sits culling (diff) | |
download | opensim-SC-5ed2b5c990a9d0037a15347cb8bb4db1a105c5e8.zip opensim-SC-5ed2b5c990a9d0037a15347cb8bb4db1a105c5e8.tar.gz opensim-SC-5ed2b5c990a9d0037a15347cb8bb4db1a105c5e8.tar.bz2 opensim-SC-5ed2b5c990a9d0037a15347cb8bb4db1a105c5e8.tar.xz |
try handle the special case MaxRegionsViewDistance = 0 (agents only see void around region, even if there are regions around
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 50 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 |
2 files changed, 42 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 8668558..75d7bc5 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -1057,6 +1057,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1057 | } | 1057 | } |
1058 | } | 1058 | } |
1059 | } | 1059 | } |
1060 | else | ||
1061 | { | ||
1062 | if(!sp.IsInLocalTransit || sp.RegionViewDistance == 0) | ||
1063 | { | ||
1064 | // this will be closed by callback | ||
1065 | if (agentCircuit.ChildrenCapSeeds != null) | ||
1066 | agentCircuit.ChildrenCapSeeds.Remove(sp.RegionHandle); | ||
1067 | } | ||
1068 | } | ||
1060 | 1069 | ||
1061 | string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);; | 1070 | string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);; |
1062 | 1071 | ||
@@ -1129,7 +1138,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1129 | 1138 | ||
1130 | agent.SenderWantsToWaitForRoot = true; | 1139 | agent.SenderWantsToWaitForRoot = true; |
1131 | 1140 | ||
1132 | if(!sp.IsInLocalTransit) | 1141 | if(!sp.IsInLocalTransit || sp.RegionViewDistance == 0) |
1133 | SetNewCallbackURL(agent, sp.Scene.RegionInfo); | 1142 | SetNewCallbackURL(agent, sp.Scene.RegionInfo); |
1134 | 1143 | ||
1135 | // Reset the do not close flag. This must be done before the destination opens child connections (here | 1144 | // Reset the do not close flag. This must be done before the destination opens child connections (here |
@@ -1565,6 +1574,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1565 | 1574 | ||
1566 | public ScenePresence CrossAsync(ScenePresence agent, bool isFlying) | 1575 | public ScenePresence CrossAsync(ScenePresence agent, bool isFlying) |
1567 | { | 1576 | { |
1577 | if(agent.RegionViewDistance == 0) | ||
1578 | return agent; | ||
1579 | |||
1568 | Vector3 newpos; | 1580 | Vector3 newpos; |
1569 | EntityTransferContext ctx = new EntityTransferContext(); | 1581 | EntityTransferContext ctx = new EntityTransferContext(); |
1570 | string failureReason; | 1582 | string failureReason; |
@@ -1994,7 +2006,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1994 | List<GridRegion> RegionsInView(Vector3 pos, RegionInfo curregion, List<GridRegion> fullneighbours, float viewrange) | 2006 | List<GridRegion> RegionsInView(Vector3 pos, RegionInfo curregion, List<GridRegion> fullneighbours, float viewrange) |
1995 | { | 2007 | { |
1996 | List<GridRegion> ret = new List<GridRegion>(); | 2008 | List<GridRegion> ret = new List<GridRegion>(); |
1997 | if(fullneighbours.Count == 0) | 2009 | if(fullneighbours.Count == 0 || viewrange == 0) |
1998 | return ret; | 2010 | return ret; |
1999 | 2011 | ||
2000 | int curX = (int)Util.RegionToWorldLoc(curregion.RegionLocX) + (int)pos.X; | 2012 | int curX = (int)Util.RegionToWorldLoc(curregion.RegionLocX) + (int)pos.X; |
@@ -2036,7 +2048,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2036 | /// <param name="sp"></param> | 2048 | /// <param name="sp"></param> |
2037 | public void EnableChildAgents(ScenePresence sp) | 2049 | public void EnableChildAgents(ScenePresence sp) |
2038 | { | 2050 | { |
2039 | // assumes that out of view range regions are disconnected by the previus region | 2051 | // assumes that out of view range regions are disconnected by the previous region |
2040 | 2052 | ||
2041 | Scene spScene = sp.Scene; | 2053 | Scene spScene = sp.Scene; |
2042 | RegionInfo regionInfo = spScene.RegionInfo; | 2054 | RegionInfo regionInfo = spScene.RegionInfo; |
@@ -2046,8 +2058,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2046 | 2058 | ||
2047 | ulong currentRegionHandler = regionInfo.RegionHandle; | 2059 | ulong currentRegionHandler = regionInfo.RegionHandle; |
2048 | 2060 | ||
2049 | List<GridRegion> fullneighbours = GetNeighbors(sp); | 2061 | List<GridRegion> neighbours; |
2050 | List<GridRegion> neighbours = RegionsInView(sp.AbsolutePosition, regionInfo, fullneighbours, sp.RegionViewDistance); | 2062 | if (sp.RegionViewDistance > 0) |
2063 | { | ||
2064 | List<GridRegion> fullneighbours = GetNeighbors(sp); | ||
2065 | neighbours = RegionsInView(sp.AbsolutePosition, regionInfo, fullneighbours, sp.RegionViewDistance); | ||
2066 | } | ||
2067 | else | ||
2068 | neighbours = new List<GridRegion>(); | ||
2051 | 2069 | ||
2052 | LinkedList<ulong> previousRegionNeighbourHandles; | 2070 | LinkedList<ulong> previousRegionNeighbourHandles; |
2053 | Dictionary<ulong, string> seeds; | 2071 | Dictionary<ulong, string> seeds; |
@@ -2212,7 +2230,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2212 | 2230 | ||
2213 | public void CheckChildAgents(ScenePresence sp) | 2231 | public void CheckChildAgents(ScenePresence sp) |
2214 | { | 2232 | { |
2215 | // assumes that out of view range regions are disconnected by the previus region | 2233 | // assumes that out of view range regions are disconnected by the previous region |
2216 | 2234 | ||
2217 | Scene spScene = sp.Scene; | 2235 | Scene spScene = sp.Scene; |
2218 | RegionInfo regionInfo = spScene.RegionInfo; | 2236 | RegionInfo regionInfo = spScene.RegionInfo; |
@@ -2222,8 +2240,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2222 | 2240 | ||
2223 | ulong currentRegionHandler = regionInfo.RegionHandle; | 2241 | ulong currentRegionHandler = regionInfo.RegionHandle; |
2224 | 2242 | ||
2225 | List<GridRegion> fullneighbours = GetNeighbors(sp); | 2243 | List<GridRegion> neighbours; |
2226 | List<GridRegion> neighbours = RegionsInView(sp.AbsolutePosition, regionInfo, fullneighbours, sp.RegionViewDistance); | 2244 | if (sp.RegionViewDistance > 0) |
2245 | { | ||
2246 | List<GridRegion> fullneighbours = GetNeighbors(sp); | ||
2247 | neighbours = RegionsInView(sp.AbsolutePosition, regionInfo, fullneighbours, sp.RegionViewDistance); | ||
2248 | } | ||
2249 | else | ||
2250 | neighbours = new List<GridRegion>(); | ||
2227 | 2251 | ||
2228 | LinkedList<ulong> previousRegionNeighbourHandles = new LinkedList<ulong>(sp.KnownRegions.Keys); | 2252 | LinkedList<ulong> previousRegionNeighbourHandles = new LinkedList<ulong>(sp.KnownRegions.Keys); |
2229 | 2253 | ||
@@ -2342,8 +2366,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2342 | 2366 | ||
2343 | ulong currentRegionHandler = regionInfo.RegionHandle; | 2367 | ulong currentRegionHandler = regionInfo.RegionHandle; |
2344 | 2368 | ||
2345 | List<GridRegion> fullneighbours = GetNeighbors(sp); | 2369 | List<GridRegion> neighbours; |
2346 | List<GridRegion> neighbours = RegionsInView(sp.AbsolutePosition, regionInfo, fullneighbours, sp.RegionViewDistance); | 2370 | if (sp.RegionViewDistance > 0) |
2371 | { | ||
2372 | List<GridRegion> fullneighbours = GetNeighbors(sp); | ||
2373 | neighbours = RegionsInView(sp.AbsolutePosition, regionInfo, fullneighbours, sp.RegionViewDistance); | ||
2374 | } | ||
2375 | else | ||
2376 | neighbours = new List<GridRegion>(); | ||
2347 | 2377 | ||
2348 | LinkedList<ulong> previousRegionNeighbourHandles; | 2378 | LinkedList<ulong> previousRegionNeighbourHandles; |
2349 | Dictionary<ulong, string> seeds; | 2379 | Dictionary<ulong, string> seeds; |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index c728d9b..aea3a8d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1651,8 +1651,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1651 | m_previusParcelUUID = UUID.Zero; | 1651 | m_previusParcelUUID = UUID.Zero; |
1652 | m_currentParcelHide = false; | 1652 | m_currentParcelHide = false; |
1653 | m_currentParcelUUID = UUID.Zero; | 1653 | m_currentParcelUUID = UUID.Zero; |
1654 | // FIXME: Set RegionHandle to the region handle of the scene this agent is moving into | 1654 | |
1655 | |||
1656 | CollisionPlane = Vector4.UnitW; | 1655 | CollisionPlane = Vector4.UnitW; |
1657 | 1656 | ||
1658 | // we need to kill this on agents that do not see the new region | 1657 | // we need to kill this on agents that do not see the new region |
@@ -4439,7 +4438,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4439 | // updates priority recalc | 4438 | // updates priority recalc |
4440 | checkRePrioritization(); | 4439 | checkRePrioritization(); |
4441 | 4440 | ||
4442 | if(m_childUpdatesBusy) | 4441 | if(m_childUpdatesBusy || RegionViewDistance == 0) |
4443 | return; | 4442 | return; |
4444 | 4443 | ||
4445 | int tdiff = Util.EnvironmentTickCountSubtract(m_lastChildUpdatesTime); | 4444 | int tdiff = Util.EnvironmentTickCountSubtract(m_lastChildUpdatesTime); |