Quite big change to how Sessions/circuits are Authenticated. Seems to work okay but needs a lot more testing.
parent
6056247ac3
commit
1e9a0220e6
|
@ -11,10 +11,12 @@ namespace OpenSim.Framework.Types
|
|||
public LLUUID AgentID;
|
||||
public LLUUID SessionID;
|
||||
public LLUUID SecureSessionID;
|
||||
public LLVector3 startpos;
|
||||
public LLVector3 startpos;
|
||||
public string firstname;
|
||||
public string lastname;
|
||||
public uint circuitcode;
|
||||
public bool child;
|
||||
public bool child;
|
||||
public LLUUID InventoryFolder;
|
||||
public LLUUID BaseFolder;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,8 @@ namespace OpenSim.Framework.Types
|
|||
public LLUUID SecureSession = LLUUID.Zero;
|
||||
public LLUUID InventoryFolder;
|
||||
public LLUUID BaseFolder;
|
||||
public uint CircuitCode;
|
||||
|
||||
public Login()
|
||||
{
|
||||
|
||||
|
|
|
@ -44,8 +44,8 @@ namespace OpenSim.GridInterfaces.Remote
|
|||
private string GridSendKey;
|
||||
private string GridRecvKey;
|
||||
private Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
|
||||
private ArrayList simneighbours = new ArrayList();
|
||||
private Hashtable griddatahash;
|
||||
private ArrayList simneighbours = new ArrayList();
|
||||
private Hashtable griddatahash;
|
||||
|
||||
public override Dictionary<uint, AgentCircuitData> agentcircuits
|
||||
{
|
||||
|
@ -59,7 +59,7 @@ namespace OpenSim.GridInterfaces.Remote
|
|||
set { simneighbours = value; }
|
||||
}
|
||||
|
||||
public override Hashtable GridData
|
||||
public override Hashtable GridData
|
||||
{
|
||||
get { return griddatahash; }
|
||||
set { griddatahash = value; }
|
||||
|
@ -68,34 +68,35 @@ namespace OpenSim.GridInterfaces.Remote
|
|||
|
||||
public RemoteGridServer()
|
||||
{
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Remote Grid Server class created");
|
||||
OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Remote Grid Server class created");
|
||||
}
|
||||
|
||||
public override bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port)
|
||||
{
|
||||
Hashtable GridParams = new Hashtable();
|
||||
GridParams["authkey"]=GridSendKey;
|
||||
GridParams["UUID"]=SimUUID.ToString();
|
||||
GridParams["sim_ip"]=sim_ip;
|
||||
GridParams["sim_port"]=sim_port.ToString();
|
||||
ArrayList SendParams = new ArrayList();
|
||||
Hashtable GridParams = new Hashtable();
|
||||
GridParams["authkey"] = GridSendKey;
|
||||
GridParams["UUID"] = SimUUID.ToString();
|
||||
GridParams["sim_ip"] = sim_ip;
|
||||
GridParams["sim_port"] = sim_port.ToString();
|
||||
ArrayList SendParams = new ArrayList();
|
||||
SendParams.Add(GridParams);
|
||||
|
||||
XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
|
||||
XmlRpcResponse GridResp = GridReq.Send(this.GridServerUrl, 3000);
|
||||
Hashtable GridRespData = (Hashtable)GridResp.Value;
|
||||
this.griddatahash=GridRespData;
|
||||
Hashtable GridRespData = (Hashtable)GridResp.Value;
|
||||
this.griddatahash = GridRespData;
|
||||
|
||||
if(GridRespData.ContainsKey("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,errorstring);
|
||||
return false;
|
||||
}
|
||||
this.neighbours = (ArrayList)GridRespData["neighbours"];
|
||||
Console.WriteLine(simneighbours.Count);
|
||||
return true;
|
||||
}
|
||||
if (GridRespData.ContainsKey("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, errorstring);
|
||||
return false;
|
||||
}
|
||||
this.neighbours = (ArrayList)GridRespData["neighbours"];
|
||||
Console.WriteLine(simneighbours.Count);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode)
|
||||
{
|
||||
|
@ -120,7 +121,7 @@ namespace OpenSim.GridInterfaces.Remote
|
|||
user.LoginInfo.Agent = agentID;
|
||||
user.LoginInfo.Session = sessionID;
|
||||
user.LoginInfo.SecureSession = validcircuit.SecureSessionID;
|
||||
user.LoginInfo.First = validcircuit.firstname;
|
||||
user.LoginInfo.First = validcircuit.firstname;
|
||||
user.LoginInfo.Last = validcircuit.lastname;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
|
@ -6,7 +6,8 @@
|
|||
<ProjectGuid>{632E1BFD-0000-0000-0000-000000000000}</ProjectGuid>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon></ApplicationIcon>
|
||||
<ApplicationIcon>
|
||||
</ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>OpenSim.RegionServer</AssemblyName>
|
||||
|
@ -15,9 +16,11 @@
|
|||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder></AppDesignerFolder>
|
||||
<AppDesignerFolder>
|
||||
</AppDesignerFolder>
|
||||
<RootNamespace>OpenSim.RegionServer</RootNamespace>
|
||||
<StartupObject></StartupObject>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
</PropertyGroup>
|
||||
|
@ -28,7 +31,8 @@
|
|||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>True</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>False</Optimize>
|
||||
|
@ -37,7 +41,8 @@
|
|||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks>
|
||||
|
@ -46,7 +51,8 @@
|
|||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile></DocumentationFile>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<Optimize>True</Optimize>
|
||||
|
@ -55,26 +61,28 @@
|
|||
<RemoveIntegerChecks>False</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<NoWarn></NoWarn>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" >
|
||||
<Reference Include="System">
|
||||
<HintPath>System.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" >
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml">
|
||||
<HintPath>System.Xml.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="libsecondlife.dll" >
|
||||
<Reference Include="libsecondlife.dll">
|
||||
<HintPath>..\bin\libsecondlife.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Axiom.MathLib.dll" >
|
||||
<Reference Include="Axiom.MathLib.dll">
|
||||
<HintPath>..\bin\Axiom.MathLib.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Db4objects.Db4o.dll" >
|
||||
<Reference Include="Db4objects.Db4o.dll">
|
||||
<HintPath>..\bin\Db4objects.Db4o.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
|
@ -84,49 +92,52 @@
|
|||
<Name>OpenSim.Terrain.BasicTerrain</Name>
|
||||
<Project>{2270B8FE-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
|
||||
<Name>OpenSim.Framework</Name>
|
||||
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
|
||||
<Name>OpenSim.Framework.Console</Name>
|
||||
<Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj">
|
||||
<Name>OpenSim.GenericConfig.Xml</Name>
|
||||
<Project>{E88EF749-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj">
|
||||
<Name>OpenSim.Physics.Manager</Name>
|
||||
<Project>{8BE16150-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\OpenSim.Servers\OpenSim.Servers.csproj">
|
||||
<Name>OpenSim.Servers</Name>
|
||||
<Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj">
|
||||
<Name>XMLRPC</Name>
|
||||
<Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
|
||||
<Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
|
||||
<Private>False</Private>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AgentAssetUpload.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="AuthenticateSessionsBase.cs" />
|
||||
<Compile Include="AuthenticateSessionsLocal.cs" />
|
||||
<Compile Include="AuthenticateSessionsRemote.cs" />
|
||||
<Compile Include="Grid.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
|
@ -150,12 +161,16 @@
|
|||
</Compile>
|
||||
<Compile Include="SimClient.Grid.cs">
|
||||
<SubType>Code</SubType>
|
||||
<DependentUpon>SimClient.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SimClient.PacketHandlers.cs">
|
||||
<SubType>Code</SubType>
|
||||
<DependentUpon>SimClient.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SimClient.ProcessPackets.cs">
|
||||
<SubType>Code</SubType>
|
||||
<DependentUpon>SimClient.cs</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SimClientBase.cs">
|
||||
<SubType>Code</SubType>
|
||||
|
@ -183,12 +198,14 @@
|
|||
</Compile>
|
||||
<Compile Include="world\Avatar.Client.cs">
|
||||
<SubType>Code</SubType>
|
||||
<DependentUpon>Avatar.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="world\Avatar.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="world\Avatar.Update.cs">
|
||||
<SubType>Code</SubType>
|
||||
<DependentUpon>Avatar.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="world\AvatarAnimations.cs">
|
||||
<SubType>Code</SubType>
|
||||
|
@ -210,9 +227,11 @@
|
|||
</Compile>
|
||||
<Compile Include="world\World.PacketHandlers.cs">
|
||||
<SubType>Code</SubType>
|
||||
<DependentUpon>World.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="world\World.Scripting.cs">
|
||||
<SubType>Code</SubType>
|
||||
<DependentUpon>World.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="world\scripting\IScriptContext.cs">
|
||||
<SubType>Code</SubType>
|
||||
|
@ -240,4 +259,4 @@
|
|||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
|
@ -12,6 +12,8 @@
|
|||
</resources>
|
||||
<sources failonempty="true">
|
||||
<include name="AgentAssetUpload.cs" />
|
||||
<include name="AuthenticateSessionsBase.cs" />
|
||||
<include name="AuthenticateSessionsLocal.cs" />
|
||||
<include name="Grid.cs" />
|
||||
<include name="OpenSimMain.cs" />
|
||||
<include name="OpenSimNetworkHandler.cs" />
|
||||
|
|
|
@ -77,6 +77,7 @@ namespace OpenSim
|
|||
|
||||
private UDPServer m_udpServer;
|
||||
protected BaseHttpServer httpServer;
|
||||
private AuthenticateSessionsBase AuthenticateSessionsHandler;
|
||||
|
||||
protected ConsoleBase m_console;
|
||||
|
||||
|
@ -144,8 +145,19 @@ namespace OpenSim
|
|||
Environment.Exit(1);
|
||||
}
|
||||
|
||||
//PacketServer packetServer = new PacketServer(this);
|
||||
m_udpServer = new UDPServer(this.regionData.IPListenPort, this.GridServers, this.AssetCache, this.InventoryCache, this.regionData, this.m_sandbox, this.user_accounts, this.m_console);
|
||||
//Authenticate Session Handler
|
||||
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
|
||||
GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey);
|
||||
|
@ -174,8 +186,9 @@ namespace OpenSim
|
|||
bool sandBoxWithLoginServer = m_loginserver && m_sandbox;
|
||||
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.SetSessionHandler(((AuthenticateSessionsLocal) this.AuthenticateSessionsHandler).AddNewSession);
|
||||
|
||||
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
|
||||
httpServer.AddXmlRPCHandler("expect_user",
|
||||
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("expect_user", ((AuthenticateSessionsRemote)this.AuthenticateSessionsHandler).ExpectUser );
|
||||
|
||||
httpServer.AddXmlRPCHandler("agent_crossing",
|
||||
delegate(XmlRpcRequest request)
|
||||
|
|
|
@ -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");
|
||||
cirpack = initialcirpack;
|
||||
userEP = remoteEP;
|
||||
if (m_gridServer.GetName() == "Remote")
|
||||
/* if (m_gridServer.GetName() == "Remote")
|
||||
{
|
||||
this.startpos = ((RemoteGridBase)m_gridServer).agentcircuits[initialcirpack.CircuitCode.Code].startpos;
|
||||
}
|
||||
else
|
||||
{
|
||||
{*/
|
||||
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>();
|
||||
|
||||
this.UploadAssets = new AgentAssetUpload(this, m_assetCache, m_inventoryCache);
|
||||
|
|
|
@ -47,6 +47,8 @@ namespace OpenSim
|
|||
private bool m_sandbox = false;
|
||||
private bool user_accounts = false;
|
||||
private ConsoleBase m_console;
|
||||
private AuthenticateSessionsBase m_authenticateSessionsClass;
|
||||
|
||||
public AuthenticateSessionHandler AuthenticateHandler;
|
||||
|
||||
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;
|
||||
this.m_gridServers = gridServers;
|
||||
|
@ -80,10 +82,11 @@ namespace OpenSim
|
|||
this.m_sandbox = sandbox;
|
||||
this.user_accounts = accounts;
|
||||
this.m_console = console;
|
||||
this.m_authenticateSessionsClass = authenticateClass;
|
||||
PacketServer packetServer = new PacketServer(this);
|
||||
|
||||
//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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
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}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Storage.LocalStorageBerkeleyDB", "OpenSim.Storage\LocalStorageBerkeleyDB\OpenSim.Storage.LocalStorageBerkeleyDB.csproj", "{EE9E5D96-0000-0000-0000-000000000000}"
|
||||
|
|
Loading…
Reference in New Issue