From da531fa9e124394228a7c7597bd50e548af81efb Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Sun, 23 Mar 2008 21:21:39 +0000 Subject: * Start passing around a region server's http port in RegionInfo. * This means that caps methods (editing scripts, poss map functions, etc) on non-home regions should now work with servers which are listening for http ports on a non default (9000) port. * If you are running a region server, this may only work properly once your grid server upgrades to this revision * PLEASE NOTE: This shouldn't cause inter-region problems if one end of the connection hasn't upgraded to this revision. However if it does, the instability will persist until the grid and region (and possibly all the region's neighbours) have upgraded to this revision. * This revision also adds extra login related messages, both for success and failure conditions --- OpenSim/Region/Application/OpenSimMain.cs | 2 +- .../Communications/Local/LocalLoginService.cs | 4 ++++ .../Region/Communications/OGS1/OGS1GridServices.cs | 28 ++++++++++++++++++++-- .../Scenes/SceneCommunicationService.cs | 3 ++- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 4 ++-- 5 files changed, 35 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index f96d474..aa5a432 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -349,7 +349,7 @@ namespace OpenSim m_standaloneAuthenticate); m_loginService.OnLoginToRegion += backendService.AddNewSession; - // XMLRPC action + // set up XMLRPC handler for client's initial login request message m_httpServer.AddXmlRPCHandler("login_to_simulator", m_loginService.XmlRpcLoginMethod); // provides the web form login diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 9f47239..3eac7e9 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -178,6 +178,10 @@ namespace OpenSim.Region.Communications.Local _login.StartPos = new LLVector3(128, 128, 70); _login.CapsPath = capsPath; + m_log.InfoFormat( + "[LOGIN]: Telling region {0} @ {1},{2} ({3}:{4}) to expect user connection", + reg.RegionName, response.RegionX, response.RegionY, response.SimAddress, response.SimPort); + handlerLoginToRegion = OnLoginToRegion; if (handlerLoginToRegion != null) { diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index fa1db15..23b8fb4 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -228,7 +228,14 @@ namespace OpenSim.Region.Communications.OGS1 string externalIpStr = Util.GetHostFromDNS(simIp).ToString(); SimpleRegionInfo sri = new SimpleRegionInfo(regX, regY, simIp, port); + sri.RemotingPort = Convert.ToUInt32(neighbourData["remoting_port"]); + + if (neighbourData.ContainsKey("http_port")) + { + sri.HttpPort = Convert.ToUInt32(neighbourData["http_port"]); + } + sri.RegionID = new LLUUID((string) neighbourData["uuid"]); neighbours.Add(sri); @@ -275,6 +282,11 @@ namespace OpenSim.Region.Communications.OGS1 regionInfo.RemotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); regionInfo.RemotingAddress = internalIpStr; + + if (responseData.ContainsKey("http_port")) + { + regionInfo.HttpPort = Convert.ToUInt32((string) responseData["http_port"]); + } regionInfo.RegionID = new LLUUID((string) responseData["region_UUID"]); regionInfo.RegionName = (string) responseData["region_name"]; @@ -333,6 +345,11 @@ namespace OpenSim.Region.Communications.OGS1 regionInfo.RemotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); regionInfo.RemotingAddress = internalIpStr; + + if (responseData.ContainsKey("http_port")) + { + regionInfo.HttpPort = Convert.ToUInt32((string) responseData["http_port"]); + } regionInfo.RegionID = new LLUUID((string) responseData["region_UUID"]); regionInfo.RegionName = (string) responseData["region_name"]; @@ -385,6 +402,11 @@ namespace OpenSim.Region.Communications.OGS1 regionInfo.RemotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); regionInfo.RemotingAddress = internalIpStr; + + if (responseData.ContainsKey("http_port")) + { + regionInfo.HttpPort = Convert.ToUInt32((string) responseData["http_port"]); + } regionInfo.RegionID = new LLUUID((string) responseData["region_UUID"]); regionInfo.RegionName = (string) responseData["region_name"]; @@ -813,8 +835,10 @@ namespace OpenSim.Region.Communications.OGS1 // And, surprisingly, the reason is.. it doesn't know // it's own remoting port! How special. region = new SearializableRegionInfo(RequestNeighbourInfo(region.RegionHandle)); - region.RemotingAddress = region.ExternalHostName; - region.RemotingPort = NetworkServersInfo.RemotingListenerPort; + region.RemotingAddress = region.ExternalHostName; + region.RemotingPort = NetworkServersInfo.RemotingListenerPort; + region.HttpPort = serversInfo.HttpListenerPort; + if (m_localBackend.RegionUp(region, regionhandle)) { return true; diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 5dccf13..f2b2f20 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs @@ -554,7 +554,8 @@ namespace OpenSim.Region.Environment.Scenes // TODO Should construct this behind a method string capsPath = - "http://" + reg.ExternalHostName + ":" + 9000 + "/CAPS/" + circuitdata.CapsPath + "0000/"; + "http://" + reg.ExternalHostName + ":" + reg.HttpPort + + "/CAPS/" + circuitdata.CapsPath + "0000/"; avatar.ControllingClient.SendRegionTeleport(regionHandle, 13, reg.ExternalEndPoint, 4, (1 << 4), capsPath); diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index f58109d..def7a77 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -1618,9 +1618,9 @@ namespace OpenSim.Region.Environment.Scenes { AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); - // TODO Should construct this behind a method + // TODO Should construct this behind a method string capsPath = - "http://" + neighbourRegion.ExternalHostName + ":" + 9000 + "http://" + neighbourRegion.ExternalHostName + ":" + neighbourRegion.HttpPort + "/CAPS/" + circuitdata.CapsPath + "0000/"; m_log.DebugFormat( -- cgit v1.1