From 87ad573ec25b830d68a7b81a06a93b888301647a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 18 Sep 2015 02:00:10 +0100 Subject: MapBlockFromGridRegion and Map2BlockFromGridRegion are the same thing --- .../CoreModules/World/WorldMap/MapSearchModule.cs | 21 ++------ .../CoreModules/World/WorldMap/WorldMapModule.cs | 57 +++++----------------- .../Region/Framework/Interfaces/IWorldMapModule.cs | 1 - 3 files changed, 16 insertions(+), 63 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index ab2e064..3a0bdc3 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -201,23 +201,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap data = new MapBlockData(); data.Agents = 0; data.Access = info.Access; - if (flags == 2) // V2 sends this - { - List datas = WorldMap.Map2BlockFromGridRegion(info, flags); - // ugh! V2-3 is very sensitive about the result being - // exactly the same as the requested name + MapBlockData block = new MapBlockData(); + WorldMap.MapBlockFromGridRegion(block, info, flags); - if (regionInfos.Count == 1 && needOriginalName) - datas.ForEach(d => d.Name = mapNameOrig); - - blocks.AddRange(datas); - } - else - { - MapBlockData block = new MapBlockData(); - WorldMap.MapBlockFromGridRegion(block,info, flags); - blocks.Add(block); - } + if (flags == 2 && regionInfos.Count == 1 && needOriginalName) + block.Name = mapNameOrig; + blocks.Add(block); } } diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 59a3499..4c2751f 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -1100,18 +1100,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap if (r == null) continue; MapBlockData block = new MapBlockData(); - if ((flag & 2) == 2) - { - List blocks = Map2BlockFromGridRegion(r, flag); - mapBlocks.AddRange(blocks); - allBlocks.AddRange(blocks); - } - else - { - MapBlockFromGridRegion(block, r, flag); - mapBlocks.Add(block); - allBlocks.Add(block); - } + MapBlockFromGridRegion(block, r, flag); + mapBlocks.Add(block); + allBlocks.Add(block); if (mapBlocks.Count >= 10) { @@ -1128,6 +1119,14 @@ namespace OpenSim.Region.CoreModules.World.WorldMap public void MapBlockFromGridRegion(MapBlockData block, GridRegion r, uint flag) { + if (r == null) + { +// block.Access = (byte)SimAccess.Down; + block.Access = (byte)SimAccess.NonExistent; + block.MapImageId = UUID.Zero; + return; + } + block.Access = r.Access; switch (flag) { @@ -1146,41 +1145,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap block.Y = (ushort)(r.RegionLocY / Constants.RegionSize); block.SizeX = (ushort)r.RegionSizeX; block.SizeY = (ushort)r.RegionSizeY; - } - public List Map2BlockFromGridRegion(GridRegion r, uint flag) - { - List blocks = new List(); - MapBlockData block = new MapBlockData(); - if (r == null) - { - block.Access = (byte)SimAccess.Down; - block.MapImageId = UUID.Zero; - blocks.Add(block); - } - else - { - block.Access = r.Access; - switch (flag & 0xffff) - { - case 0: - block.MapImageId = r.TerrainImage; - break; - case 2: - block.MapImageId = r.ParcelImage; - break; - default: - block.MapImageId = UUID.Zero; - break; - } - block.Name = r.RegionName; - block.X = (ushort)(r.RegionLocX / Constants.RegionSize); - block.Y = (ushort)(r.RegionLocY / Constants.RegionSize); - block.SizeX = (ushort)r.RegionSizeX; - block.SizeY = (ushort)r.RegionSizeY; - blocks.Add(block); - } - return blocks; } public Hashtable OnHTTPThrottled(Hashtable keysvals) diff --git a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs index e9cf4ad..ee7c4ec 100644 --- a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs @@ -36,7 +36,6 @@ namespace OpenSim.Region.Framework.Interfaces /// Generate a map tile for the scene. a terrain texture for this scene /// void GenerateMaptile(); - List Map2BlockFromGridRegion(GridRegion r, uint flag); void MapBlockFromGridRegion(MapBlockData block, GridRegion r, uint flag); } } -- cgit v1.1