diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/RegionProfileServiceProxy.cs | 188 |
1 files changed, 94 insertions, 94 deletions
diff --git a/OpenSim/Data/RegionProfileServiceProxy.cs b/OpenSim/Data/RegionProfileServiceProxy.cs index 998b4ef..be4d9c5 100644 --- a/OpenSim/Data/RegionProfileServiceProxy.cs +++ b/OpenSim/Data/RegionProfileServiceProxy.cs | |||
@@ -1,94 +1,94 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections; | 2 | using System.Collections; |
3 | using System.Collections.Generic; | 3 | using System.Collections.Generic; |
4 | using System.Text; | 4 | using System.Text; |
5 | using Nwc.XmlRpc; | 5 | using Nwc.XmlRpc; |
6 | using OpenMetaverse; | 6 | using OpenMetaverse; |
7 | using OpenSim.Framework; | 7 | using OpenSim.Framework; |
8 | 8 | ||
9 | namespace OpenSim.Data | 9 | namespace OpenSim.Data |
10 | { | 10 | { |
11 | public class RegionProfileServiceProxy : IRegionProfileService | 11 | public class RegionProfileServiceProxy : IRegionProfileService |
12 | { | 12 | { |
13 | /// <summary> | 13 | /// <summary> |
14 | /// Request sim data based on arbitrary key/value | 14 | /// Request sim data based on arbitrary key/value |
15 | /// </summary> | 15 | /// </summary> |
16 | private RegionProfileData RequestSimData(Uri gridserverUrl, string gridserverSendkey, string keyField, string keyValue) | 16 | private RegionProfileData RequestSimData(Uri gridserverUrl, string gridserverSendkey, string keyField, string keyValue) |
17 | { | 17 | { |
18 | Hashtable requestData = new Hashtable(); | 18 | Hashtable requestData = new Hashtable(); |
19 | requestData[keyField] = keyValue; | 19 | requestData[keyField] = keyValue; |
20 | requestData["authkey"] = gridserverSendkey; | 20 | requestData["authkey"] = gridserverSendkey; |
21 | ArrayList SendParams = new ArrayList(); | 21 | ArrayList SendParams = new ArrayList(); |
22 | SendParams.Add(requestData); | 22 | SendParams.Add(requestData); |
23 | XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); | 23 | XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); |
24 | XmlRpcResponse GridResp = GridReq.Send(gridserverUrl.ToString(), 3000); | 24 | XmlRpcResponse GridResp = GridReq.Send(gridserverUrl.ToString(), 3000); |
25 | 25 | ||
26 | Hashtable responseData = (Hashtable) GridResp.Value; | 26 | Hashtable responseData = (Hashtable) GridResp.Value; |
27 | 27 | ||
28 | RegionProfileData simData = null; | 28 | RegionProfileData simData = null; |
29 | 29 | ||
30 | if (!responseData.ContainsKey("error")) | 30 | if (!responseData.ContainsKey("error")) |
31 | { | 31 | { |
32 | simData = new RegionProfileData(); | 32 | simData = new RegionProfileData(); |
33 | simData.regionLocX = Convert.ToUInt32((string) responseData["region_locx"]); | 33 | simData.regionLocX = Convert.ToUInt32((string) responseData["region_locx"]); |
34 | simData.regionLocY = Convert.ToUInt32((string) responseData["region_locy"]); | 34 | simData.regionLocY = Convert.ToUInt32((string) responseData["region_locy"]); |
35 | simData.regionHandle = | 35 | simData.regionHandle = |
36 | Utils.UIntsToLong((simData.regionLocX * Constants.RegionSize), | 36 | Utils.UIntsToLong((simData.regionLocX * Constants.RegionSize), |
37 | (simData.regionLocY*Constants.RegionSize)); | 37 | (simData.regionLocY*Constants.RegionSize)); |
38 | simData.serverIP = (string) responseData["sim_ip"]; | 38 | simData.serverIP = (string) responseData["sim_ip"]; |
39 | simData.serverPort = Convert.ToUInt32((string) responseData["sim_port"]); | 39 | simData.serverPort = Convert.ToUInt32((string) responseData["sim_port"]); |
40 | simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]); | 40 | simData.httpPort = Convert.ToUInt32((string) responseData["http_port"]); |
41 | simData.remotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); | 41 | simData.remotingPort = Convert.ToUInt32((string) responseData["remoting_port"]); |
42 | simData.serverURI = (string) responseData["server_uri"]; | 42 | simData.serverURI = (string) responseData["server_uri"]; |
43 | simData.httpServerURI = "http://" + (string)responseData["sim_ip"] + ":" + simData.httpPort.ToString() + "/"; | 43 | simData.httpServerURI = "http://" + (string)responseData["sim_ip"] + ":" + simData.httpPort.ToString() + "/"; |
44 | simData.UUID = new UUID((string) responseData["region_UUID"]); | 44 | simData.UUID = new UUID((string) responseData["region_UUID"]); |
45 | simData.regionName = (string) responseData["region_name"]; | 45 | simData.regionName = (string) responseData["region_name"]; |
46 | } | 46 | } |
47 | 47 | ||
48 | return simData; | 48 | return simData; |
49 | } | 49 | } |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Request sim profile information from a grid server, by Region UUID | 52 | /// Request sim profile information from a grid server, by Region UUID |
53 | /// </summary> | 53 | /// </summary> |
54 | /// <param name="regionId">The region UUID to look for</param> | 54 | /// <param name="regionId">The region UUID to look for</param> |
55 | /// <param name="gridserverUrl"></param> | 55 | /// <param name="gridserverUrl"></param> |
56 | /// <param name="gridserverSendkey"></param> | 56 | /// <param name="gridserverSendkey"></param> |
57 | /// <param name="gridserverRecvkey"></param> | 57 | /// <param name="gridserverRecvkey"></param> |
58 | /// <returns>The sim profile. Null if there was a request failure</returns> | 58 | /// <returns>The sim profile. Null if there was a request failure</returns> |
59 | /// <remarks>This method should be statics</remarks> | 59 | /// <remarks>This method should be statics</remarks> |
60 | public RegionProfileData RequestSimProfileData(UUID regionId, Uri gridserverUrl, | 60 | public RegionProfileData RequestSimProfileData(UUID regionId, Uri gridserverUrl, |
61 | string gridserverSendkey, string gridserverRecvkey) | 61 | string gridserverSendkey, string gridserverRecvkey) |
62 | { | 62 | { |
63 | return RequestSimData(gridserverUrl, gridserverSendkey, "region_UUID", regionId.Guid.ToString()); | 63 | return RequestSimData(gridserverUrl, gridserverSendkey, "region_UUID", regionId.Guid.ToString()); |
64 | } | 64 | } |
65 | 65 | ||
66 | /// <summary> | 66 | /// <summary> |
67 | /// Request sim profile information from a grid server, by Region Handle | 67 | /// Request sim profile information from a grid server, by Region Handle |
68 | /// </summary> | 68 | /// </summary> |
69 | /// <param name="regionHandle">the region handle to look for</param> | 69 | /// <param name="regionHandle">the region handle to look for</param> |
70 | /// <param name="gridserverUrl"></param> | 70 | /// <param name="gridserverUrl"></param> |
71 | /// <param name="gridserverSendkey"></param> | 71 | /// <param name="gridserverSendkey"></param> |
72 | /// <param name="gridserverRecvkey"></param> | 72 | /// <param name="gridserverRecvkey"></param> |
73 | /// <returns>The sim profile. Null if there was a request failure</returns> | 73 | /// <returns>The sim profile. Null if there was a request failure</returns> |
74 | public RegionProfileData RequestSimProfileData(ulong regionHandle, Uri gridserverUrl, | 74 | public RegionProfileData RequestSimProfileData(ulong regionHandle, Uri gridserverUrl, |
75 | string gridserverSendkey, string gridserverRecvkey) | 75 | string gridserverSendkey, string gridserverRecvkey) |
76 | { | 76 | { |
77 | return RequestSimData(gridserverUrl, gridserverSendkey, "region_handle", regionHandle.ToString()); | 77 | return RequestSimData(gridserverUrl, gridserverSendkey, "region_handle", regionHandle.ToString()); |
78 | } | 78 | } |
79 | 79 | ||
80 | /// <summary> | 80 | /// <summary> |
81 | /// Request sim profile information from a grid server, by Region Name | 81 | /// Request sim profile information from a grid server, by Region Name |
82 | /// </summary> | 82 | /// </summary> |
83 | /// <param name="regionName">the region name to look for</param> | 83 | /// <param name="regionName">the region name to look for</param> |
84 | /// <param name="gridserverUrl"></param> | 84 | /// <param name="gridserverUrl"></param> |
85 | /// <param name="gridserverSendkey"></param> | 85 | /// <param name="gridserverSendkey"></param> |
86 | /// <param name="gridserverRecvkey"></param> | 86 | /// <param name="gridserverRecvkey"></param> |
87 | /// <returns>The sim profile. Null if there was a request failure</returns> | 87 | /// <returns>The sim profile. Null if there was a request failure</returns> |
88 | public RegionProfileData RequestSimProfileData(string regionName, Uri gridserverUrl, | 88 | public RegionProfileData RequestSimProfileData(string regionName, Uri gridserverUrl, |
89 | string gridserverSendkey, string gridserverRecvkey) | 89 | string gridserverSendkey, string gridserverRecvkey) |
90 | { | 90 | { |
91 | return RequestSimData(gridserverUrl, gridserverSendkey, "region_name_search", regionName ); | 91 | return RequestSimData(gridserverUrl, gridserverSendkey, "region_name_search", regionName ); |
92 | } | 92 | } |
93 | } | 93 | } |
94 | } | 94 | } |