diff options
author | Diva Canto | 2009-09-26 07:48:21 -0700 |
---|---|---|
committer | Diva Canto | 2009-09-26 07:48:21 -0700 |
commit | 5757afe7665543e8b3ed4a322a7d6e095dafcdb3 (patch) | |
tree | bed3c7ab11459e84baa5a0fbd98dde4a81fd5e16 /OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | |
parent | More small changes to FlotsamAssetCache as per mcortez' request. (diff) | |
download | opensim-SC_OLD-5757afe7665543e8b3ed4a322a7d6e095dafcdb3.zip opensim-SC_OLD-5757afe7665543e8b3ed4a322a7d6e095dafcdb3.tar.gz opensim-SC_OLD-5757afe7665543e8b3ed4a322a7d6e095dafcdb3.tar.bz2 opensim-SC_OLD-5757afe7665543e8b3ed4a322a7d6e095dafcdb3.tar.xz |
First pass at the heart surgery for grid services. Compiles and runs minimally. A few bugs to catch now.
Diffstat (limited to 'OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs | 26 |
1 files changed, 16 insertions, 10 deletions
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; | |||
33 | using OpenSim.Region.Framework.Interfaces; | 33 | using OpenSim.Region.Framework.Interfaces; |
34 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
35 | using OpenSim.Region.Framework.Scenes.Hypergrid; | 35 | using OpenSim.Region.Framework.Scenes.Hypergrid; |
36 | using OpenSim.Services.Interfaces; | ||
37 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
36 | 38 | ||
37 | namespace OpenSim.Region.CoreModules.World.WorldMap | 39 | namespace OpenSim.Region.CoreModules.World.WorldMap |
38 | { | 40 | { |
@@ -92,13 +94,13 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
92 | } | 94 | } |
93 | 95 | ||
94 | // try to fetch from GridServer | 96 | // try to fetch from GridServer |
95 | List<RegionInfo> regionInfos = m_scene.SceneGridService.RequestNamedRegions(mapName, 20); | 97 | List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(UUID.Zero, mapName, 20); |
96 | if (regionInfos == null) | 98 | if (regionInfos == null) |
97 | { | 99 | { |
98 | m_log.Warn("[MAPSEARCHMODULE]: RequestNamedRegions returned null. Old gridserver?"); | 100 | m_log.Warn("[MAPSEARCHMODULE]: RequestNamedRegions returned null. Old gridserver?"); |
99 | // service wasn't available; maybe still an old GridServer. Try the old API, though it will return only one region | 101 | // service wasn't available; maybe still an old GridServer. Try the old API, though it will return only one region |
100 | regionInfos = new List<RegionInfo>(); | 102 | regionInfos = new List<GridRegion>(); |
101 | RegionInfo info = m_scene.SceneGridService.RequestClosestRegion(mapName); | 103 | GridRegion info = m_scene.GridService.GetRegionByName(UUID.Zero, mapName); |
102 | if (info != null) regionInfos.Add(info); | 104 | if (info != null) regionInfos.Add(info); |
103 | } | 105 | } |
104 | 106 | ||
@@ -109,11 +111,15 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
109 | if (mapName.Contains(".") && mapName.Contains(":")) | 111 | if (mapName.Contains(".") && mapName.Contains(":")) |
110 | { | 112 | { |
111 | // It probably is a domain name. Try to link to it. | 113 | // It probably is a domain name. Try to link to it. |
112 | RegionInfo regInfo; | 114 | GridRegion regInfo; |
113 | Scene cScene = GetClientScene(remoteClient); | 115 | Scene cScene = GetClientScene(remoteClient); |
114 | regInfo = HGHyperlink.TryLinkRegion(cScene, remoteClient, mapName); | 116 | IHyperlinkService hyperService = cScene.RequestModuleInterface<IHyperlinkService>(); |
115 | if (regInfo != null) | 117 | if (hyperService != null) |
116 | regionInfos.Add(regInfo); | 118 | { |
119 | regInfo = hyperService.TryLinkRegion(remoteClient, mapName); | ||
120 | if (regInfo != null) | ||
121 | regionInfos.Add(regInfo); | ||
122 | } | ||
117 | } | 123 | } |
118 | } | 124 | } |
119 | 125 | ||
@@ -122,12 +128,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
122 | MapBlockData data; | 128 | MapBlockData data; |
123 | if (regionInfos.Count > 0) | 129 | if (regionInfos.Count > 0) |
124 | { | 130 | { |
125 | foreach (RegionInfo info in regionInfos) | 131 | foreach (GridRegion info in regionInfos) |
126 | { | 132 | { |
127 | data = new MapBlockData(); | 133 | data = new MapBlockData(); |
128 | data.Agents = 0; | 134 | data.Agents = 0; |
129 | data.Access = info.AccessLevel; | 135 | data.Access = info.Access; |
130 | data.MapImageId = info.RegionSettings.TerrainImageID; | 136 | data.MapImageId = info.TerrainImage; |
131 | data.Name = info.RegionName; | 137 | data.Name = info.RegionName; |
132 | data.RegionFlags = 0; // TODO not used? | 138 | data.RegionFlags = 0; // TODO not used? |
133 | data.WaterHeight = 0; // not used | 139 | data.WaterHeight = 0; // not used |