diff options
author | Diva Canto | 2009-09-22 14:46:05 -0700 |
---|---|---|
committer | Diva Canto | 2009-09-22 14:46:05 -0700 |
commit | ffd30b8ac31bc408316079ba86076bf9e984a8be (patch) | |
tree | 47c85aa445f21037576d6ce5e2df8f7477289343 /OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid | |
parent | Merge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-ffd30b8ac31bc408316079ba86076bf9e984a8be.zip opensim-SC_OLD-ffd30b8ac31bc408316079ba86076bf9e984a8be.tar.gz opensim-SC_OLD-ffd30b8ac31bc408316079ba86076bf9e984a8be.tar.bz2 opensim-SC_OLD-ffd30b8ac31bc408316079ba86076bf9e984a8be.tar.xz |
Moved RegionName from RegionInfo to SimpleRegionInfo.
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs | 83 |
1 files changed, 59 insertions, 24 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs index b7e3213..e3cb05c 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs | |||
@@ -63,6 +63,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
63 | // This is key-ed on agent ID | 63 | // This is key-ed on agent ID |
64 | protected Dictionary<UUID, SimpleRegionInfo> m_knownRegions = new Dictionary<UUID, SimpleRegionInfo>(); | 64 | protected Dictionary<UUID, SimpleRegionInfo> m_knownRegions = new Dictionary<UUID, SimpleRegionInfo>(); |
65 | 65 | ||
66 | protected Dictionary<UUID, ulong> m_HyperlinkHandles = new Dictionary<UUID, ulong>(); | ||
67 | |||
66 | #region ISharedRegionModule | 68 | #region ISharedRegionModule |
67 | 69 | ||
68 | public Type ReplaceableInterface | 70 | public Type ReplaceableInterface |
@@ -160,10 +162,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
160 | if (regionInfo.RegionID.Equals(UUID.Zero)) | 162 | if (regionInfo.RegionID.Equals(UUID.Zero)) |
161 | { | 163 | { |
162 | m_log.Info("[HGrid]: Linking remote region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort); | 164 | m_log.Info("[HGrid]: Linking remote region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort); |
163 | regionInfo.RegionID = m_HypergridServiceConnector.LinkRegion(regionInfo); | 165 | ulong regionHandle = 0; |
166 | regionInfo.RegionID = m_HypergridServiceConnector.LinkRegion(regionInfo, out regionHandle); | ||
164 | if (!regionInfo.RegionID.Equals(UUID.Zero)) | 167 | if (!regionInfo.RegionID.Equals(UUID.Zero)) |
165 | { | 168 | { |
166 | m_HyperlinkRegions.Add(regionInfo.RegionID, regionInfo); | 169 | AddHyperlinkRegion(regionInfo, regionHandle); |
167 | m_log.Info("[HGrid]: Successfully linked to region_uuid " + regionInfo.RegionID); | 170 | m_log.Info("[HGrid]: Successfully linked to region_uuid " + regionInfo.RegionID); |
168 | 171 | ||
169 | // Try get the map image | 172 | // Try get the map image |
@@ -186,15 +189,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
186 | // Try the hyperlink collection | 189 | // Try the hyperlink collection |
187 | if (m_HyperlinkRegions.ContainsKey(regionID)) | 190 | if (m_HyperlinkRegions.ContainsKey(regionID)) |
188 | { | 191 | { |
189 | m_HyperlinkRegions.Remove(regionID); | 192 | RemoveHyperlinkRegion(regionID); |
190 | return true; | 193 | return true; |
191 | } | 194 | } |
192 | // Try the foreign users home collection | 195 | // Try the foreign users home collection |
193 | if (m_knownRegions.ContainsKey(regionID)) | 196 | |
194 | { | 197 | foreach (SimpleRegionInfo r in m_knownRegions.Values) |
195 | m_knownRegions.Remove(regionID); | 198 | if (r.RegionID == regionID) |
196 | return true; | 199 | { |
197 | } | 200 | RemoveHyperlinkHomeRegion(regionID); |
201 | return true; | ||
202 | } | ||
203 | |||
198 | // Finally, try the normal route | 204 | // Finally, try the normal route |
199 | return m_GridServiceConnector.DeregisterRegion(regionID); | 205 | return m_GridServiceConnector.DeregisterRegion(regionID); |
200 | } | 206 | } |
@@ -213,8 +219,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
213 | return m_HyperlinkRegions[regionID]; | 219 | return m_HyperlinkRegions[regionID]; |
214 | 220 | ||
215 | // Try the foreign users home collection | 221 | // Try the foreign users home collection |
216 | if (m_knownRegions.ContainsKey(regionID)) | 222 | foreach (SimpleRegionInfo r in m_knownRegions.Values) |
217 | return m_knownRegions[regionID]; | 223 | if (r.RegionID == regionID) |
224 | return m_knownRegions[regionID]; | ||
218 | 225 | ||
219 | // Finally, try the normal route | 226 | // Finally, try the normal route |
220 | return m_GridServiceConnector.GetRegionByUUID(scopeID, regionID); | 227 | return m_GridServiceConnector.GetRegionByUUID(scopeID, regionID); |
@@ -249,20 +256,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
249 | if (region != null) | 256 | if (region != null) |
250 | return region; | 257 | return region; |
251 | 258 | ||
252 | // !!! Commenting until region name exists | 259 | // Try the hyperlink collection |
253 | //// Try the hyperlink collection | 260 | foreach (SimpleRegionInfo r in m_HyperlinkRegions.Values) |
254 | //foreach (SimpleRegionInfo r in m_HyperlinkRegions.Values) | 261 | { |
255 | //{ | 262 | if (r.RegionName == regionName) |
256 | // if (r.RegionName == regionName) | 263 | return r; |
257 | // return r; | 264 | } |
258 | //} | 265 | |
259 | 266 | // Try the foreign users home collection | |
260 | //// Try the foreign users home collection | 267 | foreach (SimpleRegionInfo r in m_knownRegions.Values) |
261 | //foreach (SimpleRegionInfo r in m_knownRegions.Values) | 268 | { |
262 | //{ | 269 | if (r.RegionName == regionName) |
263 | // if (r.RegionName == regionName) | 270 | return r; |
264 | // return r; | 271 | } |
265 | //} | ||
266 | return null; | 272 | return null; |
267 | } | 273 | } |
268 | 274 | ||
@@ -299,6 +305,35 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
299 | 305 | ||
300 | #endregion | 306 | #endregion |
301 | 307 | ||
308 | private void AddHyperlinkRegion(SimpleRegionInfo regionInfo, ulong regionHandle) | ||
309 | { | ||
310 | m_HyperlinkRegions.Add(regionInfo.RegionID, regionInfo); | ||
311 | m_HyperlinkHandles.Add(regionInfo.RegionID, regionHandle); | ||
312 | } | ||
313 | |||
314 | private void RemoveHyperlinkRegion(UUID regionID) | ||
315 | { | ||
316 | m_HyperlinkRegions.Remove(regionID); | ||
317 | m_HyperlinkHandles.Remove(regionID); | ||
318 | } | ||
319 | |||
320 | private void AddHyperlinkHomeRegion(UUID userID, SimpleRegionInfo regionInfo, ulong regionHandle) | ||
321 | { | ||
322 | m_knownRegions.Add(userID, regionInfo); | ||
323 | m_HyperlinkHandles.Add(regionInfo.RegionID, regionHandle); | ||
324 | } | ||
325 | |||
326 | private void RemoveHyperlinkHomeRegion(UUID regionID) | ||
327 | { | ||
328 | foreach (KeyValuePair<UUID, SimpleRegionInfo> kvp in m_knownRegions) | ||
329 | { | ||
330 | if (kvp.Value.RegionID == regionID) | ||
331 | { | ||
332 | m_knownRegions.Remove(kvp.Key); | ||
333 | } | ||
334 | } | ||
335 | m_HyperlinkHandles.Remove(regionID); | ||
336 | } | ||
302 | 337 | ||
303 | } | 338 | } |
304 | } | 339 | } |