From e21d27c56df2bedcf8cddfcabf958187a5df70b6 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 24 Jun 2007 18:04:34 +0000 Subject: [PATCH] * Updating sugilite userserver with the same patch * Added expect_user support to sugilite GridComms manager (needs testing to make sure there's no conflict between httpListener daemons) --- .../OGS1GridServices.cs | 46 ++++++++++++++++++- ...nGrid.Framework.Communications.OGS1.csproj | 4 ++ .../UserManager.cs | 1 + 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs b/Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs index a6301f38f8..2293dbf838 100644 --- a/Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs +++ b/Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs @@ -3,11 +3,14 @@ using System.Collections.Generic; using System.Collections; using System.Text; +using OpenSim.Servers; + using OpenSim.Framework; using OpenSim.Framework.Types; using OpenGrid.Framework.Communications; using Nwc.XmlRpc; +using libsecondlife; namespace OpenGrid.Framework.Communications.OGS1 { @@ -15,6 +18,8 @@ namespace OpenGrid.Framework.Communications.OGS1 { public RegionCommsListener listener; public GridInfo grid; + public BaseHttpServer httpListener; + private bool initialised = false; public RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo) { @@ -45,10 +50,18 @@ namespace OpenGrid.Framework.Communications.OGS1 OpenSim.Framework.Console.MainLog.Instance.Error("Unable to connect to grid: " + errorstring); return null; } - //this.neighbours = (ArrayList)GridRespData["neighbours"]; - + + // Initialise the background listeners listener = new RegionCommsListener(); + if (!initialised) + { + initialised = true; + httpListener = new BaseHttpServer(regionInfo.CommsIPListenPort); + httpListener.AddXmlRPCHandler("expect_user", this.ExpectUser); + httpListener.Start(); + } + return listener; } @@ -126,5 +139,34 @@ namespace OpenGrid.Framework.Communications.OGS1 return neighbours; } + + // Grid Request Processing + 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.listener.TriggerExpectUser((ulong)requestData["regionhandle"], agentData); + + return new XmlRpcResponse(); + } + + } } diff --git a/Common/OpenGrid.Framework.Communications.OGS1/OpenGrid.Framework.Communications.OGS1.csproj b/Common/OpenGrid.Framework.Communications.OGS1/OpenGrid.Framework.Communications.OGS1.csproj index ba4f43ea8e..01bbd9e441 100644 --- a/Common/OpenGrid.Framework.Communications.OGS1/OpenGrid.Framework.Communications.OGS1.csproj +++ b/Common/OpenGrid.Framework.Communications.OGS1/OpenGrid.Framework.Communications.OGS1.csproj @@ -53,6 +53,10 @@ {8ACA2445-0000-0000-0000-000000000000} OpenSim.Framework + + {8BB20F0A-0000-0000-0000-000000000000} + OpenSim.Servers + {8E81D43C-0000-0000-0000-000000000000} XMLRPC diff --git a/OpenGridServices/OpenGridServices.UserServer/UserManager.cs b/OpenGridServices/OpenGridServices.UserServer/UserManager.cs index 14e330b35b..0704de1d53 100644 --- a/OpenGridServices/OpenGridServices.UserServer/UserManager.cs +++ b/OpenGridServices/OpenGridServices.UserServer/UserManager.cs @@ -87,6 +87,7 @@ namespace OpenGridServices.UserServer SimParams["startpos_x"] = theUser.currentAgent.currentPos.X.ToString(); SimParams["startpos_y"] = theUser.currentAgent.currentPos.Y.ToString(); SimParams["startpos_z"] = theUser.currentAgent.currentPos.Z.ToString(); + SimParams["regionhandle"] = theUser.currentAgent.currentHandle.ToString(); ArrayList SendParams = new ArrayList(); SendParams.Add(SimParams);