From 1e9a0220e69a62dd45b53753537fb4563e50412c Mon Sep 17 00:00:00 2001 From: MW Date: Wed, 16 May 2007 17:35:27 +0000 Subject: Quite big change to how Sessions/circuits are Authenticated. Seems to work okay but needs a lot more testing. --- OpenSim.GridInterfaces/Remote/RemoteGridServer.cs | 49 ++++++++++++----------- 1 file changed, 25 insertions(+), 24 deletions(-) (limited to 'OpenSim.GridInterfaces') diff --git a/OpenSim.GridInterfaces/Remote/RemoteGridServer.cs b/OpenSim.GridInterfaces/Remote/RemoteGridServer.cs index 56aa002..6a4484f 100644 --- a/OpenSim.GridInterfaces/Remote/RemoteGridServer.cs +++ b/OpenSim.GridInterfaces/Remote/RemoteGridServer.cs @@ -44,8 +44,8 @@ namespace OpenSim.GridInterfaces.Remote private string GridSendKey; private string GridRecvKey; private Dictionary AgentCircuits = new Dictionary(); - private ArrayList simneighbours = new ArrayList(); - private Hashtable griddatahash; + private ArrayList simneighbours = new ArrayList(); + private Hashtable griddatahash; public override Dictionary agentcircuits { @@ -59,7 +59,7 @@ namespace OpenSim.GridInterfaces.Remote set { simneighbours = value; } } - public override Hashtable GridData + public override Hashtable GridData { get { return griddatahash; } set { griddatahash = value; } @@ -68,34 +68,35 @@ namespace OpenSim.GridInterfaces.Remote public RemoteGridServer() { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Remote Grid Server class created"); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Remote Grid Server class created"); } public override bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port) { - Hashtable GridParams = new Hashtable(); - GridParams["authkey"]=GridSendKey; - GridParams["UUID"]=SimUUID.ToString(); - GridParams["sim_ip"]=sim_ip; - GridParams["sim_port"]=sim_port.ToString(); - ArrayList SendParams = new ArrayList(); + Hashtable GridParams = new Hashtable(); + GridParams["authkey"] = GridSendKey; + GridParams["UUID"] = SimUUID.ToString(); + GridParams["sim_ip"] = sim_ip; + GridParams["sim_port"] = sim_port.ToString(); + ArrayList SendParams = new ArrayList(); SendParams.Add(GridParams); XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); XmlRpcResponse GridResp = GridReq.Send(this.GridServerUrl, 3000); - Hashtable GridRespData = (Hashtable)GridResp.Value; - this.griddatahash=GridRespData; - - if(GridRespData.ContainsKey("error")) { - string errorstring = (string)GridRespData["error"]; - OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,"Error connecting to grid:"); - OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM,errorstring); - return false; - } - this.neighbours = (ArrayList)GridRespData["neighbours"]; - Console.WriteLine(simneighbours.Count); - return true; - } + Hashtable GridRespData = (Hashtable)GridResp.Value; + this.griddatahash = GridRespData; + + if (GridRespData.ContainsKey("error")) + { + string errorstring = (string)GridRespData["error"]; + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, "Error connecting to grid:"); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.MEDIUM, errorstring); + return false; + } + this.neighbours = (ArrayList)GridRespData["neighbours"]; + Console.WriteLine(simneighbours.Count); + return true; + } public override AuthenticateResponse AuthenticateSession(LLUUID sessionID, LLUUID agentID, uint circuitcode) { @@ -120,7 +121,7 @@ namespace OpenSim.GridInterfaces.Remote user.LoginInfo.Agent = agentID; user.LoginInfo.Session = sessionID; user.LoginInfo.SecureSession = validcircuit.SecureSessionID; - user.LoginInfo.First = validcircuit.firstname; + user.LoginInfo.First = validcircuit.firstname; user.LoginInfo.Last = validcircuit.lastname; } else -- cgit v1.1