From 1e9a0220e69a62dd45b53753537fb4563e50412c Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 16 May 2007 17:35:27 +0000 Subject: Quite big change to how Sessions/circuits are Authenticated. Seems to work okay but needs a lot more testing. --- OpenSim.Servers/LoginServer.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'OpenSim.Servers/LoginServer.cs') diff --git a/OpenSim.Servers/LoginServer.cs b/OpenSim.Servers/LoginServer.cs index 393237b..6fd174b 100644 --- a/OpenSim.Servers/LoginServer.cs +++ b/OpenSim.Servers/LoginServer.cs @@ -47,6 +47,7 @@ using OpenSim.Framework.Types; namespace OpenSim.UserServer { + public delegate void AddNewSessionHandler(Login loginData); /// /// When running in local (default) mode , handles client logins. /// @@ -64,6 +65,7 @@ namespace OpenSim.UserServer private string m_simAddr; private uint regionX; private uint regionY; + private AddNewSessionHandler AddSession; public LocalUserProfileManager LocalUserManager { @@ -73,9 +75,8 @@ namespace OpenSim.UserServer } } - public LoginServer(IGridServer gridServer, string simAddr, int simPort, uint regX, uint regY, bool useAccounts) + public LoginServer( string simAddr, int simPort, uint regX, uint regY, bool useAccounts) { - m_gridServer = gridServer; m_simPort = simPort; m_simAddr = simAddr; regionX = regX; @@ -83,6 +84,12 @@ namespace OpenSim.UserServer this.userAccounts = useAccounts; } + public void SetSessionHandler(AddNewSessionHandler sessionHandler) + { + this.AddSession = sessionHandler; + this.userManager.SetSessionHandler(sessionHandler); + } + public void Startup() { this._needPasswd = false; @@ -180,15 +187,16 @@ namespace OpenSim.UserServer _login.Agent = loginResponse.AgentID; _login.Session = loginResponse.SessionID; _login.SecureSession = loginResponse.SecureSessionID; - + _login.CircuitCode = (uint) loginResponse.CircuitCode; _login.BaseFolder = loginResponse.BaseFolderID; _login.InventoryFolder = loginResponse.InventoryFolderID; //working on local computer if so lets add to the gridserver's list of sessions? - if (m_gridServer.GetName() == "Local") + /* if (m_gridServer.GetName() == "Local") { ((LocalGridBase)m_gridServer).AddNewSession(_login); - } + }*/ + AddSession(_login); return response; } -- cgit v1.1