aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim.RegionServer/AuthenticateSessionsBase.cs67
-rw-r--r--OpenSim.RegionServer/AuthenticateSessionsLocal.cs30
-rw-r--r--OpenSim.RegionServer/AuthenticateSessionsRemote.cs44
-rw-r--r--OpenSim.RegionServer/OpenSim.RegionServer.csproj61
-rw-r--r--OpenSim.RegionServer/OpenSim.RegionServer.dll.build2
-rw-r--r--OpenSim.RegionServer/OpenSimMain.cs52
-rw-r--r--OpenSim.RegionServer/SimClient.cs6
-rw-r--r--OpenSim.RegionServer/UDPServer.cs7
8 files changed, 208 insertions, 61 deletions
diff --git a/OpenSim.RegionServer/AuthenticateSessionsBase.cs b/OpenSim.RegionServer/AuthenticateSessionsBase.cs
new file mode 100644
index 0000000..019fcc2
--- /dev/null
+++ b/OpenSim.RegionServer/AuthenticateSessionsBase.cs
@@ -0,0 +1,67 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using libsecondlife;
5using OpenSim.Framework.Interfaces;
6using OpenSim.Framework.Types;
7
8namespace OpenSim
9{
10 public class AuthenticateSessionsBase
11 {
12 private Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
13
14 public AuthenticateSessionsBase()
15 {
16
17 }
18
19 public virtual AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode)
20 {
21 AgentCircuitData validcircuit = null;
22 if (this.AgentCircuits.ContainsKey(circuitcode))
23 {
24 validcircuit = this.AgentCircuits[circuitcode];
25 }
26 AuthenticateResponse user = new AuthenticateResponse();
27 if (validcircuit == null)
28 {
29 //don't have this circuit code in our list
30 user.Authorised = false;
31 return (user);
32 }
33
34 if ((sessionID == validcircuit.SessionID) && (agentID == validcircuit.AgentID))
35 {
36 user.Authorised = true;
37 user.LoginInfo = new Login();
38 user.LoginInfo.Agent = agentID;
39 user.LoginInfo.Session = sessionID;
40 user.LoginInfo.SecureSession = validcircuit.SecureSessionID;
41 user.LoginInfo.First = validcircuit.firstname;
42 user.LoginInfo.Last = validcircuit.lastname;
43 user.LoginInfo.InventoryFolder = validcircuit.InventoryFolder;
44 user.LoginInfo.BaseFolder = validcircuit.BaseFolder;
45 }
46 else
47 {
48 // Invalid
49 user.Authorised = false;
50 }
51
52 return (user);
53 }
54
55 public virtual void AddNewCircuit(uint circuitCode, AgentCircuitData agentData)
56 {
57 if (this.AgentCircuits.ContainsKey(circuitCode))
58 {
59 this.AgentCircuits[circuitCode] = agentData;
60 }
61 else
62 {
63 this.AgentCircuits.Add(circuitCode, agentData);
64 }
65 }
66 }
67}
diff --git a/OpenSim.RegionServer/AuthenticateSessionsLocal.cs b/OpenSim.RegionServer/AuthenticateSessionsLocal.cs
new file mode 100644
index 0000000..ca46355
--- /dev/null
+++ b/OpenSim.RegionServer/AuthenticateSessionsLocal.cs
@@ -0,0 +1,30 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenSim.Framework.Types;
5
6namespace OpenSim
7{
8 public class AuthenticateSessionsLocal : AuthenticateSessionsBase
9 {
10 public AuthenticateSessionsLocal()
11 {
12
13 }
14
15 public void AddNewSession(Login loginData)
16 {
17 AgentCircuitData agent = new AgentCircuitData();
18 agent.AgentID = loginData.Agent;
19 agent.firstname = loginData.First;
20 agent.lastname = loginData.Last;
21 agent.SessionID = loginData.Session;
22 agent.SecureSessionID = loginData.SecureSession;
23 agent.circuitcode = loginData.CircuitCode;
24 agent.BaseFolder = loginData.BaseFolder;
25 agent.InventoryFolder = loginData.InventoryFolder;
26
27 this.AddNewCircuit(agent.circuitcode, agent);
28 }
29 }
30}
diff --git a/OpenSim.RegionServer/AuthenticateSessionsRemote.cs b/OpenSim.RegionServer/AuthenticateSessionsRemote.cs
new file mode 100644
index 0000000..57c98e4
--- /dev/null
+++ b/OpenSim.RegionServer/AuthenticateSessionsRemote.cs
@@ -0,0 +1,44 @@
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using System.Text;
5using System.Xml;
6using libsecondlife;
7using OpenSim.Framework.Types;
8using Nwc.XmlRpc;
9
10namespace OpenSim
11{
12 public class AuthenticateSessionsRemote : AuthenticateSessionsBase
13 {
14 public AuthenticateSessionsRemote()
15 {
16
17 }
18
19 public XmlRpcResponse ExpectUser(XmlRpcRequest request)
20 {
21 Hashtable requestData = (Hashtable)request.Params[0];
22 AgentCircuitData agentData = new AgentCircuitData();
23 agentData.SessionID = new LLUUID((string)requestData["session_id"]);
24 agentData.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]);
25 agentData.firstname = (string)requestData["firstname"];
26 agentData.lastname = (string)requestData["lastname"];
27 agentData.AgentID = new LLUUID((string)requestData["agent_id"]);
28 agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
29 if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1"))
30 {
31 agentData.child = true;
32 }
33 else
34 {
35 agentData.startpos = new LLVector3(Convert.ToUInt32(requestData["startpos_x"]), Convert.ToUInt32(requestData["startpos_y"]), Convert.ToUInt32(requestData["startpos_z"]));
36 agentData.child = false;
37 }
38
39 this.AddNewCircuit(agentData.circuitcode, agentData);
40
41 return new XmlRpcResponse();
42 }
43 }
44}
diff --git a/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim.RegionServer/OpenSim.RegionServer.csproj
index b4868bd..b5db7db 100644
--- a/OpenSim.RegionServer/OpenSim.RegionServer.csproj
+++ b/OpenSim.RegionServer/OpenSim.RegionServer.csproj
@@ -1,4 +1,4 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> 1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup> 2 <PropertyGroup>
3 <ProjectType>Local</ProjectType> 3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion> 4 <ProductVersion>8.0.50727</ProductVersion>
@@ -6,7 +6,8 @@
6 <ProjectGuid>{632E1BFD-0000-0000-0000-000000000000}</ProjectGuid> 6 <ProjectGuid>{632E1BFD-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> 7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon> 9 <ApplicationIcon>
10 </ApplicationIcon>
10 <AssemblyKeyContainerName> 11 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName> 12 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.RegionServer</AssemblyName> 13 <AssemblyName>OpenSim.RegionServer</AssemblyName>
@@ -15,9 +16,11 @@
15 <DefaultTargetSchema>IE50</DefaultTargetSchema> 16 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign> 17 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType> 18 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder> 19 <AppDesignerFolder>
20 </AppDesignerFolder>
19 <RootNamespace>OpenSim.RegionServer</RootNamespace> 21 <RootNamespace>OpenSim.RegionServer</RootNamespace>
20 <StartupObject></StartupObject> 22 <StartupObject>
23 </StartupObject>
21 <FileUpgradeFlags> 24 <FileUpgradeFlags>
22 </FileUpgradeFlags> 25 </FileUpgradeFlags>
23 </PropertyGroup> 26 </PropertyGroup>
@@ -28,7 +31,8 @@
28 <ConfigurationOverrideFile> 31 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile> 32 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants> 33 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile> 34 <DocumentationFile>
35 </DocumentationFile>
32 <DebugSymbols>True</DebugSymbols> 36 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment> 37 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize> 38 <Optimize>False</Optimize>
@@ -37,7 +41,8 @@
37 <RemoveIntegerChecks>False</RemoveIntegerChecks> 41 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors> 42 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel> 43 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn> 44 <NoWarn>
45 </NoWarn>
41 </PropertyGroup> 46 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> 47 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks> 48 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
@@ -46,7 +51,8 @@
46 <ConfigurationOverrideFile> 51 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile> 52 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants> 53 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile> 54 <DocumentationFile>
55 </DocumentationFile>
50 <DebugSymbols>False</DebugSymbols> 56 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment> 57 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize> 58 <Optimize>True</Optimize>
@@ -55,26 +61,28 @@
55 <RemoveIntegerChecks>False</RemoveIntegerChecks> 61 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors> 62 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel> 63 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn> 64 <NoWarn>
65 </NoWarn>
59 </PropertyGroup> 66 </PropertyGroup>
60 <ItemGroup> 67 <ItemGroup>
61 <Reference Include="System" > 68 <Reference Include="System">
62 <HintPath>System.dll</HintPath> 69 <HintPath>System.dll</HintPath>
63 <Private>False</Private> 70 <Private>False</Private>
64 </Reference> 71 </Reference>
65 <Reference Include="System.Xml" > 72 <Reference Include="System.Data" />
73 <Reference Include="System.Xml">
66 <HintPath>System.Xml.dll</HintPath> 74 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private> 75 <Private>False</Private>
68 </Reference> 76 </Reference>
69 <Reference Include="libsecondlife.dll" > 77 <Reference Include="libsecondlife.dll">
70 <HintPath>..\bin\libsecondlife.dll</HintPath> 78 <HintPath>..\bin\libsecondlife.dll</HintPath>
71 <Private>False</Private> 79 <Private>False</Private>
72 </Reference> 80 </Reference>
73 <Reference Include="Axiom.MathLib.dll" > 81 <Reference Include="Axiom.MathLib.dll">
74 <HintPath>..\bin\Axiom.MathLib.dll</HintPath> 82 <HintPath>..\bin\Axiom.MathLib.dll</HintPath>
75 <Private>False</Private> 83 <Private>False</Private>
76 </Reference> 84 </Reference>
77 <Reference Include="Db4objects.Db4o.dll" > 85 <Reference Include="Db4objects.Db4o.dll">
78 <HintPath>..\bin\Db4objects.Db4o.dll</HintPath> 86 <HintPath>..\bin\Db4objects.Db4o.dll</HintPath>
79 <Private>False</Private> 87 <Private>False</Private>
80 </Reference> 88 </Reference>
@@ -84,49 +92,52 @@
84 <Name>OpenSim.Terrain.BasicTerrain</Name> 92 <Name>OpenSim.Terrain.BasicTerrain</Name>
85 <Project>{2270B8FE-0000-0000-0000-000000000000}</Project> 93 <Project>{2270B8FE-0000-0000-0000-000000000000}</Project>
86 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 94 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
87 <Private>False</Private> 95 <Private>False</Private>
88 </ProjectReference> 96 </ProjectReference>
89 <ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj"> 97 <ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
90 <Name>OpenSim.Framework</Name> 98 <Name>OpenSim.Framework</Name>
91 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project> 99 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
92 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 100 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
93 <Private>False</Private> 101 <Private>False</Private>
94 </ProjectReference> 102 </ProjectReference>
95 <ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj"> 103 <ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
96 <Name>OpenSim.Framework.Console</Name> 104 <Name>OpenSim.Framework.Console</Name>
97 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project> 105 <Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
98 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 106 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
99 <Private>False</Private> 107 <Private>False</Private>
100 </ProjectReference> 108 </ProjectReference>
101 <ProjectReference Include="..\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj"> 109 <ProjectReference Include="..\OpenSim.GenericConfig\Xml\OpenSim.GenericConfig.Xml.csproj">
102 <Name>OpenSim.GenericConfig.Xml</Name> 110 <Name>OpenSim.GenericConfig.Xml</Name>
103 <Project>{E88EF749-0000-0000-0000-000000000000}</Project> 111 <Project>{E88EF749-0000-0000-0000-000000000000}</Project>
104 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 112 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
105 <Private>False</Private> 113 <Private>False</Private>
106 </ProjectReference> 114 </ProjectReference>
107 <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj"> 115 <ProjectReference Include="..\OpenSim.Physics\Manager\OpenSim.Physics.Manager.csproj">
108 <Name>OpenSim.Physics.Manager</Name> 116 <Name>OpenSim.Physics.Manager</Name>
109 <Project>{8BE16150-0000-0000-0000-000000000000}</Project> 117 <Project>{8BE16150-0000-0000-0000-000000000000}</Project>
110 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 118 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
111 <Private>False</Private> 119 <Private>False</Private>
112 </ProjectReference> 120 </ProjectReference>
113 <ProjectReference Include="..\OpenSim.Servers\OpenSim.Servers.csproj"> 121 <ProjectReference Include="..\OpenSim.Servers\OpenSim.Servers.csproj">
114 <Name>OpenSim.Servers</Name> 122 <Name>OpenSim.Servers</Name>
115 <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project> 123 <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
116 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 124 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
117 <Private>False</Private> 125 <Private>False</Private>
118 </ProjectReference> 126 </ProjectReference>
119 <ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj"> 127 <ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj">
120 <Name>XMLRPC</Name> 128 <Name>XMLRPC</Name>
121 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project> 129 <Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
122 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> 130 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
123 <Private>False</Private> 131 <Private>False</Private>
124 </ProjectReference> 132 </ProjectReference>
125 </ItemGroup> 133 </ItemGroup>
126 <ItemGroup> 134 <ItemGroup>
127 <Compile Include="AgentAssetUpload.cs"> 135 <Compile Include="AgentAssetUpload.cs">
128 <SubType>Code</SubType> 136 <SubType>Code</SubType>
129 </Compile> 137 </Compile>
138 <Compile Include="AuthenticateSessionsBase.cs" />
139 <Compile Include="AuthenticateSessionsLocal.cs" />
140 <Compile Include="AuthenticateSessionsRemote.cs" />
130 <Compile Include="Grid.cs"> 141 <Compile Include="Grid.cs">
131 <SubType>Code</SubType> 142 <SubType>Code</SubType>
132 </Compile> 143 </Compile>
@@ -150,12 +161,16 @@
150 </Compile> 161 </Compile>
151 <Compile Include="SimClient.Grid.cs"> 162 <Compile Include="SimClient.Grid.cs">
152 <SubType>Code</SubType> 163 <SubType>Code</SubType>
164 <DependentUpon>SimClient.cs</DependentUpon>
153 </Compile> 165 </Compile>
154 <Compile Include="SimClient.PacketHandlers.cs"> 166 <Compile Include="SimClient.PacketHandlers.cs">
155 <SubType>Code</SubType> 167 <SubType>Code</SubType>
168 <DependentUpon>SimClient.cs</DependentUpon>
156 </Compile> 169 </Compile>
157 <Compile Include="SimClient.ProcessPackets.cs"> 170 <Compile Include="SimClient.ProcessPackets.cs">
158 <SubType>Code</SubType> 171 <SubType>Code</SubType>
172 <DependentUpon>SimClient.cs</DependentUpon>
173 <SubType>Code</SubType>
159 </Compile> 174 </Compile>
160 <Compile Include="SimClientBase.cs"> 175 <Compile Include="SimClientBase.cs">
161 <SubType>Code</SubType> 176 <SubType>Code</SubType>
@@ -183,12 +198,14 @@
183 </Compile> 198 </Compile>
184 <Compile Include="world\Avatar.Client.cs"> 199 <Compile Include="world\Avatar.Client.cs">
185 <SubType>Code</SubType> 200 <SubType>Code</SubType>
201 <DependentUpon>Avatar.cs</DependentUpon>
186 </Compile> 202 </Compile>
187 <Compile Include="world\Avatar.cs"> 203 <Compile Include="world\Avatar.cs">
188 <SubType>Code</SubType> 204 <SubType>Code</SubType>
189 </Compile> 205 </Compile>
190 <Compile Include="world\Avatar.Update.cs"> 206 <Compile Include="world\Avatar.Update.cs">
191 <SubType>Code</SubType> 207 <SubType>Code</SubType>
208 <DependentUpon>Avatar.cs</DependentUpon>
192 </Compile> 209 </Compile>
193 <Compile Include="world\AvatarAnimations.cs"> 210 <Compile Include="world\AvatarAnimations.cs">
194 <SubType>Code</SubType> 211 <SubType>Code</SubType>
@@ -210,9 +227,11 @@
210 </Compile> 227 </Compile>
211 <Compile Include="world\World.PacketHandlers.cs"> 228 <Compile Include="world\World.PacketHandlers.cs">
212 <SubType>Code</SubType> 229 <SubType>Code</SubType>
230 <DependentUpon>World.cs</DependentUpon>
213 </Compile> 231 </Compile>
214 <Compile Include="world\World.Scripting.cs"> 232 <Compile Include="world\World.Scripting.cs">
215 <SubType>Code</SubType> 233 <SubType>Code</SubType>
234 <DependentUpon>World.cs</DependentUpon>
216 </Compile> 235 </Compile>
217 <Compile Include="world\scripting\IScriptContext.cs"> 236 <Compile Include="world\scripting\IScriptContext.cs">
218 <SubType>Code</SubType> 237 <SubType>Code</SubType>
@@ -240,4 +259,4 @@
240 <PostBuildEvent> 259 <PostBuildEvent>
241 </PostBuildEvent> 260 </PostBuildEvent>
242 </PropertyGroup> 261 </PropertyGroup>
243</Project> 262</Project> \ No newline at end of file
diff --git a/OpenSim.RegionServer/OpenSim.RegionServer.dll.build b/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
index 25f4b60..cff8711 100644
--- a/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
+++ b/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
@@ -12,6 +12,8 @@
12 </resources> 12 </resources>
13 <sources failonempty="true"> 13 <sources failonempty="true">
14 <include name="AgentAssetUpload.cs" /> 14 <include name="AgentAssetUpload.cs" />
15 <include name="AuthenticateSessionsBase.cs" />
16 <include name="AuthenticateSessionsLocal.cs" />
15 <include name="Grid.cs" /> 17 <include name="Grid.cs" />
16 <include name="OpenSimMain.cs" /> 18 <include name="OpenSimMain.cs" />
17 <include name="OpenSimNetworkHandler.cs" /> 19 <include name="OpenSimNetworkHandler.cs" />
diff --git a/OpenSim.RegionServer/OpenSimMain.cs b/OpenSim.RegionServer/OpenSimMain.cs
index 6b89bfe..55dab3b 100644
--- a/OpenSim.RegionServer/OpenSimMain.cs
+++ b/OpenSim.RegionServer/OpenSimMain.cs
@@ -77,6 +77,7 @@ namespace OpenSim
77 77
78 private UDPServer m_udpServer; 78 private UDPServer m_udpServer;
79 protected BaseHttpServer httpServer; 79 protected BaseHttpServer httpServer;
80 private AuthenticateSessionsBase AuthenticateSessionsHandler;
80 81
81 protected ConsoleBase m_console; 82 protected ConsoleBase m_console;
82 83
@@ -144,8 +145,19 @@ namespace OpenSim
144 Environment.Exit(1); 145 Environment.Exit(1);
145 } 146 }
146 147
147 //PacketServer packetServer = new PacketServer(this); 148 //Authenticate Session Handler
148 m_udpServer = new UDPServer(this.regionData.IPListenPort, this.GridServers, this.AssetCache, this.InventoryCache, this.regionData, this.m_sandbox, this.user_accounts, this.m_console); 149 if (m_sandbox)
150 {
151 AuthenticateSessionsLocal authen = new AuthenticateSessionsLocal();
152 this.AuthenticateSessionsHandler = authen;
153 }
154 else
155 {
156 AuthenticateSessionsRemote authen = new AuthenticateSessionsRemote();
157 this.AuthenticateSessionsHandler = authen;
158 }
159
160 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);
149 161
150 //should be passing a IGenericConfig object to these so they can read the config data they want from it 162 //should be passing a IGenericConfig object to these so they can read the config data they want from it
151 GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey); 163 GridServers.AssetServer.SetServerInfo(regionData.AssetURL, regionData.AssetSendKey);
@@ -174,8 +186,9 @@ namespace OpenSim
174 bool sandBoxWithLoginServer = m_loginserver && m_sandbox; 186 bool sandBoxWithLoginServer = m_loginserver && m_sandbox;
175 if (sandBoxWithLoginServer) 187 if (sandBoxWithLoginServer)
176 { 188 {
177 loginServer = new LoginServer(gridServer, regionData.IPListenAddr, regionData.IPListenPort, regionData.RegionLocX, regionData.RegionLocY, this.user_accounts); 189 loginServer = new LoginServer( regionData.IPListenAddr, regionData.IPListenPort, regionData.RegionLocX, regionData.RegionLocY, this.user_accounts);
178 loginServer.Startup(); 190 loginServer.Startup();
191 loginServer.SetSessionHandler(((AuthenticateSessionsLocal) this.AuthenticateSessionsHandler).AddNewSession);
179 192
180 if (user_accounts) 193 if (user_accounts)
181 { 194 {
@@ -285,38 +298,7 @@ namespace OpenSim
285 { 298 {
286 299
287 // we are in Grid mode so set a XmlRpc handler to handle "expect_user" calls from the user server 300 // we are in Grid mode so set a XmlRpc handler to handle "expect_user" calls from the user server
288 httpServer.AddXmlRPCHandler("expect_user", 301 httpServer.AddXmlRPCHandler("expect_user", ((AuthenticateSessionsRemote)this.AuthenticateSessionsHandler).ExpectUser );
289 delegate(XmlRpcRequest request)
290 {
291 Hashtable requestData = (Hashtable)request.Params[0];
292 AgentCircuitData agent_data = new AgentCircuitData();
293 agent_data.SessionID = new LLUUID((string)requestData["session_id"]);
294 agent_data.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]);
295 agent_data.firstname = (string)requestData["firstname"];
296 agent_data.lastname = (string)requestData["lastname"];
297 agent_data.AgentID = new LLUUID((string)requestData["agent_id"]);
298 agent_data.circuitcode = Convert.ToUInt32(requestData["circuit_code"]);
299 if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1"))
300 {
301 agent_data.child = true;
302 }
303 else
304 {
305 agent_data.startpos = new LLVector3(Convert.ToUInt32(requestData["startpos_x"]), Convert.ToUInt32(requestData["startpos_y"]), Convert.ToUInt32(requestData["startpos_z"]));
306 agent_data.child = false;
307 }
308
309 if (((RemoteGridBase)this.GridServers.GridServer).agentcircuits.ContainsKey((uint)agent_data.circuitcode))
310 {
311 ((RemoteGridBase)this.GridServers.GridServer).agentcircuits[(uint)agent_data.circuitcode] = agent_data;
312 }
313 else
314 {
315 ((RemoteGridBase)this.GridServers.GridServer).agentcircuits.Add((uint)agent_data.circuitcode, agent_data);
316 }
317
318 return new XmlRpcResponse();
319 });
320 302
321 httpServer.AddXmlRPCHandler("agent_crossing", 303 httpServer.AddXmlRPCHandler("agent_crossing",
322 delegate(XmlRpcRequest request) 304 delegate(XmlRpcRequest request)
diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs
index 5bd098b..4cf2813 100644
--- a/OpenSim.RegionServer/SimClient.cs
+++ b/OpenSim.RegionServer/SimClient.cs
@@ -113,14 +113,14 @@ namespace OpenSim
113 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs - Started up new client thread to handle incoming request"); 113 OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "OpenSimClient.cs - Started up new client thread to handle incoming request");
114 cirpack = initialcirpack; 114 cirpack = initialcirpack;
115 userEP = remoteEP; 115 userEP = remoteEP;
116 if (m_gridServer.GetName() == "Remote") 116 /* if (m_gridServer.GetName() == "Remote")
117 { 117 {
118 this.startpos = ((RemoteGridBase)m_gridServer).agentcircuits[initialcirpack.CircuitCode.Code].startpos; 118 this.startpos = ((RemoteGridBase)m_gridServer).agentcircuits[initialcirpack.CircuitCode.Code].startpos;
119 } 119 }
120 else 120 else
121 { 121 {*/
122 this.startpos = new LLVector3(128, 128, m_world.Terrain[(int)128, (int)128] + 15.0f); // new LLVector3(128.0f, 128.0f, 60f); 122 this.startpos = new LLVector3(128, 128, m_world.Terrain[(int)128, (int)128] + 15.0f); // new LLVector3(128.0f, 128.0f, 60f);
123 } 123 //}
124 PacketQueue = new BlockingQueue<QueItem>(); 124 PacketQueue = new BlockingQueue<QueItem>();
125 125
126 this.UploadAssets = new AgentAssetUpload(this, m_assetCache, m_inventoryCache); 126 this.UploadAssets = new AgentAssetUpload(this, m_assetCache, m_inventoryCache);
diff --git a/OpenSim.RegionServer/UDPServer.cs b/OpenSim.RegionServer/UDPServer.cs
index 0fd3cdb..e4ac042 100644
--- a/OpenSim.RegionServer/UDPServer.cs
+++ b/OpenSim.RegionServer/UDPServer.cs
@@ -47,6 +47,8 @@ namespace OpenSim
47 private bool m_sandbox = false; 47 private bool m_sandbox = false;
48 private bool user_accounts = false; 48 private bool user_accounts = false;
49 private ConsoleBase m_console; 49 private ConsoleBase m_console;
50 private AuthenticateSessionsBase m_authenticateSessionsClass;
51
50 public AuthenticateSessionHandler AuthenticateHandler; 52 public AuthenticateSessionHandler AuthenticateHandler;
51 53
52 public PacketServer PacketServer 54 public PacketServer PacketServer
@@ -70,7 +72,7 @@ namespace OpenSim
70 } 72 }
71 } 73 }
72 74
73 public UDPServer(int port, Grid gridServers, AssetCache assetCache, InventoryCache inventoryCache, RegionInfo _regionData, bool sandbox, bool accounts, ConsoleBase console) 75 public UDPServer(int port, Grid gridServers, AssetCache assetCache, InventoryCache inventoryCache, RegionInfo _regionData, bool sandbox, bool accounts, ConsoleBase console , AuthenticateSessionsBase authenticateClass)
74 { 76 {
75 listenPort = port; 77 listenPort = port;
76 this.m_gridServers = gridServers; 78 this.m_gridServers = gridServers;
@@ -80,10 +82,11 @@ namespace OpenSim
80 this.m_sandbox = sandbox; 82 this.m_sandbox = sandbox;
81 this.user_accounts = accounts; 83 this.user_accounts = accounts;
82 this.m_console = console; 84 this.m_console = console;
85 this.m_authenticateSessionsClass = authenticateClass;
83 PacketServer packetServer = new PacketServer(this); 86 PacketServer packetServer = new PacketServer(this);
84 87
85 //set up delegate for authenticate sessions 88 //set up delegate for authenticate sessions
86 this.AuthenticateHandler = new AuthenticateSessionHandler(this.m_gridServers.GridServer.AuthenticateSession); 89 this.AuthenticateHandler = new AuthenticateSessionHandler(this.m_authenticateSessionsClass.AuthenticateSession);
87 } 90 }
88 91
89 protected virtual void OnReceivedData(IAsyncResult result) 92 protected virtual void OnReceivedData(IAsyncResult result)