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

View File

@ -1064,7 +1064,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
} }
// Fill a passed MapBlockData from a GridRegion // 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(); MapBlockData block = new MapBlockData();
@ -1090,7 +1090,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
return block; return block;
} }
protected List<MapBlockData> Map2BlockFromGridRegion(GridRegion r, uint flag) public List<MapBlockData> Map2BlockFromGridRegion(GridRegion r, uint flag)
{ {
List<MapBlockData> blocks = new List<MapBlockData>(); List<MapBlockData> blocks = new List<MapBlockData>();
MapBlockData block = new 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 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 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 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 /// Generate a map tile for the scene. a terrain texture for this scene
/// </summary> /// </summary>
void GenerateMaptile(); void GenerateMaptile();
List<MapBlockData> Map2BlockFromGridRegion(GridRegion r, uint flag);
MapBlockData MapBlockFromGridRegion(GridRegion r, uint flag);
} }
} }