aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs44
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