From 5757afe7665543e8b3ed4a322a7d6e095dafcdb3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 26 Sep 2009 07:48:21 -0700 Subject: First pass at the heart surgery for grid services. Compiles and runs minimally. A few bugs to catch now. --- .../CoreModules/World/WorldMap/MapSearchModule.cs | 26 +++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs') diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index 4783b35..e3661fa 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -33,6 +33,8 @@ using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes.Hypergrid; +using OpenSim.Services.Interfaces; +using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.World.WorldMap { @@ -92,13 +94,13 @@ namespace OpenSim.Region.CoreModules.World.WorldMap } // try to fetch from GridServer - List regionInfos = m_scene.SceneGridService.RequestNamedRegions(mapName, 20); + List regionInfos = m_scene.GridService.GetRegionsByName(UUID.Zero, mapName, 20); if (regionInfos == null) { m_log.Warn("[MAPSEARCHMODULE]: RequestNamedRegions returned null. Old gridserver?"); // service wasn't available; maybe still an old GridServer. Try the old API, though it will return only one region - regionInfos = new List(); - RegionInfo info = m_scene.SceneGridService.RequestClosestRegion(mapName); + regionInfos = new List(); + GridRegion info = m_scene.GridService.GetRegionByName(UUID.Zero, mapName); if (info != null) regionInfos.Add(info); } @@ -109,11 +111,15 @@ namespace OpenSim.Region.CoreModules.World.WorldMap if (mapName.Contains(".") && mapName.Contains(":")) { // It probably is a domain name. Try to link to it. - RegionInfo regInfo; + GridRegion regInfo; Scene cScene = GetClientScene(remoteClient); - regInfo = HGHyperlink.TryLinkRegion(cScene, remoteClient, mapName); - if (regInfo != null) - regionInfos.Add(regInfo); + IHyperlinkService hyperService = cScene.RequestModuleInterface(); + if (hyperService != null) + { + regInfo = hyperService.TryLinkRegion(remoteClient, mapName); + if (regInfo != null) + regionInfos.Add(regInfo); + } } } @@ -122,12 +128,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap MapBlockData data; if (regionInfos.Count > 0) { - foreach (RegionInfo info in regionInfos) + foreach (GridRegion info in regionInfos) { data = new MapBlockData(); data.Agents = 0; - data.Access = info.AccessLevel; - data.MapImageId = info.RegionSettings.TerrainImageID; + data.Access = info.Access; + data.MapImageId = info.TerrainImage; data.Name = info.RegionName; data.RegionFlags = 0; // TODO not used? data.WaterHeight = 0; // not used -- cgit v1.1