diff options
author | Diva Canto | 2014-05-27 10:13:24 -0700 |
---|---|---|
committer | Diva Canto | 2014-05-27 10:13:24 -0700 |
commit | e19c830a6cc3e9bf20bcd5208563628923689184 (patch) | |
tree | 6aff9ff496a194ff55cd4c34a749c379731590aa /OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | |
parent | Don't report NPC presences. (diff) | |
download | opensim-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.
Diffstat (limited to 'OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | 44 |
1 files changed, 26 insertions, 18 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 | ||