Fixes a bug where map search results pertaining to varregions would only send the SW-most corner of the varregions; the other areas, when clicked, would result a blue circle, meaning that the viewer didn't know about those areas. This is still not quite right, as all the areas appear to be in the same coordinates, but it's good enough for now.

bullet-2.82
Diva Canto 2014-05-27 10:13:24 -07:00
parent d2877b9cd4
commit e19c830a6c
3 changed files with 33 additions and 20 deletions

View File

@ -49,6 +49,18 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
List<Scene> m_scenes = new List<Scene>();
List<UUID> m_Clients;
IWorldMapModule m_WorldMap;
IWorldMapModule WorldMap
{
get
{
if (m_WorldMap == null)
m_WorldMap = m_scene.RequestModuleInterface<IWorldMapModule>();
return m_WorldMap;
}
}
#region ISharedRegionModule Members
public void Initialise(IConfigSource source)
{
@ -64,6 +76,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
m_scenes.Add(scene);
scene.EventManager.OnNewClient += OnNewClient;
m_Clients = new List<UUID>();
}
public void RemoveRegion(Scene scene)
@ -129,7 +142,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
private void OnMapNameRequest(IClientAPI remoteClient, string mapName, uint flags)
{
List<MapBlockData> blocks = new List<MapBlockData>();
MapBlockData data;
if (mapName.Length < 3 || (mapName.EndsWith("#") && mapName.Length < 4))
{
// final block, closing the search result
@ -173,24 +185,20 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
{
foreach (GridRegion info in regionInfos)
{
data = new MapBlockData();
data.Agents = 0;
data.Access = info.Access;
if (flags == 2) // V2 sends this
data.MapImageId = UUID.Zero;
if ((flags & 2) == 2) // V2 sends this
{
List<MapBlockData> datas = WorldMap.Map2BlockFromGridRegion(info, flags);
// ugh! V2-3 is very sensitive about the result being
// exactly the same as the requested name
if (regionInfos.Count == 1 && (mapName != mapNameOrig))
datas.ForEach(d => d.Name = mapNameOrig);
blocks.AddRange(datas);
}
else
data.MapImageId = info.TerrainImage;
// ugh! V2-3 is very sensitive about the result being
// exactly the same as the requested name
if (regionInfos.Count == 1 && (mapName != mapNameOrig))
data.Name = mapNameOrig;
else
data.Name = info.RegionName;
data.RegionFlags = 0; // TODO not used?
data.WaterHeight = 0; // not used
data.X = (ushort)Util.WorldToRegionLoc((uint)info.RegionLocX);
data.Y = (ushort)Util.WorldToRegionLoc((uint)info.RegionLocY);
blocks.Add(data);
{
MapBlockData data = WorldMap.MapBlockFromGridRegion(info, flags);
}
}
}

View File

@ -1064,7 +1064,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
}
// Fill a passed MapBlockData from a GridRegion
protected MapBlockData MapBlockFromGridRegion(GridRegion r, uint flag)
public MapBlockData MapBlockFromGridRegion(GridRegion r, uint flag)
{
MapBlockData block = new MapBlockData();
@ -1090,7 +1090,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
return block;
}
protected List<MapBlockData> Map2BlockFromGridRegion(GridRegion r, uint flag)
public List<MapBlockData> Map2BlockFromGridRegion(GridRegion r, uint flag)
{
List<MapBlockData> blocks = new List<MapBlockData>();
MapBlockData block = new MapBlockData();

View File

@ -24,6 +24,9 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System.Collections.Generic;
using OpenSim.Framework;
using OpenSim.Services.Interfaces;
namespace OpenSim.Region.Framework.Interfaces
{
@ -33,5 +36,7 @@ namespace OpenSim.Region.Framework.Interfaces
/// Generate a map tile for the scene. a terrain texture for this scene
/// </summary>
void GenerateMaptile();
List<MapBlockData> Map2BlockFromGridRegion(GridRegion r, uint flag);
MapBlockData MapBlockFromGridRegion(GridRegion r, uint flag);
}
}