diff options
Diffstat (limited to 'OpenSim/Framework/Data/RegionProfileData.cs')
-rw-r--r-- | OpenSim/Framework/Data/RegionProfileData.cs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/OpenSim/Framework/Data/RegionProfileData.cs b/OpenSim/Framework/Data/RegionProfileData.cs index b541116..f736571 100644 --- a/OpenSim/Framework/Data/RegionProfileData.cs +++ b/OpenSim/Framework/Data/RegionProfileData.cs | |||
@@ -216,5 +216,47 @@ namespace OpenSim.Framework.Data | |||
216 | 216 | ||
217 | return simData; | 217 | return simData; |
218 | } | 218 | } |
219 | |||
220 | /// <summary> | ||
221 | /// Request sim profile information from a grid server | ||
222 | /// </summary> | ||
223 | /// <param name="region_handle"></param> | ||
224 | /// <param name="gridserver_url"></param> | ||
225 | /// <param name="gridserver_sendkey"></param> | ||
226 | /// <param name="gridserver_recvkey"></param> | ||
227 | /// <returns>The sim profile. Null if there was a request failure</returns> | ||
228 | public static RegionProfileData RequestSimProfileData(string regionName, string gridserver_url, | ||
229 | string gridserver_sendkey, string gridserver_recvkey) | ||
230 | { | ||
231 | Hashtable requestData = new Hashtable(); | ||
232 | requestData["region_name_search"] = regionName; | ||
233 | requestData["authkey"] = gridserver_sendkey; | ||
234 | ArrayList SendParams = new ArrayList(); | ||
235 | SendParams.Add(requestData); | ||
236 | XmlRpcRequest GridReq = new XmlRpcRequest("simulator_data_request", SendParams); | ||
237 | XmlRpcResponse GridResp = GridReq.Send(gridserver_url, 3000); | ||
238 | |||
239 | Hashtable responseData = (Hashtable)GridResp.Value; | ||
240 | |||
241 | if (responseData.ContainsKey("error")) | ||
242 | { | ||
243 | return null; | ||
244 | } | ||
245 | |||
246 | RegionProfileData simData = new RegionProfileData(); | ||
247 | simData.regionLocX = Convert.ToUInt32((string)responseData["region_locx"]); | ||
248 | simData.regionLocY = Convert.ToUInt32((string)responseData["region_locy"]); | ||
249 | simData.regionHandle = Helpers.UIntsToLong((simData.regionLocX * Constants.RegionSize), (simData.regionLocY * Constants.RegionSize)); | ||
250 | simData.serverIP = (string)responseData["sim_ip"]; | ||
251 | simData.serverPort = Convert.ToUInt32((string)responseData["sim_port"]); | ||
252 | simData.httpPort = Convert.ToUInt32((string)responseData["http_port"]); | ||
253 | simData.remotingPort = Convert.ToUInt32((string)responseData["remoting_port"]); | ||
254 | simData.httpServerURI = "http://" + simData.serverIP + ":" + simData.httpPort.ToString() + "/"; | ||
255 | simData.serverURI = (string)responseData["server_uri"]; | ||
256 | simData.UUID = new LLUUID((string)responseData["region_UUID"]); | ||
257 | simData.regionName = (string)responseData["region_name"]; | ||
258 | |||
259 | return simData; | ||
260 | } | ||
219 | } | 261 | } |
220 | } | 262 | } |