From a7d610ffcca8d707c7f9e9fdd7ad1477981ec2a9 Mon Sep 17 00:00:00 2001
From: diva
Date: Wed, 18 Mar 2009 16:37:26 +0000
Subject: Adds support for unlink-region command in hypergrid.
---
.../Communications/Hypergrid/HGGridServices.cs | 41 ++++++++++++++++++++++
.../Communications/Local/LocalBackEndServices.cs | 32 +++++++++++++++++
.../Region/Communications/OGS1/OGS1GridServices.cs | 22 ++++++++++++
3 files changed, 95 insertions(+)
(limited to 'OpenSim/Region/Communications')
diff --git a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs b/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs
index 4493591..5b3343a 100644
--- a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs
+++ b/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs
@@ -258,6 +258,47 @@ namespace OpenSim.Region.Communications.Hypergrid
return null;
}
+ public virtual RegionInfo RequestNeighbourInfo(string name)
+ {
+ foreach (RegionInfo info in m_hyperlinkRegions)
+ {
+ //m_log.Debug(" .. " + info.RegionHandle);
+ if (info.RegionName == name) return info;
+ }
+
+ foreach (RegionInfo info in m_knownRegions.Values)
+ {
+ if (info.RegionName == name)
+ {
+ //m_log.Debug("XXX------ known region " + info.RegionHandle);
+ return info;
+ }
+ }
+
+ return null;
+ }
+
+ public virtual RegionInfo RequestNeighbourInfo(string hostName, uint port)
+ {
+ foreach (RegionInfo info in m_hyperlinkRegions)
+ {
+ //m_log.Debug(" .. " + info.RegionHandle);
+ if ((info.ExternalHostName == hostName) && (info.HttpPort == port))
+ return info;
+ }
+
+ foreach (RegionInfo info in m_knownRegions.Values)
+ {
+ if ((info.ExternalHostName == hostName) && (info.HttpPort == port))
+ {
+ //m_log.Debug("XXX------ known region " + info.RegionHandle);
+ return info;
+ }
+ }
+
+ return null;
+ }
+
public virtual RegionInfo RequestClosestRegion(string regionName)
{
foreach (RegionInfo info in m_hyperlinkRegions)
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
index 33bc2fa..c52f825 100644
--- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
@@ -199,6 +199,38 @@ namespace OpenSim.Region.Communications.Local
}
///
+ /// Get information about a neighbouring region
+ ///
+ ///
+ ///
+ public RegionInfo RequestNeighbourInfo(string name)
+ {
+ foreach (RegionInfo info in m_regions.Values)
+ {
+ if (info.RegionName == name)
+ return info;
+ }
+
+ return null;
+ }
+
+ ///
+ /// Get information about a neighbouring region
+ ///
+ ///
+ ///
+ public RegionInfo RequestNeighbourInfo(string host, uint port)
+ {
+ foreach (RegionInfo info in m_regions.Values)
+ {
+ if ((info.ExternalHostName == host) && (info.HttpPort == port))
+ return info;
+ }
+
+ return null;
+ }
+
+ ///
/// Get information about the closet region given a region name.
///
///
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index a397093..f47abe8 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -445,6 +445,28 @@ namespace OpenSim.Region.Communications.OGS1
return regionInfo;
}
+ ///
+ /// Get information about a neighbouring region
+ ///
+ ///
+ ///
+ public RegionInfo RequestNeighbourInfo(string name)
+ {
+ // Not implemented yet
+ return null;
+ }
+
+ ///
+ /// Get information about a neighbouring region
+ ///
+ ///
+ ///
+ public RegionInfo RequestNeighbourInfo(string host, uint port)
+ {
+ // Not implemented yet
+ return null;
+ }
+
public RegionInfo RequestClosestRegion(string regionName)
{
foreach (RegionInfo ri in m_remoteRegionInfoCache.Values)
--
cgit v1.1