mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
Quite big change to how Sessions/circuits are Authenticated. Seems to work okay but needs a lot more testing.
This commit is contained in:
@@ -45,6 +45,7 @@ namespace OpenSim.UserServer
|
||||
private string m_ipAddr;
|
||||
private uint regionX;
|
||||
private uint regionY;
|
||||
private AddNewSessionHandler AddSession;
|
||||
|
||||
public LocalUserProfileManager(IGridServer gridServer, int simPort, string ipAddr , uint regX, uint regY)
|
||||
{
|
||||
@@ -55,6 +56,11 @@ namespace OpenSim.UserServer
|
||||
regionY = regY;
|
||||
}
|
||||
|
||||
public void SetSessionHandler(AddNewSessionHandler sessionHandler)
|
||||
{
|
||||
this.AddSession = sessionHandler;
|
||||
}
|
||||
|
||||
public override void InitUserProfiles()
|
||||
{
|
||||
// TODO: need to load from database
|
||||
@@ -100,15 +106,18 @@ namespace OpenSim.UserServer
|
||||
_login.Agent = new LLUUID((string)response["agent_id"]) ;
|
||||
_login.Session = new LLUUID((string)response["session_id"]);
|
||||
_login.SecureSession = new LLUUID((string)response["secure_session_id"]);
|
||||
_login.CircuitCode =(uint) circode;
|
||||
_login.BaseFolder = null;
|
||||
_login.InventoryFolder = new LLUUID((string)Inventory1["folder_id"]);
|
||||
|
||||
//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")
|
||||
{
|
||||
Console.WriteLine("adding login data to gridserver");
|
||||
((LocalGridBase)this.m_gridServer).AddNewSession(_login);
|
||||
}
|
||||
}*/
|
||||
|
||||
this.AddSession(_login);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ using OpenSim.Framework.Types;
|
||||
|
||||
namespace OpenSim.UserServer
|
||||
{
|
||||
public delegate void AddNewSessionHandler(Login loginData);
|
||||
/// <summary>
|
||||
/// When running in local (default) mode , handles client logins.
|
||||
/// </summary>
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user