aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs')
-rw-r--r--Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs65
1 files changed, 65 insertions, 0 deletions
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 @@
1using System;
2using System.Collections.Generic;
3using System.Collections;
4using System.Text;
5
6using OpenSim.Framework;
7using OpenSim.Framework.Types;
8using OpenGrid.Framework.Communications;
9
10using Nwc.XmlRpc;
11
12namespace OpenGrid.Framework.Communications.OGS1
13{
14 public class OGS1GridServices : IGridServices
15 {
16 public RegionCommsListener listener;
17
18 public RegionCommsListener RegisterRegion(RegionInfo regionInfo, GridInfo gridInfo)
19 {
20 Hashtable GridParams = new Hashtable();
21
22 // Login / Authentication
23 GridParams["authkey"] = gridInfo.GridServerSendKey;
24 GridParams["UUID"] = regionInfo.SimUUID.ToStringHyphenated();
25 GridParams["sim_ip"] = regionInfo.CommsExternalAddress;
26 GridParams["sim_port"] = regionInfo.CommsIPListenPort.ToString();
27
28 // Package into an XMLRPC Request
29 ArrayList SendParams = new ArrayList();
30 SendParams.Add(GridParams);
31
32 // Send Request
33 XmlRpcRequest GridReq = new XmlRpcRequest("simulator_login", SendParams);
34 XmlRpcResponse GridResp = GridReq.Send(gridInfo.GridServerURI, 3000);
35 Hashtable GridRespData = (Hashtable)GridResp.Value;
36 Hashtable griddatahash = GridRespData;
37
38 // Process Response
39 if (GridRespData.ContainsKey("error"))
40 {
41 string errorstring = (string)GridRespData["error"];
42 OpenSim.Framework.Console.MainLog.Instance.Error("Unable to connect to grid: " + errorstring);
43 return null;
44 }
45 //this.neighbours = (ArrayList)GridRespData["neighbours"];
46
47 listener = new RegionCommsListener();
48
49 return listener;
50 }
51
52 public List<RegionInfo> RequestNeighbours(RegionInfo regionInfo)
53 {
54 return null;
55 }
56 public RegionInfo RequestNeighbourInfo(ulong regionHandle)
57 {
58 return null;
59 }
60 public List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY)
61 {
62 return null;
63 }
64 }
65}