aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2015-01-14 19:40:17 +0000
committerJustin Clark-Casey (justincc)2015-01-14 19:45:19 +0000
commitbeef41f24cfdc57e584d19beed423cba83b7f829 (patch)
tree7bbf881eb3cc4ce5fd9d8d8c39c2dbc82126ed9d /OpenSim/Region/CoreModules
parentAlso deleted the option of setting Cap_WebFetchInventoryDescendents from Open... (diff)
downloadopensim-SC_OLD-beef41f24cfdc57e584d19beed423cba83b7f829.zip
opensim-SC_OLD-beef41f24cfdc57e584d19beed423cba83b7f829.tar.gz
opensim-SC_OLD-beef41f24cfdc57e584d19beed423cba83b7f829.tar.bz2
opensim-SC_OLD-beef41f24cfdc57e584d19beed423cba83b7f829.tar.xz
Stop simulators attempting to contact registered but offline regions (RegionFlags.Persistent but not RegioNFlags.RegionOnline) on startup and when an avatar completes a teleport.
This eliminates spurious network calls and failure reporting. This is done by adding RegionFlags to the GridRegion returned data in a backward compatible way as an alternative to multiple IGridService.GetRegionFlags() calls Using a simulator or a grid service older than this commit will just see previous behaviour.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs37
1 files changed, 23 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index cb32eec..089bd4f 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1924,7 +1924,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1924 1924
1925 if (m_regionInfo != null) 1925 if (m_regionInfo != null)
1926 { 1926 {
1927 neighbours = RequestNeighbours(sp, m_regionInfo.RegionLocX, m_regionInfo.RegionLocY); 1927 neighbours = GetNeighbours(sp, m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
1928 } 1928 }
1929 else 1929 else
1930 { 1930 {
@@ -2364,16 +2364,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
2364 } 2364 }
2365 2365
2366 /// <summary> 2366 /// <summary>
2367 /// Return the list of regions that are considered to be neighbours to the given scene. 2367 /// Return the list of online regions that are considered to be neighbours to the given scene.
2368 /// </summary> 2368 /// </summary>
2369 /// <param name="pScene"></param> 2369 /// <param name="avatar"></param>
2370 /// <param name="pRegionLocX"></param> 2370 /// <param name="pRegionLocX"></param>
2371 /// <param name="pRegionLocY"></param> 2371 /// <param name="pRegionLocY"></param>
2372 /// <returns></returns> 2372 /// <returns></returns>
2373 protected List<GridRegion> RequestNeighbours(ScenePresence avatar, uint pRegionLocX, uint pRegionLocY) 2373 protected List<GridRegion> GetNeighbours(ScenePresence avatar, uint pRegionLocX, uint pRegionLocY)
2374 { 2374 {
2375 Scene pScene = avatar.Scene; 2375 Scene pScene = avatar.Scene;
2376 RegionInfo m_regionInfo = pScene.RegionInfo; 2376 RegionInfo m_regionInfo = pScene.RegionInfo;
2377 List<GridRegion> neighbours;
2377 2378
2378 // Leaving this as a "megaregions" computation vs "non-megaregions" computation; it isn't 2379 // Leaving this as a "megaregions" computation vs "non-megaregions" computation; it isn't
2379 // clear what should be done with a "far view" given that megaregions already extended the 2380 // clear what should be done with a "far view" given that megaregions already extended the
@@ -2391,27 +2392,35 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
2391 uint endX = Util.RegionToWorldLoc(pRegionLocX) + dd + Constants.RegionSize/2; 2392 uint endX = Util.RegionToWorldLoc(pRegionLocX) + dd + Constants.RegionSize/2;
2392 uint endY = Util.RegionToWorldLoc(pRegionLocY) + dd + Constants.RegionSize/2; 2393 uint endY = Util.RegionToWorldLoc(pRegionLocY) + dd + Constants.RegionSize/2;
2393 2394
2394 List<GridRegion> neighbours = 2395 neighbours
2395 avatar.Scene.GridService.GetRegionRange(m_regionInfo.ScopeID, (int)startX, (int)endX, (int)startY, (int)endY); 2396 = avatar.Scene.GridService.GetRegionRange(
2396 2397 m_regionInfo.ScopeID, (int)startX, (int)endX, (int)startY, (int)endY);
2397 neighbours.RemoveAll(delegate(GridRegion r) { return r.RegionID == m_regionInfo.RegionID; });
2398 return neighbours;
2399 } 2398 }
2400 else 2399 else
2401 { 2400 {
2402 Vector2 swCorner, neCorner; 2401 Vector2 swCorner, neCorner;
2403 GetMegaregionViewRange(out swCorner, out neCorner); 2402 GetMegaregionViewRange(out swCorner, out neCorner);
2404 2403
2405 List<GridRegion> neighbours 2404 neighbours
2406 = pScene.GridService.GetRegionRange( 2405 = pScene.GridService.GetRegionRange(
2407 m_regionInfo.ScopeID, 2406 m_regionInfo.ScopeID,
2408 (int)Util.RegionToWorldLoc((uint)swCorner.X), (int)Util.RegionToWorldLoc((uint)neCorner.X), 2407 (int)Util.RegionToWorldLoc((uint)swCorner.X), (int)Util.RegionToWorldLoc((uint)neCorner.X),
2409 (int)Util.RegionToWorldLoc((uint)swCorner.Y), (int)Util.RegionToWorldLoc((uint)neCorner.Y) ); 2408 (int)Util.RegionToWorldLoc((uint)swCorner.Y), (int)Util.RegionToWorldLoc((uint)neCorner.Y));
2409 }
2410 2410
2411 neighbours.RemoveAll(delegate(GridRegion r) { return r.RegionID == m_regionInfo.RegionID; }); 2411// neighbours.ForEach(
2412// n =>
2413// m_log.DebugFormat(
2414// "[ENTITY TRANSFER MODULE]: Region flags for {0} as seen by {1} are {2}",
2415// n.RegionName, Scene.Name, n.RegionFlags != null ? n.RegionFlags.ToString() : "not present"));
2412 2416
2413 return neighbours; 2417 // The r.RegionFlags == null check only needs to be made for simulators before 2015-01-14 (pre 0.8.1).
2414 } 2418 neighbours.RemoveAll(
2419 r =>
2420 r.RegionID == m_regionInfo.RegionID
2421 || (r.RegionFlags != null && (r.RegionFlags & OpenSim.Framework.RegionFlags.RegionOnline) == 0));
2422
2423 return neighbours;
2415 } 2424 }
2416 2425
2417 private List<ulong> NewNeighbours(List<ulong> currentNeighbours, List<ulong> previousNeighbours) 2426 private List<ulong> NewNeighbours(List<ulong> currentNeighbours, List<ulong> previousNeighbours)