aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorDiva Canto2010-12-14 08:11:49 -0800
committerDiva Canto2010-12-14 08:11:49 -0800
commit55e04e6c68766399695a27d071c9298d90eafe13 (patch)
treee22d1e78435404554d6a7ffd4ac3d4693eafdbd4 /OpenSim/Region/CoreModules
parentNull checking ParentGroup is not needed. It can't be null. (diff)
downloadopensim-SC_OLD-55e04e6c68766399695a27d071c9298d90eafe13.zip
opensim-SC_OLD-55e04e6c68766399695a27d071c9298d90eafe13.tar.gz
opensim-SC_OLD-55e04e6c68766399695a27d071c9298d90eafe13.tar.bz2
opensim-SC_OLD-55e04e6c68766399695a27d071c9298d90eafe13.tar.xz
Fixes mantis #5270 -- Map tiles for hyperlinks not showing in world map for grided sims.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs109
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs2
3 files changed, 90 insertions, 25 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
index 16e25e6..dfba0d6 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
@@ -41,8 +41,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
41 41
42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid 42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
43{ 43{
44 public class RemoteGridServicesConnector : 44 public class RemoteGridServicesConnector : ISharedRegionModule, IGridService
45 GridServicesConnector, ISharedRegionModule, IGridService
46 { 45 {
47 private static readonly ILog m_log = 46 private static readonly ILog m_log =
48 LogManager.GetLogger( 47 LogManager.GetLogger(
@@ -51,6 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
51 private bool m_Enabled = false; 50 private bool m_Enabled = false;
52 51
53 private IGridService m_LocalGridService; 52 private IGridService m_LocalGridService;
53 private IGridService m_RemoteGridService;
54 54
55 public RemoteGridServicesConnector() 55 public RemoteGridServicesConnector()
56 { 56 {
@@ -73,7 +73,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
73 get { return "RemoteGridServicesConnector"; } 73 get { return "RemoteGridServicesConnector"; }
74 } 74 }
75 75
76 public override void Initialise(IConfigSource source) 76 public void Initialise(IConfigSource source)
77 { 77 {
78 IConfig moduleConfig = source.Configs["Modules"]; 78 IConfig moduleConfig = source.Configs["Modules"];
79 if (moduleConfig != null) 79 if (moduleConfig != null)
@@ -97,9 +97,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
97 return; 97 return;
98 } 98 }
99 99
100 base.Initialise(source);
101
102 m_LocalGridService = new LocalGridServicesConnector(source); 100 m_LocalGridService = new LocalGridServicesConnector(source);
101 m_RemoteGridService = new GridServicesConnector(source);
103 } 102 }
104 103
105 public void PostInitialise() 104 public void PostInitialise()
@@ -135,61 +134,61 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
135 134
136 #region IGridService 135 #region IGridService
137 136
138 public override string RegisterRegion(UUID scopeID, GridRegion regionInfo) 137 public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
139 { 138 {
140 string msg = m_LocalGridService.RegisterRegion(scopeID, regionInfo); 139 string msg = m_LocalGridService.RegisterRegion(scopeID, regionInfo);
141 140
142 if (msg == String.Empty) 141 if (msg == String.Empty)
143 return base.RegisterRegion(scopeID, regionInfo); 142 return m_RemoteGridService.RegisterRegion(scopeID, regionInfo);
144 143
145 return msg; 144 return msg;
146 } 145 }
147 146
148 public override bool DeregisterRegion(UUID regionID) 147 public bool DeregisterRegion(UUID regionID)
149 { 148 {
150 if (m_LocalGridService.DeregisterRegion(regionID)) 149 if (m_LocalGridService.DeregisterRegion(regionID))
151 return base.DeregisterRegion(regionID); 150 return m_RemoteGridService.DeregisterRegion(regionID);
152 151
153 return false; 152 return false;
154 } 153 }
155 154
156 public override List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID) 155 public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
157 { 156 {
158 return base.GetNeighbours(scopeID, regionID); 157 return m_RemoteGridService.GetNeighbours(scopeID, regionID);
159 } 158 }
160 159
161 public override GridRegion GetRegionByUUID(UUID scopeID, UUID regionID) 160 public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
162 { 161 {
163 GridRegion rinfo = m_LocalGridService.GetRegionByUUID(scopeID, regionID); 162 GridRegion rinfo = m_LocalGridService.GetRegionByUUID(scopeID, regionID);
164 if (rinfo == null) 163 if (rinfo == null)
165 rinfo = base.GetRegionByUUID(scopeID, regionID); 164 rinfo = m_RemoteGridService.GetRegionByUUID(scopeID, regionID);
166 165
167 return rinfo; 166 return rinfo;
168 } 167 }
169 168
170 public override GridRegion GetRegionByPosition(UUID scopeID, int x, int y) 169 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
171 { 170 {
172 GridRegion rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y); 171 GridRegion rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y);
173 if (rinfo == null) 172 if (rinfo == null)
174 rinfo = base.GetRegionByPosition(scopeID, x, y); 173 rinfo = m_RemoteGridService.GetRegionByPosition(scopeID, x, y);
175 174
176 return rinfo; 175 return rinfo;
177 } 176 }
178 177
179 public override GridRegion GetRegionByName(UUID scopeID, string regionName) 178 public GridRegion GetRegionByName(UUID scopeID, string regionName)
180 { 179 {
181 GridRegion rinfo = m_LocalGridService.GetRegionByName(scopeID, regionName); 180 GridRegion rinfo = m_LocalGridService.GetRegionByName(scopeID, regionName);
182 if (rinfo == null) 181 if (rinfo == null)
183 rinfo = base.GetRegionByName(scopeID, regionName); 182 rinfo = m_RemoteGridService.GetRegionByName(scopeID, regionName);
184 183
185 return rinfo; 184 return rinfo;
186 } 185 }
187 186
188 public override List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber) 187 public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
189 { 188 {
190 List<GridRegion> rinfo = m_LocalGridService.GetRegionsByName(scopeID, name, maxNumber); 189 List<GridRegion> rinfo = m_LocalGridService.GetRegionsByName(scopeID, name, maxNumber);
191 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetRegionsByName {0} found {1} regions", name, rinfo.Count); 190 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetRegionsByName {0} found {1} regions", name, rinfo.Count);
192 List<GridRegion> grinfo = base.GetRegionsByName(scopeID, name, maxNumber); 191 List<GridRegion> grinfo = m_RemoteGridService.GetRegionsByName(scopeID, name, maxNumber);
193 192
194 if (grinfo != null) 193 if (grinfo != null)
195 { 194 {
@@ -202,13 +201,79 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
202 return rinfo; 201 return rinfo;
203 } 202 }
204 203
205 // Let's not override GetRegionRange -- let's get them all from the grid server 204 public virtual List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
205 {
206 List<GridRegion> rinfo = m_LocalGridService.GetRegionRange(scopeID, xmin, xmax, ymin, ymax);
207 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetRegionRange {0} found {1} regions", name, rinfo.Count);
208 List<GridRegion> grinfo = m_RemoteGridService.GetRegionRange(scopeID, xmin, xmax, ymin, ymax);
209
210 if (grinfo != null)
211 {
212 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetRegionRange {0} found {1} regions", name, grinfo.Count);
213 foreach (GridRegion r in grinfo)
214 if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null)
215 rinfo.Add(r);
216 }
217
218 return rinfo;
219 }
220
221 public List<GridRegion> GetDefaultRegions(UUID scopeID)
222 {
223 List<GridRegion> rinfo = m_LocalGridService.GetDefaultRegions(scopeID);
224 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetDefaultRegions {0} found {1} regions", name, rinfo.Count);
225 List<GridRegion> grinfo = m_RemoteGridService.GetDefaultRegions(scopeID);
226
227 if (grinfo != null)
228 {
229 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetDefaultRegions {0} found {1} regions", name, grinfo.Count);
230 foreach (GridRegion r in grinfo)
231 if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null)
232 rinfo.Add(r);
233 }
234
235 return rinfo;
236 }
237
238 public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y)
239 {
240 List<GridRegion> rinfo = m_LocalGridService.GetFallbackRegions(scopeID, x, y);
241 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetFallbackRegions {0} found {1} regions", name, rinfo.Count);
242 List<GridRegion> grinfo = m_RemoteGridService.GetFallbackRegions(scopeID, x, y);
243
244 if (grinfo != null)
245 {
246 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetFallbackRegions {0} found {1} regions", name, grinfo.Count);
247 foreach (GridRegion r in grinfo)
248 if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null)
249 rinfo.Add(r);
250 }
251
252 return rinfo;
253 }
254
255 public List<GridRegion> GetHyperlinks(UUID scopeID)
256 {
257 List<GridRegion> rinfo = m_LocalGridService.GetHyperlinks(scopeID);
258 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetHyperlinks {0} found {1} regions", name, rinfo.Count);
259 List<GridRegion> grinfo = m_RemoteGridService.GetHyperlinks(scopeID);
260
261 if (grinfo != null)
262 {
263 //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetHyperlinks {0} found {1} regions", name, grinfo.Count);
264 foreach (GridRegion r in grinfo)
265 if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null)
266 rinfo.Add(r);
267 }
268
269 return rinfo;
270 }
206 271
207 public override int GetRegionFlags(UUID scopeID, UUID regionID) 272 public int GetRegionFlags(UUID scopeID, UUID regionID)
208 { 273 {
209 int flags = m_LocalGridService.GetRegionFlags(scopeID, regionID); 274 int flags = m_LocalGridService.GetRegionFlags(scopeID, regionID);
210 if (flags == -1) 275 if (flags == -1)
211 flags = base.GetRegionFlags(scopeID, regionID); 276 flags = m_RemoteGridService.GetRegionFlags(scopeID, regionID);
212 277
213 return flags; 278 return flags;
214 } 279 }
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
index 9f88517..bdd1a0b 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs
@@ -93,13 +93,13 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
93 } 93 }
94 94
95 // try to fetch from GridServer 95 // try to fetch from GridServer
96 List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(UUID.Zero, mapName, 20); 96 List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20);
97 if (regionInfos == null) 97 if (regionInfos == null)
98 { 98 {
99 m_log.Warn("[MAPSEARCHMODULE]: RequestNamedRegions returned null. Old gridserver?"); 99 m_log.Warn("[MAPSEARCHMODULE]: RequestNamedRegions returned null. Old gridserver?");
100 // service wasn't available; maybe still an old GridServer. Try the old API, though it will return only one region 100 // service wasn't available; maybe still an old GridServer. Try the old API, though it will return only one region
101 regionInfos = new List<GridRegion>(); 101 regionInfos = new List<GridRegion>();
102 GridRegion info = m_scene.GridService.GetRegionByName(UUID.Zero, mapName); 102 GridRegion info = m_scene.GridService.GetRegionByName(m_scene.RegionInfo.ScopeID, mapName);
103 if (info != null) regionInfos.Add(info); 103 if (info != null) regionInfos.Add(info);
104 } 104 }
105 105
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 9869f4a..6d9afce 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -593,7 +593,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
593 if (!m_blacklistedregions.ContainsKey(regionhandle)) 593 if (!m_blacklistedregions.ContainsKey(regionhandle))
594 m_blacklistedregions.Add(regionhandle, Environment.TickCount); 594 m_blacklistedregions.Add(regionhandle, Environment.TickCount);
595 } 595 }
596 m_log.InfoFormat("[WORLD MAP]: Blacklisted region {0}", regionhandle.ToString()); 596 //m_log.InfoFormat("[WORLD MAP]: Blacklisted region {0}", regionhandle.ToString());
597 } 597 }
598 } 598 }
599 599