* 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)
Sugilite
Adam Frisby 2007-06-24 18:04:34 +00:00
parent 210e7c931f
commit e21d27c56d
3 changed files with 49 additions and 2 deletions

View File

@ -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();
}
}
}

View File

@ -53,6 +53,10 @@
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
<Name>OpenSim.Framework</Name>
</ProjectReference>
<ProjectReference Include="..\OpenSim.Servers\OpenSim.Servers.csproj">
<Project>{8BB20F0A-0000-0000-0000-000000000000}</Project>
<Name>OpenSim.Servers</Name>
</ProjectReference>
<ProjectReference Include="..\XmlRpcCS\XMLRPC.csproj">
<Project>{8E81D43C-0000-0000-0000-000000000000}</Project>
<Name>XMLRPC</Name>

View File

@ -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);