Quite big change to how Sessions/circuits are Authenticated. Seems to work okay but needs a lot more testing.

zircon^2
MW 2007-05-16 17:35:27 +00:00
parent 6056247ac3
commit 1e9a0220e6
14 changed files with 263 additions and 94 deletions

View File

@ -16,5 +16,7 @@ namespace OpenSim.Framework.Types
public string lastname; public string lastname;
public uint circuitcode; public uint circuitcode;
public bool child; public bool child;
public LLUUID InventoryFolder;
public LLUUID BaseFolder;
} }
} }

View File

@ -14,6 +14,8 @@ namespace OpenSim.Framework.Types
public LLUUID SecureSession = LLUUID.Zero; public LLUUID SecureSession = LLUUID.Zero;
public LLUUID InventoryFolder; public LLUUID InventoryFolder;
public LLUUID BaseFolder; public LLUUID BaseFolder;
public uint CircuitCode;
public Login() public Login()
{ {

View File

@ -86,7 +86,8 @@ namespace OpenSim.GridInterfaces.Remote
Hashtable GridRespData = (Hashtable)GridResp.Value; Hashtable GridRespData = (Hashtable)GridResp.Value;
this.griddatahash = GridRespData; this.griddatahash = GridRespData;
if(GridRespData.ContainsKey("error")) { if (GridRespData.ContainsKey("error"))
{
string errorstring = (string)GridRespData["error"]; string errorstring = (string)GridRespData["error"];
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "Error connecting to grid:"); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "Error connecting to grid:");
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, errorstring); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, errorstring);

View File

@ -0,0 +1,67 @@
using System;
using System.Collections.Generic;
using System.Text;
using libsecondlife;
using OpenSim.Framework.Interfaces;
using OpenSim.Framework.Types;
namespace OpenSim
{
public class AuthenticateSessionsBase
{
private Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
public AuthenticateSessionsBase()
{
}
public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode)
{
AgentCircuitData validcircuit = null;
if (this.AgentCircuits.ContainsKey(circuitcode))
{
validcircuit = this.AgentCircuits[circuitcode];
}
AuthenticateResponse user = new AuthenticateResponse();
if (validcircuit == null)
{
//don't have this circuit code in our list
user.Authorised = false;
return (user);
}
if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID))
{
user.Authorised = true;
user.LoginInfo = new Login();
user.LoginInfo.Agent = agentID;
user.LoginInfo.Session = sessionID;
user.LoginInfo.SecureSession = validcircuit.SecureSessionID;
user.LoginInfo.First = validcircuit.firstname;
user.LoginInfo.Last = validcircuit.lastname;
user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder;
user.LoginInfo.BaseFolder = validcircuit.BaseFolder;
}
else
{
// Invalid
user.Authorised = false;
}
return (user);
}
public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData)
{
if (this.AgentCircuits.ContainsKey(circuitCode))
{
this.AgentCircuits[circuitCode] = agentData;
}
else
{
this.AgentCircuits.Add(circuitCode, agentData);
}
}
}
}

View File

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Framework.Types;
namespace OpenSim
{
public class AuthenticateSessionsLocal : AuthenticateSessionsBase
{
public AuthenticateSessionsLocal()
{
}
public void AddNewSession(Login loginData)
{
AgentCircuitData agent = new AgentCircuitData();
agent.AgentID = loginData.Agent;
agent.firstname = loginData.First;
agent.lastname = loginData.Last;
agent.SessionID = loginData.Session;
agent.SecureSessionID = loginData.SecureSession;
agent.circuitcode = loginData.CircuitCode;
agent.BaseFolder = loginData.BaseFolder;
agent.InventoryFolder = loginData.InventoryFolder;
this.AddNewCircuit(agent.circuitcode, agent);
}
}
}

View File

@ -0,0 +1,44 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using libsecondlife;
using OpenSim.Framework.Types;
using Nwc.XmlRpc;
namespace OpenSim
{
public class AuthenticateSessionsRemote : AuthenticateSessionsBase
{
public AuthenticateSessionsRemote()
{
}
public XmlRpcResponse ExpectUser(XmlRpcRequest request)
{
Hashtable requestData = (Hashtable)request.Params[0];
AgentCircuitData agentData = new AgentCircuitData();
agentData.SessionID = new LLUUID((string)requestData["session_id"]);
agentData.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]);
agentData.firstname = (string)requestData["firstname"];
agentData.lastname = (string)requestData["lastname"];
agentData.AgentID = new LLUUID((string)requestData["agent_id"]);
agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1"))
{
agentData.child = true;
}
else
{
agentData.startpos = new LLVector3(Convert.ToUInt32(requestData["startpos_x"]), Convert.ToUInt32(requestData["startpos_y"]), Convert.ToUInt32(requestData["startpos_z"]));
agentData.child = false;
}
this.AddNewCircuit(agentData.circuitcode, agentData);
return new XmlRpcResponse();
}
}
}

View File

@ -1,4 +1,4 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectType>Local</ProjectType> <ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion> <ProductVersion>8.0.50727</ProductVersion>
@ -6,7 +6,8 @@
<ProjectGuid>{632E1BFD-0000-0000-0000-000000000000}</ProjectGuid> <ProjectGuid>{632E1BFD-0000-0000-0000-000000000000}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon></ApplicationIcon> <ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName> <AssemblyKeyContainerName>
</AssemblyKeyContainerName> </AssemblyKeyContainerName>
<AssemblyName>OpenSim.RegionServer</AssemblyName> <AssemblyName>OpenSim.RegionServer</AssemblyName>
@ -15,9 +16,11 @@
<DefaultTargetSchema>IE50</DefaultTargetSchema> <DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign> <DelaySign>false</DelaySign>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder></AppDesignerFolder> <AppDesignerFolder>
</AppDesignerFolder>
<RootNamespace>OpenSim.RegionServer</RootNamespace> <RootNamespace>OpenSim.RegionServer</RootNamespace>
<StartupObject></StartupObject> <StartupObject>
</StartupObject>
<FileUpgradeFlags> <FileUpgradeFlags>
</FileUpgradeFlags> </FileUpgradeFlags>
</PropertyGroup> </PropertyGroup>
@ -28,7 +31,8 @@
<ConfigurationOverrideFile> <ConfigurationOverrideFile>
</ConfigurationOverrideFile> </ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG</DefineConstants> <DefineConstants>TRACE;DEBUG</DefineConstants>
<DocumentationFile></DocumentationFile> <DocumentationFile>
</DocumentationFile>
<DebugSymbols>True</DebugSymbols> <DebugSymbols>True</DebugSymbols>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<Optimize>False</Optimize> <Optimize>False</Optimize>
@ -37,7 +41,8 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks> <RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors> <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn></NoWarn> <NoWarn>
</NoWarn>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@ -46,7 +51,8 @@
<ConfigurationOverrideFile> <ConfigurationOverrideFile>
</ConfigurationOverrideFile> </ConfigurationOverrideFile>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<DocumentationFile></DocumentationFile> <DocumentationFile>
</DocumentationFile>
<DebugSymbols>False</DebugSymbols> <DebugSymbols>False</DebugSymbols>
<FileAlignment>4096</FileAlignment> <FileAlignment>4096</FileAlignment>
<Optimize>True</Optimize> <Optimize>True</Optimize>
@ -55,13 +61,15 @@
<RemoveIntegerChecks>False</RemoveIntegerChecks> <RemoveIntegerChecks>False</RemoveIntegerChecks>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors> <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<NoWarn></NoWarn> <NoWarn>
</NoWarn>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System"> <Reference Include="System">
<HintPath>System.dll</HintPath> <HintPath>System.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="System.Data" />
<Reference Include="System.Xml"> <Reference Include="System.Xml">
<HintPath>System.Xml.dll</HintPath> <HintPath>System.Xml.dll</HintPath>
<Private>False</Private> <Private>False</Private>
@ -127,6 +135,9 @@
<Compile Include="AgentAssetUpload.cs"> <Compile Include="AgentAssetUpload.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="AuthenticateSessionsBase.cs" />
<Compile Include="AuthenticateSessionsLocal.cs" />
<Compile Include="AuthenticateSessionsRemote.cs" />
<Compile Include="Grid.cs"> <Compile Include="Grid.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
@ -150,12 +161,16 @@
</Compile> </Compile>
<Compile Include="SimClient.Grid.cs"> <Compile Include="SimClient.Grid.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
<DependentUpon>SimClient.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="SimClient.PacketHandlers.cs"> <Compile Include="SimClient.PacketHandlers.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
<DependentUpon>SimClient.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="SimClient.ProcessPackets.cs"> <Compile Include="SimClient.ProcessPackets.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
<DependentUpon>SimClient.cs</DependentUpon>
<SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="SimClientBase.cs"> <Compile Include="SimClientBase.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
@ -183,12 +198,14 @@
</Compile> </Compile>
<Compile Include="world\Avatar.Client.cs"> <Compile Include="world\Avatar.Client.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
<DependentUpon>Avatar.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="world\Avatar.cs"> <Compile Include="world\Avatar.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Include="world\Avatar.Update.cs"> <Compile Include="world\Avatar.Update.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
<DependentUpon>Avatar.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="world\AvatarAnimations.cs"> <Compile Include="world\AvatarAnimations.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
@ -210,9 +227,11 @@
</Compile> </Compile>
<Compile Include="world\World.PacketHandlers.cs"> <Compile Include="world\World.PacketHandlers.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
<DependentUpon>World.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="world\World.Scripting.cs"> <Compile Include="world\World.Scripting.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
<DependentUpon>World.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="world\scripting\IScriptContext.cs"> <Compile Include="world\scripting\IScriptContext.cs">
<SubType>Code</SubType> <SubType>Code</SubType>

View File

@ -12,6 +12,8 @@
</resources> </resources>
<sources failonempty="true"> <sources failonempty="true">
<include name="AgentAssetUpload.cs" /> <include name="AgentAssetUpload.cs" />
<include name="AuthenticateSessionsBase.cs" />
<include name="AuthenticateSessionsLocal.cs" />
<include name="Grid.cs" /> <include name="Grid.cs" />
<include name="OpenSimMain.cs" /> <include name="OpenSimMain.cs" />
<include name="OpenSimNetworkHandler.cs" /> <include name="OpenSimNetworkHandler.cs" />

View File

@ -77,6 +77,7 @@ namespace OpenSim
private UDPServer m_udpServer; private UDPServer m_udpServer;
protected BaseHttpServer httpServer; protected BaseHttpServer httpServer;
private AuthenticateSessionsBase AuthenticateSessionsHandler;
protected ConsoleBase m_console; protected ConsoleBase m_console;
@ -144,8 +145,19 @@ namespace OpenSim
Environment.Exit(1); Environment.Exit(1);
} }
//PacketServer packetServer = new PacketServer(this); //Authenticate Session Handler
m_udpServer = new UDPServer(this.regionData.IPListenPort, this.GridServers, this.AssetCache, this.InventoryCache, this.regionData, this.m_sandbox, this.user_accounts, this.m_console); if (m_sandbox)
{
AuthenticateSessionsLocal authen = new AuthenticateSessionsLocal();
this.AuthenticateSessionsHandler = authen;
}
else
{
AuthenticateSessionsRemote authen = new AuthenticateSessionsRemote();
this.AuthenticateSessionsHandler = authen;
}
m_udpServer = new UDPServer(this.regionData.IPListenPort, this.GridServers, this.AssetCache, this.InventoryCache, this.regionData, this.m_sandbox, this.user_accounts, this.m_console, this.AuthenticateSessionsHandler);
//should be passing a IGenericConfig object to these so they can read the config data they want from it //should be passing a IGenericConfig object to these so they can read the config data they want from it
GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey); GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey);
@ -174,8 +186,9 @@ namespace OpenSim
bool sandBoxWithLoginServer = m_loginserver && m_sandbox; bool sandBoxWithLoginServer = m_loginserver && m_sandbox;
if (sandBoxWithLoginServer) if (sandBoxWithLoginServer)
{ {
loginServer = new LoginServer(gridServer, regionData.IPListenAddr, regionData.IPListenPort, regionData.RegionLocX, regionData.RegionLocY, this.user_accounts); loginServer = new LoginServer( regionData.IPListenAddr, regionData.IPListenPort, regionData.RegionLocX, regionData.RegionLocY, this.user_accounts);
loginServer.Startup(); loginServer.Startup();
loginServer.SetSessionHandler(((AuthenticateSessionsLocal) this.AuthenticateSessionsHandler).AddNewSession);
if (user_accounts) if (user_accounts)
{ {
@ -285,38 +298,7 @@ namespace OpenSim
{ {
// we are in Grid mode so set a XmlRpc handler to handle "expect_user" calls from the user server // we are in Grid mode so set a XmlRpc handler to handle "expect_user" calls from the user server
httpServer.AddXmlRPCHandler("expect_user", httpServer.AddXmlRPCHandler("expect_user", ((AuthenticateSessionsRemote)this.AuthenticateSessionsHandler).ExpectUser );
delegate(XmlRpcRequest request)
{
Hashtable requestData = (Hashtable)request.Params[0];
AgentCircuitData agent_data = new AgentCircuitData();
agent_data.SessionID = new LLUUID((string)requestData["session_id"]);
agent_data.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]);
agent_data.firstname = (string)requestData["firstname"];
agent_data.lastname = (string)requestData["lastname"];
agent_data.AgentID = new LLUUID((string)requestData["agent_id"]);
agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1"))
{
agent_data.child = true;
}
else
{
agent_data.startpos = new LLVector3(Convert.ToUInt32(requestData["startpos_x"]), Convert.ToUInt32(requestData["startpos_y"]), Convert.ToUInt32(requestData["startpos_z"]));
agent_data.child = false;
}
if (((RemoteGridBase)this.GridServers.GridServer).agentcircuits.ContainsKey((uint)agent_data.circuitcode))
{
((RemoteGridBase)this.GridServers.GridServer).agentcircuits[(uint)agent_data.circuitcode] = agent_data;
}
else
{
((RemoteGridBase)this.GridServers.GridServer).agentcircuits.Add((uint)agent_data.circuitcode, agent_data);
}
return new XmlRpcResponse();
});
httpServer.AddXmlRPCHandler("agent_crossing", httpServer.AddXmlRPCHandler("agent_crossing",
delegate(XmlRpcRequest request) delegate(XmlRpcRequest request)

View File

@ -113,14 +113,14 @@ namespace OpenSim
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs - Started up new client thread to handle incoming request"); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs - Started up new client thread to handle incoming request");
cirpack = initialcirpack; cirpack = initialcirpack;
userEP = remoteEP; userEP = remoteEP;
if (m_gridServer.GetName() == "Remote") /* if (m_gridServer.GetName() == "Remote")
{ {
this.startpos = ((RemoteGridBase)m_gridServer).agentcircuits[initialcirpack.CircuitCode.Code].startpos; this.startpos = ((RemoteGridBase)m_gridServer).agentcircuits[initialcirpack.CircuitCode.Code].startpos;
} }
else else
{ {*/
this.startpos = new LLVector3(128, 128, m_world.Terrain[(int)128, (int)128] + 15.0f); // new LLVector3(128.0f, 128.0f, 60f); this.startpos = new LLVector3(128, 128, m_world.Terrain[(int)128, (int)128] + 15.0f); // new LLVector3(128.0f, 128.0f, 60f);
} //}
PacketQueue = new BlockingQueue<QueItem>(); PacketQueue = new BlockingQueue<QueItem>();
this.UploadAssets = new AgentAssetUpload(this, m_assetCache, m_inventoryCache); this.UploadAssets = new AgentAssetUpload(this, m_assetCache, m_inventoryCache);

View File

@ -47,6 +47,8 @@ namespace OpenSim
private bool m_sandbox = false; private bool m_sandbox = false;
private bool user_accounts = false; private bool user_accounts = false;
private ConsoleBase m_console; private ConsoleBase m_console;
private AuthenticateSessionsBase m_authenticateSessionsClass;
public AuthenticateSessionHandler AuthenticateHandler; public AuthenticateSessionHandler AuthenticateHandler;
public PacketServer PacketServer public PacketServer PacketServer
@ -70,7 +72,7 @@ namespace OpenSim
} }
} }
public UDPServer(int port, Grid gridServers, AssetCache assetCache, InventoryCache inventoryCache, RegionInfo _regionData, bool sandbox, bool accounts, ConsoleBase console) public UDPServer(int port, Grid gridServers, AssetCache assetCache, InventoryCache inventoryCache, RegionInfo _regionData, bool sandbox, bool accounts, ConsoleBase console , AuthenticateSessionsBase authenticateClass)
{ {
listenPort = port; listenPort = port;
this.m_gridServers = gridServers; this.m_gridServers = gridServers;
@ -80,10 +82,11 @@ namespace OpenSim
this.m_sandbox = sandbox; this.m_sandbox = sandbox;
this.user_accounts = accounts; this.user_accounts = accounts;
this.m_console = console; this.m_console = console;
this.m_authenticateSessionsClass = authenticateClass;
PacketServer packetServer = new PacketServer(this); PacketServer packetServer = new PacketServer(this);
//set up delegate for authenticate sessions //set up delegate for authenticate sessions
this.AuthenticateHandler = new AuthenticateSessionHandler(this.m_gridServers.GridServer.AuthenticateSession); this.AuthenticateHandler = new AuthenticateSessionHandler(this.m_authenticateSessionsClass.AuthenticateSession);
} }
protected virtual void OnReceivedData(IAsyncResult result) protected virtual void OnReceivedData(IAsyncResult result)

View File

@ -45,6 +45,7 @@ namespace OpenSim.UserServer
private string m_ipAddr; private string m_ipAddr;
private uint regionX; private uint regionX;
private uint regionY; private uint regionY;
private AddNewSessionHandler AddSession;
public LocalUserProfileManager(IGridServer gridServer, int simPort, string ipAddr , uint regX, uint regY) public LocalUserProfileManager(IGridServer gridServer, int simPort, string ipAddr , uint regX, uint regY)
{ {
@ -55,6 +56,11 @@ namespace OpenSim.UserServer
regionY = regY; regionY = regY;
} }
public void SetSessionHandler(AddNewSessionHandler sessionHandler)
{
this.AddSession = sessionHandler;
}
public override void InitUserProfiles() public override void InitUserProfiles()
{ {
// TODO: need to load from database // TODO: need to load from database
@ -100,15 +106,18 @@ namespace OpenSim.UserServer
_login.Agent = new LLUUID((string)response["agent_id"]) ; _login.Agent = new LLUUID((string)response["agent_id"]) ;
_login.Session = new LLUUID((string)response["session_id"]); _login.Session = new LLUUID((string)response["session_id"]);
_login.SecureSession = new LLUUID((string)response["secure_session_id"]); _login.SecureSession = new LLUUID((string)response["secure_session_id"]);
_login.CircuitCode =(uint) circode;
_login.BaseFolder = null; _login.BaseFolder = null;
_login.InventoryFolder = new LLUUID((string)Inventory1["folder_id"]); _login.InventoryFolder = new LLUUID((string)Inventory1["folder_id"]);
//working on local computer if so lets add to the gridserver's list of sessions? //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"); Console.WriteLine("adding login data to gridserver");
((LocalGridBase)this.m_gridServer).AddNewSession(_login); ((LocalGridBase)this.m_gridServer).AddNewSession(_login);
} }*/
this.AddSession(_login);
} }
} }
} }

View File

@ -47,6 +47,7 @@ using OpenSim.Framework.Types;
namespace OpenSim.UserServer namespace OpenSim.UserServer
{ {
public delegate void AddNewSessionHandler(Login loginData);
/// <summary> /// <summary>
/// When running in local (default) mode , handles client logins. /// When running in local (default) mode , handles client logins.
/// </summary> /// </summary>
@ -64,6 +65,7 @@ namespace OpenSim.UserServer
private string m_simAddr; private string m_simAddr;
private uint regionX; private uint regionX;
private uint regionY; private uint regionY;
private AddNewSessionHandler AddSession;
public LocalUserProfileManager LocalUserManager 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_simPort = simPort;
m_simAddr = simAddr; m_simAddr = simAddr;
regionX = regX; regionX = regX;
@ -83,6 +84,12 @@ namespace OpenSim.UserServer
this.userAccounts = useAccounts; this.userAccounts = useAccounts;
} }
public void SetSessionHandler(AddNewSessionHandler sessionHandler)
{
this.AddSession = sessionHandler;
this.userManager.SetSessionHandler(sessionHandler);
}
public void Startup() public void Startup()
{ {
this._needPasswd = false; this._needPasswd = false;
@ -180,15 +187,16 @@ namespace OpenSim.UserServer
_login.Agent = loginResponse.AgentID; _login.Agent = loginResponse.AgentID;
_login.Session = loginResponse.SessionID; _login.Session = loginResponse.SessionID;
_login.SecureSession = loginResponse.SecureSessionID; _login.SecureSession = loginResponse.SecureSessionID;
_login.CircuitCode = (uint) loginResponse.CircuitCode;
_login.BaseFolder = loginResponse.BaseFolderID; _login.BaseFolder = loginResponse.BaseFolderID;
_login.InventoryFolder = loginResponse.InventoryFolderID; _login.InventoryFolder = loginResponse.InventoryFolderID;
//working on local computer if so lets add to the gridserver's list of sessions? //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); ((LocalGridBase)m_gridServer).AddNewSession(_login);
} }*/
AddSession(_login);
return response; return response;
} }

View File

@ -1,5 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 9.00 Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005 # Visual C# Express 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Terrain.BasicTerrain", "OpenSim.Terrain.BasicTerrain\OpenSim.Terrain.BasicTerrain.csproj", "{2270B8FE-0000-0000-0000-000000000000}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Terrain.BasicTerrain", "OpenSim.Terrain.BasicTerrain\OpenSim.Terrain.BasicTerrain.csproj", "{2270B8FE-0000-0000-0000-000000000000}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Storage.LocalStorageBerkeleyDB", "OpenSim.Storage\LocalStorageBerkeleyDB\OpenSim.Storage.LocalStorageBerkeleyDB.csproj", "{EE9E5D96-0000-0000-0000-000000000000}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Storage.LocalStorageBerkeleyDB", "OpenSim.Storage\LocalStorageBerkeleyDB\OpenSim.Storage.LocalStorageBerkeleyDB.csproj", "{EE9E5D96-0000-0000-0000-000000000000}"