From 1bd712c541bb4f26a0547f5ae463092c21997713 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 8 Jun 2011 16:12:47 -0700 Subject: Reverting the [HG]MapModule to its buggy behavior above 4096. Ppl seem to prefer the color blue, and I have given up trying to make things work above 4096. Revert "Improved reuse on the WorldMap/WorldMapModule.cs" This reverts commit d473d9975e70366d0fd16276c9bafd5ec269dcd9. --- .../CoreModules/World/WorldMap/WorldMapModule.cs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 10e1631..0cacf2d 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -233,8 +233,20 @@ namespace OpenSim.Region.CoreModules.World.WorldMap } if (lookup) { - List mapBlocks = GetAndSendBlocks(avatarPresence.ControllingClient, (int)(m_scene.RegionInfo.RegionLocX) - 4, (int)(m_scene.RegionInfo.RegionLocY) - 4, - (int)(m_scene.RegionInfo.RegionLocX) + 4, (int)(m_scene.RegionInfo.RegionLocY) + 4, 0); + List mapBlocks = new List(); ; + + List regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, + (int)(m_scene.RegionInfo.RegionLocX - 8) * (int)Constants.RegionSize, + (int)(m_scene.RegionInfo.RegionLocX + 8) * (int)Constants.RegionSize, + (int)(m_scene.RegionInfo.RegionLocY - 8) * (int)Constants.RegionSize, + (int)(m_scene.RegionInfo.RegionLocY + 8) * (int)Constants.RegionSize); + foreach (GridRegion r in regions) + { + MapBlockData block = new MapBlockData(); + MapBlockFromGridRegion(block, r); + mapBlocks.Add(block); + } + avatarPresence.ControllingClient.SendMapBlock(mapBlocks, 0); lock (cachedMapBlocks) cachedMapBlocks = mapBlocks; @@ -820,7 +832,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap } } - protected virtual List GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag) + protected virtual void GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag) { List mapBlocks = new List(); List regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID, @@ -835,8 +847,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap mapBlocks.Add(block); } remoteClient.SendMapBlock(mapBlocks, 0); - - return mapBlocks; } protected void MapBlockFromGridRegion(MapBlockData block, GridRegion r) -- cgit v1.1