diff options
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 a6301f3..2293dbf 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; | |||
3 | using System.Collections; | 3 | using System.Collections; |
4 | using System.Text; | 4 | using System.Text; |
5 | 5 | ||
6 | using OpenSim.Servers; | ||
7 | |||
6 | using OpenSim.Framework; | 8 | using OpenSim.Framework; |
7 | using OpenSim.Framework.Types; | 9 | using OpenSim.Framework.Types; |
8 | using OpenGrid.Framework.Communications; | 10 | using OpenGrid.Framework.Communications; |
9 | 11 | ||
10 | using Nwc.XmlRpc; | 12 | using Nwc.XmlRpc; |
13 | using libsecondlife; | ||
11 | 14 | ||
12 | namespace OpenGrid.Framework.Communications.OGS1 | 15 | namespace OpenGrid.Framework.Communications.OGS1 |
13 | { | 16 | { |
@@ -15,6 +18,8 @@ namespace OpenGrid.Framework.Communications.OGS1 | |||
15 | { | 18 | { |
16 | public RegionCommsListener listener; | 19 | public RegionCommsListener listener; |
17 | public GridInfo grid; | 20 | public GridInfo grid; |
21 | public BaseHttpServer httpListener; | ||
22 | private bool initialised = false; | ||
18 | 23 | ||
19 | public RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo) | 24 | public RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo) |
20 | { | 25 | { |
@@ -45,10 +50,18 @@ namespace OpenGrid.Framework.Communications.OGS1 | |||
45 | OpenSim.Framework.Console.MainLog.Instance.Error("Unable to connect to grid: " + errorstring); | 50 | OpenSim.Framework.Console.MainLog.Instance.Error("Unable to connect to grid: " + errorstring); |
46 | return null; | 51 | return null; |
47 | } | 52 | } |
48 | //this.neighbours = (ArrayList)GridRespData["neighbours"]; | 53 | |
49 | 54 | // Initialise the background listeners | |
50 | listener = new RegionCommsListener(); | 55 | listener = new RegionCommsListener(); |
51 | 56 | ||
57 | if (!initialised) | ||
58 | { | ||
59 | initialised = true; | ||
60 | httpListener = new BaseHttpServer(regionInfo.CommsIPListenPort); | ||
61 | httpListener.AddXmlRPCHandler("expect_user", this.ExpectUser); | ||
62 | httpListener.Start(); | ||
63 | } | ||
64 | |||
52 | return listener; | 65 | return listener; |
53 | } | 66 | } |
54 | 67 | ||
@@ -126,5 +139,34 @@ namespace OpenGrid.Framework.Communications.OGS1 | |||
126 | 139 | ||
127 | return neighbours; | 140 | return neighbours; |
128 | } | 141 | } |
142 | |||
143 | // Grid Request Processing | ||
144 | public XmlRpcResponse ExpectUser(XmlRpcRequest request) | ||
145 | { | ||
146 | Hashtable requestData = (Hashtable)request.Params[0]; | ||
147 | AgentCircuitData agentData = new AgentCircuitData(); | ||
148 | agentData.SessionID = new LLUUID((string)requestData["session_id"]); | ||
149 | agentData.SecureSessionID = new LLUUID((string)requestData["secure_session_id"]); | ||
150 | agentData.firstname = (string)requestData["firstname"]; | ||
151 | agentData.lastname = (string)requestData["lastname"]; | ||
152 | agentData.AgentID = new LLUUID((string)requestData["agent_id"]); | ||
153 | agentData.circuitcode = Convert.ToUInt32(requestData["circuit_code"]); | ||
154 | if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1")) | ||
155 | { | ||
156 | agentData.child = true; | ||
157 | } | ||
158 | else | ||
159 | { | ||
160 | agentData.startpos = new LLVector3(Convert.ToUInt32(requestData["startpos_x"]), Convert.ToUInt32(requestData["startpos_y"]), Convert.ToUInt32(requestData["startpos_z"])); | ||
161 | agentData.child = false; | ||
162 | |||
163 | } | ||
164 | |||
165 | this.listener.TriggerExpectUser((ulong)requestData["regionhandle"], agentData); | ||
166 | |||
167 | return new XmlRpcResponse(); | ||
168 | } | ||
169 | |||
170 | |||
129 | } | 171 | } |
130 | } | 172 | } |
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 ba4f43e..01bbd9e 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 @@ | |||
53 | <Project>{8ACA2445-0000-0000-0000-000000000000}</Project> | 53 | <Project>{8ACA2445-0000-0000-0000-000000000000}</Project> |
54 | <Name>OpenSim.Framework</Name> | 54 | <Name>OpenSim.Framework</Name> |
55 | </ProjectReference> | 55 | </ProjectReference> |
56 | <ProjectReference Include="..\OpenSim.Servers\OpenSim.Servers.csproj"> | ||
57 | <Project>{8BB20F0A-0000-0000-0000-000000000000}</Project> | ||
58 | <Name>OpenSim.Servers</Name> | ||
59 | </ProjectReference> | ||
56 | <ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj"> | 60 | <ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj"> |
57 | <Project>{8E81D43C-0000-0000-0000-000000000000}</Project> | 61 | <Project>{8E81D43C-0000-0000-0000-000000000000}</Project> |
58 | <Name>XMLRPC</Name> | 62 | <Name>XMLRPC</Name> |
diff --git a/OpenGridServices/OpenGridServices.UserServer/UserManager.cs b/OpenGridServices/OpenGridServices.UserServer/UserManager.cs index 14e330b..0704de1 100644 --- a/OpenGridServices/OpenGridServices.UserServer/UserManager.cs +++ b/OpenGridServices/OpenGridServices.UserServer/UserManager.cs | |||
@@ -87,6 +87,7 @@ namespace OpenGridServices.UserServer | |||
87 | SimParams["startpos_x"] = theUser.currentAgent.currentPos.X.ToString(); | 87 | SimParams["startpos_x"] = theUser.currentAgent.currentPos.X.ToString(); |
88 | SimParams["startpos_y"] = theUser.currentAgent.currentPos.Y.ToString(); | 88 | SimParams["startpos_y"] = theUser.currentAgent.currentPos.Y.ToString(); |
89 | SimParams["startpos_z"] = theUser.currentAgent.currentPos.Z.ToString(); | 89 | SimParams["startpos_z"] = theUser.currentAgent.currentPos.Z.ToString(); |
90 | SimParams["regionhandle"] = theUser.currentAgent.currentHandle.ToString(); | ||
90 | ArrayList SendParams = new ArrayList(); | 91 | ArrayList SendParams = new ArrayList(); |
91 | SendParams.Add(SimParams); | 92 | SendParams.Add(SimParams); |
92 | 93 | ||