diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 37 |
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) |