From 6cf0b818642518aadd8aa288127de03f6fd1a079 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sat, 13 Dec 2008 16:25:20 +0000 Subject: Mantis#2811. Thank you kindly, Diva for a patch that resolves some of our DNS/dotted decimal issues that plague teleporting. We are increasing the MajorInterfaceVersion from 1 to 2 in the gridserver, so sims will need to be updated on various grids. --- OpenSim/Data/RegionProfileData.cs | 2 +- OpenSim/Framework/Servers/VersionInfo.cs | 2 +- OpenSim/Grid/GridServer/GridManager.cs | 13 +++++-------- OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 18 +++++++++--------- 4 files changed, 16 insertions(+), 19 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/RegionProfileData.cs b/OpenSim/Data/RegionProfileData.cs index 3759341..0ec79ac 100644 --- a/OpenSim/Data/RegionProfileData.cs +++ b/OpenSim/Data/RegionProfileData.cs @@ -161,7 +161,7 @@ namespace OpenSim.Data simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]); simData.remotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); simData.serverURI = (string) responseData["server_uri"]; - simData.httpServerURI = "http://" + (string)responseData["sim_host"] + ":" + simData.httpPort.ToString() + "/"; + simData.httpServerURI = "http://" + (string)responseData["sim_ip"] + ":" + simData.httpPort.ToString() + "/"; simData.UUID = new UUID((string) responseData["region_UUID"]); simData.regionName = (string) responseData["region_name"]; } diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs index 4b3f829..1efd82f 100644 --- a/OpenSim/Framework/Servers/VersionInfo.cs +++ b/OpenSim/Framework/Servers/VersionInfo.cs @@ -48,6 +48,6 @@ namespace OpenSim /// of the code that is too old. /// /// - public readonly static int MajorInterfaceVersion = 1; + public readonly static int MajorInterfaceVersion = 2; } } diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 08d5393..1ec4fd8 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -563,8 +563,7 @@ namespace OpenSim.Grid.GridServer foreach (RegionProfileData aSim in neighbours) { NeighbourBlock = new Hashtable(); - NeighbourBlock["sim_host"] = aSim.serverIP; - NeighbourBlock["sim_ip"] = Util.GetHostFromDNS(aSim.serverIP.ToString()).ToString(); + NeighbourBlock["sim_ip"] = aSim.serverIP; NeighbourBlock["sim_port"] = aSim.serverPort.ToString(); NeighbourBlock["region_locx"] = aSim.regionLocX.ToString(); NeighbourBlock["region_locy"] = aSim.regionLocY.ToString(); @@ -594,8 +593,7 @@ namespace OpenSim.Grid.GridServer (uint)(sim.regionLocY + y) * Constants.RegionSize)); NeighbourBlock = new Hashtable(); - NeighbourBlock["sim_host"] = neighbour.serverIP; - NeighbourBlock["sim_ip"] = Util.GetHostFromDNS(neighbour.serverIP).ToString(); + NeighbourBlock["sim_ip"] = neighbour.serverIP; NeighbourBlock["sim_port"] = neighbour.serverPort.ToString(); NeighbourBlock["region_locx"] = neighbour.regionLocX.ToString(); NeighbourBlock["region_locy"] = neighbour.regionLocY.ToString(); @@ -813,8 +811,7 @@ namespace OpenSim.Grid.GridServer { m_log.Info("[DATA]: found " + (string)simData.regionName + " regionHandle = " + (string)requestData["region_handle"]); - responseData["sim_ip"] = Util.GetHostFromDNS(simData.serverIP).ToString(); - responseData["sim_host"] = simData.serverIP; + responseData["sim_ip"] = simData.serverIP; responseData["sim_port"] = simData.serverPort.ToString(); responseData["server_uri"] = simData.serverURI; responseData["http_port"] = simData.httpPort.ToString(); @@ -881,7 +878,7 @@ namespace OpenSim.Grid.GridServer // For Sugilite compatibility simProfileBlock["regionhandle"] = aSim.regionHandle.ToString(); - simProfileBlock["sim_ip"] = aSim.serverIP.ToString(); + simProfileBlock["sim_ip"] = aSim.serverIP; simProfileBlock["sim_port"] = aSim.serverPort.ToString(); simProfileBlock["sim_uri"] = aSim.serverURI.ToString(); simProfileBlock["uuid"] = aSim.UUID.ToString(); @@ -1044,7 +1041,7 @@ namespace OpenSim.Grid.GridServer respstring += ""; respstring += "" + TheSim.ToString() + ""; respstring += "" + TheSim.regionName + ""; - respstring += "" + Util.GetHostFromDNS(TheSim.serverIP).ToString() + ""; + respstring += "" + TheSim.serverIP + ""; respstring += "" + TheSim.serverPort.ToString() + ""; respstring += "" + TheSim.regionLocX.ToString() + ""; respstring += "" + TheSim.regionLocY.ToString() + ""; diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 59250fd..c0fecee 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -410,16 +410,17 @@ namespace OpenSim.Region.Communications.OGS1 uint regX = Convert.ToUInt32((string) responseData["region_locx"]); uint regY = Convert.ToUInt32((string) responseData["region_locy"]); - string internalIpStr = (string) responseData["sim_ip"]; + string externalHostName = (string) responseData["sim_ip"]; uint port = Convert.ToUInt32(responseData["sim_port"]); // string externalUri = (string) responseData["sim_uri"]; - IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), (int) port); - // string neighbourExternalUri = externalUri; - regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, internalIpStr); + //IPEndPoint neighbourInternalEndPoint = new IPEndPoint(IPAddress.Parse(internalIpStr), (int) port); + IPEndPoint neighbourInternalEndPoint = new IPEndPoint(Util.GetHostFromDNS(externalHostName), (int)port); + + regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, externalHostName); regionInfo.RemotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); - regionInfo.RemotingAddress = internalIpStr; + regionInfo.RemotingAddress = externalHostName; if (responseData.ContainsKey("http_port")) { @@ -437,11 +438,11 @@ namespace OpenSim.Region.Communications.OGS1 } } } - catch + catch (Exception e) { m_log.Error("[OGS1 GRID SERVICES]: " + "Region lookup failed for: " + regionHandle.ToString() + - " - Is the GridServer down?"); + " - Is the GridServer down?" + e.ToString()); return null; } } @@ -1551,8 +1552,7 @@ namespace OpenSim.Region.Communications.OGS1 bool available = false; bool timed_out = true; - IPAddress ia; - IPAddress.TryParse(address, out ia); + IPAddress ia = Util.GetHostFromDNS(address); IPEndPoint m_EndPoint; try { -- cgit v1.1