diff options
author | Melanie | 2010-12-09 01:55:32 +0000 |
---|---|---|
committer | Melanie | 2010-12-09 01:55:32 +0000 |
commit | 4df1d25d23d76ee3ae8c7da155462b57735f6418 (patch) | |
tree | 3d03a3cf9fb54f6992b67a6e2b23d5ea8def084d /OpenSim/Services | |
parent | Added an exception handler on CreateObject handler, just in case there's an e... (diff) | |
download | opensim-SC-4df1d25d23d76ee3ae8c7da155462b57735f6418.zip opensim-SC-4df1d25d23d76ee3ae8c7da155462b57735f6418.tar.gz opensim-SC-4df1d25d23d76ee3ae8c7da155462b57735f6418.tar.bz2 opensim-SC-4df1d25d23d76ee3ae8c7da155462b57735f6418.tar.xz |
Plumb a code path for the entity transfer module to ask a destination scene
whether or not an agent is allowed there as a root agent.
Diffstat (limited to 'OpenSim/Services')
-rw-r--r-- | OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 59 | ||||
-rw-r--r-- | OpenSim/Services/Interfaces/ISimulationService.cs | 2 |
2 files changed, 61 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 3b907c1..e2032d9 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | |||
@@ -409,6 +409,65 @@ namespace OpenSim.Services.Connectors.Simulation | |||
409 | return false; | 409 | return false; |
410 | } | 410 | } |
411 | 411 | ||
412 | public bool QueryAccess(GridRegion destination, UUID id) | ||
413 | { | ||
414 | IPEndPoint ext = destination.ExternalEndPoint; | ||
415 | if (ext == null) return false; | ||
416 | // Eventually, we want to use a caps url instead of the agentID | ||
417 | string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; | ||
418 | |||
419 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); | ||
420 | request.Method = "QUERYACCESS"; | ||
421 | request.Timeout = 10000; | ||
422 | //request.Headers.Add("authorization", ""); // coming soon | ||
423 | |||
424 | HttpWebResponse webResponse = null; | ||
425 | string reply = string.Empty; | ||
426 | StreamReader sr = null; | ||
427 | try | ||
428 | { | ||
429 | webResponse = (HttpWebResponse)request.GetResponse(); | ||
430 | if (webResponse == null) | ||
431 | { | ||
432 | m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Null reply on agent query "); | ||
433 | } | ||
434 | |||
435 | sr = new StreamReader(webResponse.GetResponseStream()); | ||
436 | reply = sr.ReadToEnd().Trim(); | ||
437 | |||
438 | |||
439 | } | ||
440 | catch (WebException ex) | ||
441 | { | ||
442 | m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent query {0}", ex.Message); | ||
443 | // ignore, really | ||
444 | return false; | ||
445 | } | ||
446 | finally | ||
447 | { | ||
448 | if (sr != null) | ||
449 | sr.Close(); | ||
450 | } | ||
451 | |||
452 | if (webResponse.StatusCode == HttpStatusCode.OK) | ||
453 | { | ||
454 | try | ||
455 | { | ||
456 | bool result; | ||
457 | |||
458 | result = bool.Parse(reply); | ||
459 | |||
460 | return result; | ||
461 | } | ||
462 | catch | ||
463 | { | ||
464 | return false; | ||
465 | } | ||
466 | } | ||
467 | |||
468 | return false; | ||
469 | } | ||
470 | |||
412 | public bool ReleaseAgent(UUID origin, UUID id, string uri) | 471 | public bool ReleaseAgent(UUID origin, UUID id, string uri) |
413 | { | 472 | { |
414 | WebRequest request = WebRequest.Create(uri); | 473 | WebRequest request = WebRequest.Create(uri); |
diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs index 67d7cbe..12e8982 100644 --- a/OpenSim/Services/Interfaces/ISimulationService.cs +++ b/OpenSim/Services/Interfaces/ISimulationService.cs | |||
@@ -60,6 +60,8 @@ namespace OpenSim.Services.Interfaces | |||
60 | 60 | ||
61 | bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent); | 61 | bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent); |
62 | 62 | ||
63 | bool QueryAccess(GridRegion destination, UUID id); | ||
64 | |||
63 | /// <summary> | 65 | /// <summary> |
64 | /// Message from receiving region to departing region, telling it got contacted by the client. | 66 | /// Message from receiving region to departing region, telling it got contacted by the client. |
65 | /// When sent over REST, it invokes the opaque uri. | 67 | /// When sent over REST, it invokes the opaque uri. |