aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
diff options
context:
space:
mode:
authorDiva Canto2011-06-10 09:16:43 -0700
committerDiva Canto2011-06-10 09:16:43 -0700
commit98d1e7768af945d3516243f3e010cc4e1fc0788a (patch)
tree0c05c04b568995c0154aec90335d40d680950843 /OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
parentThe map breakage is actually at 2048! (diff)
downloadopensim-SC_OLD-98d1e7768af945d3516243f3e010cc4e1fc0788a.zip
opensim-SC_OLD-98d1e7768af945d3516243f3e010cc4e1fc0788a.tar.gz
opensim-SC_OLD-98d1e7768af945d3516243f3e010cc4e1fc0788a.tar.bz2
opensim-SC_OLD-98d1e7768af945d3516243f3e010cc4e1fc0788a.tar.xz
New method for resetting the map on HG: do it only once upon changing grids, and reset only exactly the map blocks that had regions in them. WARNING: this fetches all the regions from the Grid service, so there is a chance that this is a really bad idea in large grids. Pushing it for testing.
Diffstat (limited to 'OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs66
1 files changed, 33 insertions, 33 deletions
diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
index f066f83..fd2cc20 100644
--- a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs
@@ -59,44 +59,44 @@ namespace OpenSim.Region.CoreModules.Hypergrid
59 59
60 #endregion 60 #endregion
61 61
62 protected override void GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag) 62 //protected override void GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag)
63 { 63 //{
64 List<MapBlockData> mapBlocks = new List<MapBlockData>(); 64 // List<MapBlockData> mapBlocks = new List<MapBlockData>();
65 List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, 65 // List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
66 minX * (int)Constants.RegionSize, maxX * (int)Constants.RegionSize, 66 // minX * (int)Constants.RegionSize, maxX * (int)Constants.RegionSize,
67 minY * (int)Constants.RegionSize, maxY * (int)Constants.RegionSize); 67 // minY * (int)Constants.RegionSize, maxY * (int)Constants.RegionSize);
68 68
69 foreach (GridRegion r in regions) 69 // foreach (GridRegion r in regions)
70 { 70 // {
71 uint x = 0, y = 0; 71 // uint x = 0, y = 0;
72 long handle = 0; 72 // long handle = 0;
73 if (r.RegionSecret != null && r.RegionSecret != string.Empty) 73 // if (r.RegionSecret != null && r.RegionSecret != string.Empty)
74 { 74 // {
75 if (long.TryParse(r.RegionSecret, out handle)) 75 // if (long.TryParse(r.RegionSecret, out handle))
76 { 76 // {
77 Utils.LongToUInts((ulong)handle, out x, out y); 77 // Utils.LongToUInts((ulong)handle, out x, out y);
78 x = x / Constants.RegionSize; 78 // x = x / Constants.RegionSize;
79 y = y / Constants.RegionSize; 79 // y = y / Constants.RegionSize;
80 } 80 // }
81 } 81 // }
82 82
83 if (handle == 0 || 83 // if (handle == 0 ||
84 // Check the distance from the current region 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)) 85 // (handle != 0 && Math.Abs((int)(x - m_scene.RegionInfo.RegionLocX)) < 4096 && Math.Abs((int)(y - m_scene.RegionInfo.RegionLocY)) < 4096))
86 { 86 // {
87 MapBlockData block = new MapBlockData(); 87 // MapBlockData block = new MapBlockData();
88 MapBlockFromGridRegion(block, r); 88 // MapBlockFromGridRegion(block, r);
89 mapBlocks.Add(block); 89 // mapBlocks.Add(block);
90 } 90 // }
91 } 91 // }
92 92
93 // Different from super 93 // // Different from super
94 FillInMap(mapBlocks, minX, minY, maxX, maxY); 94 // //FillInMap(mapBlocks, minX, minY, maxX, maxY);
95 // 95 // //
96 96
97 remoteClient.SendMapBlock(mapBlocks, 0); 97 // remoteClient.SendMapBlock(mapBlocks, 0);
98 98
99 } 99 //}
100 100
101 101
102 private void FillInMap(List<MapBlockData> mapBlocks, int minX, int minY, int maxX, int maxY) 102 private void FillInMap(List<MapBlockData> mapBlocks, int minX, int minY, int maxX, int maxY)