diff options
author | Adam Frisby | 2007-06-24 17:04:12 +0000 |
---|---|---|
committer | Adam Frisby | 2007-06-24 17:04:12 +0000 |
commit | 1c021dbcd9fcb3eb5025862c6d2ec58b33b4c895 (patch) | |
tree | 1bffcb66264e45d4c1922fee175c850760d7f1a2 /Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs | |
parent | Refactoring: (diff) | |
download | opensim-SC_OLD-1c021dbcd9fcb3eb5025862c6d2ec58b33b4c895.zip opensim-SC_OLD-1c021dbcd9fcb3eb5025862c6d2ec58b33b4c895.tar.gz opensim-SC_OLD-1c021dbcd9fcb3eb5025862c6d2ec58b33b4c895.tar.bz2 opensim-SC_OLD-1c021dbcd9fcb3eb5025862c6d2ec58b33b4c895.tar.xz |
* Forgot to commit the OGS1 code.
Diffstat (limited to 'Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs')
-rw-r--r-- | Common/OpenGrid.Framework.Communications.OGS1/OGS1GridServices.cs | 65 |
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 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Collections; | ||
4 | using System.Text; | ||
5 | |||
6 | using OpenSim.Framework; | ||
7 | using OpenSim.Framework.Types; | ||
8 | using OpenGrid.Framework.Communications; | ||
9 | |||
10 | using Nwc.XmlRpc; | ||
11 | |||
12 | namespace 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 | } | ||