aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDiva Canto2011-05-30 17:15:55 -0700
committerDiva Canto2011-05-30 17:15:55 -0700
commitd473d9975e70366d0fd16276c9bafd5ec269dcd9 (patch)
tree050a191f6fb4c3a6a480ef6e31016a585e4ecb30 /OpenSim
parentAdding MSSQL connectionString example (diff)
downloadopensim-SC-d473d9975e70366d0fd16276c9bafd5ec269dcd9.zip
opensim-SC-d473d9975e70366d0fd16276c9bafd5ec269dcd9.tar.gz
opensim-SC-d473d9975e70366d0fd16276c9bafd5ec269dcd9.tar.bz2
opensim-SC-d473d9975e70366d0fd16276c9bafd5ec269dcd9.tar.xz
Improved reuse on the WorldMap/WorldMapModule.cs
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs20
1 files changed, 5 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 0cacf2d..10e1631 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -233,20 +233,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
233 } 233 }
234 if (lookup) 234 if (lookup)
235 { 235 {
236 List<MapBlockData> mapBlocks = new List<MapBlockData>(); ; 236 List<MapBlockData> mapBlocks = GetAndSendBlocks(avatarPresence.ControllingClient, (int)(m_scene.RegionInfo.RegionLocX) - 4, (int)(m_scene.RegionInfo.RegionLocY) - 4,
237 237 (int)(m_scene.RegionInfo.RegionLocX) + 4, (int)(m_scene.RegionInfo.RegionLocY) + 4, 0);
238 List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
239 (int)(m_scene.RegionInfo.RegionLocX - 8) * (int)Constants.RegionSize,
240 (int)(m_scene.RegionInfo.RegionLocX + 8) * (int)Constants.RegionSize,
241 (int)(m_scene.RegionInfo.RegionLocY - 8) * (int)Constants.RegionSize,
242 (int)(m_scene.RegionInfo.RegionLocY + 8) * (int)Constants.RegionSize);
243 foreach (GridRegion r in regions)
244 {
245 MapBlockData block = new MapBlockData();
246 MapBlockFromGridRegion(block, r);
247 mapBlocks.Add(block);
248 }
249 avatarPresence.ControllingClient.SendMapBlock(mapBlocks, 0);
250 238
251 lock (cachedMapBlocks) 239 lock (cachedMapBlocks)
252 cachedMapBlocks = mapBlocks; 240 cachedMapBlocks = mapBlocks;
@@ -832,7 +820,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
832 } 820 }
833 } 821 }
834 822
835 protected virtual void GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag) 823 protected virtual List<MapBlockData> GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag)
836 { 824 {
837 List<MapBlockData> mapBlocks = new List<MapBlockData>(); 825 List<MapBlockData> mapBlocks = new List<MapBlockData>();
838 List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, 826 List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
@@ -847,6 +835,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
847 mapBlocks.Add(block); 835 mapBlocks.Add(block);
848 } 836 }
849 remoteClient.SendMapBlock(mapBlocks, 0); 837 remoteClient.SendMapBlock(mapBlocks, 0);
838
839 return mapBlocks;
850 } 840 }
851 841
852 protected void MapBlockFromGridRegion(MapBlockData block, GridRegion r) 842 protected void MapBlockFromGridRegion(MapBlockData block, GridRegion r)