aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.RegionServer/OpenSimMain.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim.RegionServer/OpenSimMain.cs')
-rw-r--r--OpenSim.RegionServer/OpenSimMain.cs52
1 files changed, 17 insertions, 35 deletions
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)