From c7d0e4ffc151818702375fdb786189fd1f8c7c94 Mon Sep 17 00:00:00 2001 From: diva Date: Tue, 24 Mar 2009 18:56:32 +0000 Subject: Added the login region's http to the login response. --- .../Framework/Communications/HGLoginAuthService.cs | 42 ++++++---------------- OpenSim/Framework/Communications/LoginResponse.cs | 8 +++++ 2 files changed, 18 insertions(+), 32 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Communications/HGLoginAuthService.cs b/OpenSim/Framework/Communications/HGLoginAuthService.cs index 21d34f8..49977b7 100644 --- a/OpenSim/Framework/Communications/HGLoginAuthService.cs +++ b/OpenSim/Framework/Communications/HGLoginAuthService.cs @@ -70,8 +70,11 @@ namespace OpenSim.Framework.Communications : base(userManager, libraryRootFolder, welcomeMess) { this.m_serversInfo = serversInfo; - m_defaultHomeX = this.m_serversInfo.DefaultHomeLocX; - m_defaultHomeY = this.m_serversInfo.DefaultHomeLocY; + if (m_serversInfo != null) + { + m_defaultHomeX = this.m_serversInfo.DefaultHomeLocX; + m_defaultHomeY = this.m_serversInfo.DefaultHomeLocY; + } m_authUsers = authenticate; m_interServiceInventoryService = interServiceInventoryService; @@ -101,7 +104,6 @@ namespace OpenSim.Framework.Communications uint uy = (uint)(y / Constants.RegionSize); ulong regionHandle = Util.UIntsToLong(ux, uy); responseData["region_handle"] = regionHandle.ToString(); - responseData["http_port"] = (UInt32)m_serversInfo.HttpListenerPort; // Let's remove the seed cap from the login //responseData.Remove("seed_capability"); @@ -255,8 +257,7 @@ namespace OpenSim.Framework.Communications /// - /// Prepare a login to the given region. This involves both telling the region to expect a connection - /// and appropriately customising the response to the user. + /// Not really informing the region. Just filling out the response fields related to the region. /// /// /// @@ -269,6 +270,7 @@ namespace OpenSim.Framework.Communications response.SimPort = (uint)endPoint.Port; response.RegionX = regionInfo.RegionLocX; response.RegionY = regionInfo.RegionLocY; + response.SimHttpPort = regionInfo.HttpPort; string capsPath = CapsUtil.GetRandomCapsObjectPath(); string capsSeedPath = CapsUtil.GetCapsSeedPath(capsPath); @@ -281,11 +283,11 @@ namespace OpenSim.Framework.Communications if (m_serversInfo.HttpUsesSSL) { - seedcap = "https://" + m_serversInfo.HttpSSLCN + ":" + m_serversInfo.httpSSLPort + capsSeedPath; + seedcap = "https://" + m_serversInfo.HttpSSLCN + ":" + regionInfo.HttpPort + capsSeedPath; } else { - seedcap = "http://" + regionInfo.ExternalHostName + ":" + m_serversInfo.HttpListenerPort + capsSeedPath; + seedcap = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + capsSeedPath; } response.SeedCapability = seedcap; @@ -299,31 +301,7 @@ namespace OpenSim.Framework.Communications user.CurrentAgent.Region = regionInfo.RegionID; user.CurrentAgent.Handle = regionInfo.RegionHandle; - AgentCircuitData agent = new AgentCircuitData(); - agent.AgentID = user.ID; - agent.firstname = user.FirstName; - agent.lastname = user.SurName; - agent.SessionID = user.CurrentAgent.SessionID; - agent.SecureSessionID = user.CurrentAgent.SecureSessionID; - agent.circuitcode = Convert.ToUInt32(response.CircuitCode); - agent.BaseFolder = UUID.Zero; - agent.InventoryFolder = UUID.Zero; - agent.startpos = user.CurrentAgent.Position; - agent.CapsPath = capsPath; - agent.Appearance = m_userManager.GetUserAppearance(user.ID); - if (agent.Appearance == null) - { - m_log.WarnFormat("[INTER]: Appearance not found for {0} {1}. Creating default.", agent.firstname, agent.lastname); - agent.Appearance = new AvatarAppearance(); - } - - if (m_regionsConnector.RegionLoginsEnabled) - { - // m_log.Info("[LLStandaloneLoginModule] Informing region about user"); - return m_regionsConnector.NewUserConnection(regionInfo.RegionHandle, agent); - } - - return false; + return true; } public override void LogOffUser(UserProfileData theUser, string message) diff --git a/OpenSim/Framework/Communications/LoginResponse.cs b/OpenSim/Framework/Communications/LoginResponse.cs index d1b9258..6986369 100644 --- a/OpenSim/Framework/Communications/LoginResponse.cs +++ b/OpenSim/Framework/Communications/LoginResponse.cs @@ -75,6 +75,7 @@ namespace OpenSim.Framework.Communications private string everLoggedIn; private string login; private uint simPort; + private uint simHttpPort; private string simAddress; private string agentAccess; private Int32 circuitCode; @@ -354,6 +355,7 @@ namespace OpenSim.Framework.Communications responseData["sim_port"] = (Int32) SimPort; responseData["sim_ip"] = SimAddress; + responseData["http_port"] = (Int32)SimHttpPort; responseData["agent_id"] = AgentID.ToString(); responseData["session_id"] = SessionID.ToString(); @@ -579,6 +581,12 @@ namespace OpenSim.Framework.Communications set { simPort = value; } } + public uint SimHttpPort + { + get { return simHttpPort; } + set { simHttpPort = value; } + } + public string SimAddress { get { return simAddress; } -- cgit v1.1