From 1c021dbcd9fcb3eb5025862c6d2ec58b33b4c895 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sun, 24 Jun 2007 17:04:12 +0000 Subject: * Forgot to commit the OGS1 code. --- .../OGS1GridServices.cs | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs (limited to 'Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs') diff --git a/Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs b/Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs new file mode 100644 index 0000000..ff3538a --- /dev/null +++ b/Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Collections; +using System.Text; + +using OpenSim.Framework; +using OpenSim.Framework.Types; +using OpenGrid.Framework.Communications; + +using Nwc.XmlRpc; + +namespace OpenGrid.Framework.Communications.OGS1 +{ + public class OGS1GridServices : IGridServices + { + public RegionCommsListener listener; + + public RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo) + { + Hashtable GridParams = new Hashtable(); + + // Login / Authentication + GridParams["authkey"] = gridInfo.GridServerSendKey; + GridParams["UUID"] = regionInfo.SimUUID.ToStringHyphenated(); + GridParams["sim_ip"] = regionInfo.CommsExternalAddress; + GridParams["sim_port"] = regionInfo.CommsIPListenPort.ToString(); + + // Package into an XMLRPC Request + ArrayList SendParams = new ArrayList(); + SendParams.Add(GridParams); + + // Send Request + XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams); + XmlRpcResponse GridResp = GridReq.Send(gridInfo.GridServerURI, 3000); + Hashtable GridRespData = (Hashtable)GridResp.Value; + Hashtable griddatahash = GridRespData; + + // Process Response + if (GridRespData.ContainsKey("error")) + { + string errorstring = (string)GridRespData["error"]; + OpenSim.Framework.Console.MainLog.Instance.Error("Unable to connect to grid: " + errorstring); + return null; + } + //this.neighbours = (ArrayList)GridRespData["neighbours"]; + + listener = new RegionCommsListener(); + + return listener; + } + + public List RequestNeighbours(RegionInfo regionInfo) + { + return null; + } + public RegionInfo RequestNeighbourInfo(ulong regionHandle) + { + return null; + } + public List RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY) + { + return null; + } + } +} -- cgit v1.1