aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2014-05-27 10:13:24 -0700
committerDiva Canto2014-05-27 10:13:24 -0700
commite19c830a6cc3e9bf20bcd5208563628923689184 (patch)
tree6aff9ff496a194ff55cd4c34a749c379731590aa
parentDon't report NPC presences. (diff)
downloadopensim-SC_OLD-e19c830a6cc3e9bf20bcd5208563628923689184.zip
opensim-SC_OLD-e19c830a6cc3e9bf20bcd5208563628923689184.tar.gz
opensim-SC_OLD-e19c830a6cc3e9bf20bcd5208563628923689184.tar.bz2
opensim-SC_OLD-e19c830a6cc3e9bf20bcd5208563628923689184.tar.xz
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.
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs44
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs5
3 files changed, 33 insertions, 20 deletions
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
index 1437b1b..de7ea6d 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
@@ -49,6 +49,18 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
49 List<Scene> m_scenes = new List<Scene>(); 49 List<Scene> m_scenes = new List<Scene>();
50 List<UUID> m_Clients; 50 List<UUID> m_Clients;
51 51
52 IWorldMapModule m_WorldMap;
53 IWorldMapModule WorldMap
54 {
55 get
56 {
57 if (m_WorldMap == null)
58 m_WorldMap = m_scene.RequestModuleInterface<IWorldMapModule>();
59 return m_WorldMap;
60 }
61
62 }
63
52 #region ISharedRegionModule Members 64 #region ISharedRegionModule Members
53 public void Initialise(IConfigSource source) 65 public void Initialise(IConfigSource source)
54 { 66 {
@@ -64,6 +76,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
64 m_scenes.Add(scene); 76 m_scenes.Add(scene);
65 scene.EventManager.OnNewClient += OnNewClient; 77 scene.EventManager.OnNewClient += OnNewClient;
66 m_Clients = new List<UUID>(); 78 m_Clients = new List<UUID>();
79
67 } 80 }
68 81
69 public void RemoveRegion(Scene scene) 82 public void RemoveRegion(Scene scene)
@@ -129,7 +142,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
129 private void OnMapNameRequest(IClientAPI remoteClient, string mapName, uint flags) 142 private void OnMapNameRequest(IClientAPI remoteClient, string mapName, uint flags)
130 { 143 {
131 List<MapBlockData> blocks = new List<MapBlockData>(); 144 List<MapBlockData> blocks = new List<MapBlockData>();
132 MapBlockData data;
133 if (mapName.Length < 3 || (mapName.EndsWith("#") && mapName.Length < 4)) 145 if (mapName.Length < 3 || (mapName.EndsWith("#") && mapName.Length < 4))
134 { 146 {
135 // final block, closing the search result 147 // final block, closing the search result
@@ -173,24 +185,20 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
173 { 185 {
174 foreach (GridRegion info in regionInfos) 186 foreach (GridRegion info in regionInfos)
175 { 187 {
176 data = new MapBlockData(); 188 if ((flags & 2) == 2) // V2 sends this
177 data.Agents = 0; 189 {
178 data.Access = info.Access; 190 List<MapBlockData> datas = WorldMap.Map2BlockFromGridRegion(info, flags);
179 if (flags == 2) // V2 sends this 191 // ugh! V2-3 is very sensitive about the result being
180 data.MapImageId = UUID.Zero; 192 // exactly the same as the requested name
181 else 193 if (regionInfos.Count == 1 && (mapName != mapNameOrig))
182 data.MapImageId = info.TerrainImage; 194 datas.ForEach(d => d.Name = mapNameOrig);
183 // ugh! V2-3 is very sensitive about the result being 195
184 // exactly the same as the requested name 196 blocks.AddRange(datas);
185 if (regionInfos.Count == 1 && (mapName != mapNameOrig)) 197 }
186 data.Name = mapNameOrig;
187 else 198 else
188 data.Name = info.RegionName; 199 {
189 data.RegionFlags = 0; // TODO not used? 200 MapBlockData data = WorldMap.MapBlockFromGridRegion(info, flags);
190 data.WaterHeight = 0; // not used 201 }
191 data.X = (ushort)Util.WorldToRegionLoc((uint)info.RegionLocX);
192 data.Y = (ushort)Util.WorldToRegionLoc((uint)info.RegionLocY);
193 blocks.Add(data);
194 } 202 }
195 } 203 }
196 204
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index a3b0f39..b98afbc 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -1064,7 +1064,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1064 } 1064 }
1065 1065
1066 // Fill a passed MapBlockData from a GridRegion 1066 // Fill a passed MapBlockData from a GridRegion
1067 protected MapBlockData MapBlockFromGridRegion(GridRegion r, uint flag) 1067 public MapBlockData MapBlockFromGridRegion(GridRegion r, uint flag)
1068 { 1068 {
1069 MapBlockData block = new MapBlockData(); 1069 MapBlockData block = new MapBlockData();
1070 1070
@@ -1090,7 +1090,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1090 return block; 1090 return block;
1091 } 1091 }
1092 1092
1093 protected List<MapBlockData> Map2BlockFromGridRegion(GridRegion r, uint flag) 1093 public List<MapBlockData> Map2BlockFromGridRegion(GridRegion r, uint flag)
1094 { 1094 {
1095 List<MapBlockData> blocks = new List<MapBlockData>(); 1095 List<MapBlockData> blocks = new List<MapBlockData>();
1096 MapBlockData block = new MapBlockData(); 1096 MapBlockData block = new MapBlockData();
diff --git a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
index 65c57a6..9c781e1 100644
--- a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs
@@ -24,6 +24,9 @@
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27using System.Collections.Generic;
28using OpenSim.Framework;
29using OpenSim.Services.Interfaces;
27 30
28namespace OpenSim.Region.Framework.Interfaces 31namespace OpenSim.Region.Framework.Interfaces
29{ 32{
@@ -33,5 +36,7 @@ namespace OpenSim.Region.Framework.Interfaces
33 /// Generate a map tile for the scene. a terrain texture for this scene 36 /// Generate a map tile for the scene. a terrain texture for this scene
34 /// </summary> 37 /// </summary>
35 void GenerateMaptile(); 38 void GenerateMaptile();
39 List<MapBlockData> Map2BlockFromGridRegion(GridRegion r, uint flag);
40 MapBlockData MapBlockFromGridRegion(GridRegion r, uint flag);
36 } 41 }
37} 42}