From 390137d540b9ae39eba3ba9136bd49d5e992bc5f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 21 Sep 2009 11:05:01 -0700 Subject: Added grid handler and grid remote connector. --- OpenSim/Framework/RegionInfo.cs | 62 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) (limited to 'OpenSim/Framework/RegionInfo.cs') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 3896a6e..afd50a9 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -26,6 +26,7 @@ */ using System; +using System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Xml; @@ -197,6 +198,67 @@ namespace OpenSim.Framework { return m_internalEndPoint.Port; } + + public Dictionary ToKeyValuePairs() + { + Dictionary kvp = new Dictionary(); + kvp["uuid"] = RegionID.ToString(); + kvp["locX"] = RegionLocX.ToString(); + kvp["locY"] = RegionLocY.ToString(); + kvp["external_ip_address"] = ExternalEndPoint.Address.ToString(); + kvp["external_port"] = ExternalEndPoint.Port.ToString(); + kvp["external_host_name"] = ExternalHostName; + kvp["http_port"] = HttpPort.ToString(); + kvp["internal_ip_address"] = InternalEndPoint.Address.ToString(); + kvp["internal_port"] = InternalEndPoint.Port.ToString(); + kvp["alternate_ports"] = m_allow_alternate_ports.ToString(); + kvp["server_uri"] = ServerURI; + + return kvp; + } + + public SimpleRegionInfo(Dictionary kvp) + { + if ((kvp["external_ip_address"] != null) && (kvp["external_port"] != null)) + { + int port = 0; + Int32.TryParse((string)kvp["external_port"], out port); + IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["external_ip_address"]), port); + ExternalEndPoint = ep; + } + else + ExternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0); + + if (kvp["external_host_name"] != null) + ExternalHostName = (string)kvp["external_host_name"]; + + if (kvp["http_port"] != null) + { + UInt32 port = 0; + UInt32.TryParse((string)kvp["http_port"], out port); + HttpPort = port; + } + + if ((kvp["internal_ip_address"] != null) && (kvp["internal_port"] != null)) + { + int port = 0; + Int32.TryParse((string)kvp["internal_port"], out port); + IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["internal_ip_address"]), port); + InternalEndPoint = ep; + } + else + InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0); + + if (kvp["alternate_ports"] != null) + { + bool alts = false; + Boolean.TryParse((string)kvp["alternate_ports"], out alts); + m_allow_alternate_ports = alts; + } + + if (kvp["server_uri"] != null) + ServerURI = (string)kvp["server_uri"]; + } } public class RegionInfo : SimpleRegionInfo -- cgit v1.1 From ffd30b8ac31bc408316079ba86076bf9e984a8be Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 22 Sep 2009 14:46:05 -0700 Subject: Moved RegionName from RegionInfo to SimpleRegionInfo. --- OpenSim/Framework/RegionInfo.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/RegionInfo.cs') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index afd50a9..0dc35a5 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -64,6 +64,13 @@ namespace OpenSim.Framework } protected string m_serverURI; + public string RegionName + { + get { return m_regionName; } + set { m_regionName = value; } + } + protected string m_regionName = String.Empty; + protected bool Allow_Alternate_Ports; public bool m_allow_alternate_ports; protected string m_externalHostName; @@ -284,7 +291,6 @@ namespace OpenSim.Framework public UUID originRegionID = UUID.Zero; public string proxyUrl = ""; public int ProxyOffset = 0; - public string RegionName = String.Empty; public string regionSecret = UUID.Random().ToString(); public string osSecret; -- cgit v1.1 From 882d2c9cc399c4c7d1809702104ce94c9c2c7b17 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 22 Sep 2009 20:25:00 -0700 Subject: Added hg console commands to the module. Added the IN connector module for link-region and corresponding handler to be used in the regions only. No service as such is needed. This will replace the current link-region machinery. Compiles but not tested. --- OpenSim/Framework/RegionInfo.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Framework/RegionInfo.cs') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 0dc35a5..cee1d4b 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -108,6 +108,7 @@ namespace OpenSim.Framework public SimpleRegionInfo(RegionInfo ConvertFrom) { + m_regionName = ConvertFrom.RegionName; m_regionLocX = ConvertFrom.RegionLocX; m_regionLocY = ConvertFrom.RegionLocY; m_internalEndPoint = ConvertFrom.InternalEndPoint; -- cgit v1.1 From ee205e7e812e170f670e690a4e0fa9caa652f226 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Thu, 1 Oct 2009 01:00:09 +0900 Subject: Formatting cleanup. --- OpenSim/Framework/RegionInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Framework/RegionInfo.cs') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index cee1d4b..d3a5357 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -1040,7 +1040,7 @@ namespace OpenSim.Framework public static RegionInfo Create(UUID regionID, string regionName, uint regX, uint regY, string externalHostName, uint httpPort, uint simPort, uint remotingPort, string serverURI) { RegionInfo regionInfo; - IPEndPoint neighbourInternalEndPoint = new IPEndPoint(Util.GetHostFromDNS(externalHostName), (int)simPort); + IPEndPoint neighbourInternalEndPoint = new IPEndPoint(Util.GetHostFromDNS(externalHostName), (int)simPort); regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, externalHostName); regionInfo.RemotingPort = remotingPort; regionInfo.RemotingAddress = externalHostName; -- cgit v1.1