aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs28
1 files changed, 24 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
index 5ab334f..0781de0 100644
--- a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
@@ -25,6 +25,7 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System;
28using System.Collections.Generic; 29using System.Collections.Generic;
29using System.Reflection; 30using System.Reflection;
30using log4net; 31using log4net;
@@ -58,7 +59,7 @@ namespace OpenSim.Region.CoreModules.Hypergrid
58 59
59 #endregion 60 #endregion
60 61
61 protected override void GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag) 62 protected override List<MapBlockData> GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag)
62 { 63 {
63 List<MapBlockData> mapBlocks = new List<MapBlockData>(); 64 List<MapBlockData> mapBlocks = new List<MapBlockData>();
64 List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, 65 List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
@@ -67,9 +68,26 @@ namespace OpenSim.Region.CoreModules.Hypergrid
67 68
68 foreach (GridRegion r in regions) 69 foreach (GridRegion r in regions)
69 { 70 {
70 MapBlockData block = new MapBlockData(); 71 uint x = 0, y = 0;
71 MapBlockFromGridRegion(block, r); 72 long handle = 0;
72 mapBlocks.Add(block); 73 if (r.RegionSecret != null && r.RegionSecret != string.Empty)
74 {
75 if (long.TryParse(r.RegionSecret, out handle))
76 {
77 Utils.LongToUInts((ulong)handle, out x, out y);
78 x = x / Constants.RegionSize;
79 y = y / Constants.RegionSize;
80 }
81 }
82
83 if (handle == 0 ||
84 // Check the distance from the current region
85 (handle != 0 && Math.Abs((int)(x - m_scene.RegionInfo.RegionLocX)) < 4096 && Math.Abs((int)(y - m_scene.RegionInfo.RegionLocY)) < 4096))
86 {
87 MapBlockData block = new MapBlockData();
88 MapBlockFromGridRegion(block, r);
89 mapBlocks.Add(block);
90 }
73 } 91 }
74 92
75 // Different from super 93 // Different from super
@@ -77,6 +95,8 @@ namespace OpenSim.Region.CoreModules.Hypergrid
77 // 95 //
78 96
79 remoteClient.SendMapBlock(mapBlocks, 0); 97 remoteClient.SendMapBlock(mapBlocks, 0);
98
99 return mapBlocks;
80 } 100 }
81 101
82 102