diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index 5ad1af2..608228d 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs | |||
@@ -241,95 +241,5 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
241 | return null; | 241 | return null; |
242 | } | 242 | } |
243 | 243 | ||
244 | public GridRegion GetHomeRegion(GridRegion gatekeeper, UUID userID, out Vector3 position, out Vector3 lookAt) | ||
245 | { | ||
246 | position = Vector3.UnitY; lookAt = Vector3.UnitY; | ||
247 | |||
248 | Hashtable hash = new Hashtable(); | ||
249 | hash["userID"] = userID.ToString(); | ||
250 | |||
251 | IList paramList = new ArrayList(); | ||
252 | paramList.Add(hash); | ||
253 | |||
254 | XmlRpcRequest request = new XmlRpcRequest("get_home_region", paramList); | ||
255 | string uri = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort + "/"; | ||
256 | XmlRpcResponse response = null; | ||
257 | try | ||
258 | { | ||
259 | response = request.Send(uri, 10000); | ||
260 | } | ||
261 | catch (Exception e) | ||
262 | { | ||
263 | return null; | ||
264 | } | ||
265 | |||
266 | if (response.IsFault) | ||
267 | { | ||
268 | return null; | ||
269 | } | ||
270 | |||
271 | hash = (Hashtable)response.Value; | ||
272 | //foreach (Object o in hash) | ||
273 | // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); | ||
274 | try | ||
275 | { | ||
276 | bool success = false; | ||
277 | Boolean.TryParse((string)hash["result"], out success); | ||
278 | if (success) | ||
279 | { | ||
280 | GridRegion region = new GridRegion(); | ||
281 | |||
282 | UUID.TryParse((string)hash["uuid"], out region.RegionID); | ||
283 | //m_log.Debug(">> HERE, uuid: " + region.RegionID); | ||
284 | int n = 0; | ||
285 | if (hash["x"] != null) | ||
286 | { | ||
287 | Int32.TryParse((string)hash["x"], out n); | ||
288 | region.RegionLocX = n; | ||
289 | //m_log.Debug(">> HERE, x: " + region.RegionLocX); | ||
290 | } | ||
291 | if (hash["y"] != null) | ||
292 | { | ||
293 | Int32.TryParse((string)hash["y"], out n); | ||
294 | region.RegionLocY = n; | ||
295 | //m_log.Debug(">> HERE, y: " + region.RegionLocY); | ||
296 | } | ||
297 | if (hash["region_name"] != null) | ||
298 | { | ||
299 | region.RegionName = (string)hash["region_name"]; | ||
300 | //m_log.Debug(">> HERE, name: " + region.RegionName); | ||
301 | } | ||
302 | if (hash["hostname"] != null) | ||
303 | region.ExternalHostName = (string)hash["hostname"]; | ||
304 | if (hash["http_port"] != null) | ||
305 | { | ||
306 | uint p = 0; | ||
307 | UInt32.TryParse((string)hash["http_port"], out p); | ||
308 | region.HttpPort = p; | ||
309 | } | ||
310 | if (hash["internal_port"] != null) | ||
311 | { | ||
312 | int p = 0; | ||
313 | Int32.TryParse((string)hash["internal_port"], out p); | ||
314 | region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p); | ||
315 | } | ||
316 | if (hash["position"] != null) | ||
317 | Vector3.TryParse((string)hash["position"], out position); | ||
318 | if (hash["lookAt"] != null) | ||
319 | Vector3.TryParse((string)hash["lookAt"], out lookAt); | ||
320 | |||
321 | // Successful return | ||
322 | return region; | ||
323 | } | ||
324 | |||
325 | } | ||
326 | catch (Exception e) | ||
327 | { | ||
328 | return null; | ||
329 | } | ||
330 | |||
331 | return null; | ||
332 | |||
333 | } | ||
334 | } | 244 | } |
335 | } | 245 | } |