diff options
Diffstat (limited to 'OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs')
-rw-r--r-- | OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index ff0dd7e..748faef 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | |||
@@ -348,9 +348,11 @@ namespace OpenSim.Services.Connectors.Simulation | |||
348 | 348 | ||
349 | public bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent) | 349 | public bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent) |
350 | { | 350 | { |
351 | IPEndPoint ext = destination.ExternalEndPoint; | ||
351 | agent = null; | 352 | agent = null; |
353 | if (ext == null) return false; | ||
352 | // Eventually, we want to use a caps url instead of the agentID | 354 | // Eventually, we want to use a caps url instead of the agentID |
353 | string uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; | 355 | string uri = "http://" + ext.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; |
354 | //Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri); | 356 | //Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri); |
355 | 357 | ||
356 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); | 358 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); |
@@ -442,7 +444,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
442 | return true; | 444 | return true; |
443 | } | 445 | } |
444 | 446 | ||
445 | public bool CloseAgent(GridRegion destination, UUID id) | 447 | private bool CloseAgent(GridRegion destination, UUID id, bool ChildOnly) |
446 | { | 448 | { |
447 | string uri = string.Empty; | 449 | string uri = string.Empty; |
448 | try | 450 | try |
@@ -459,6 +461,8 @@ namespace OpenSim.Services.Connectors.Simulation | |||
459 | 461 | ||
460 | WebRequest request = WebRequest.Create(uri); | 462 | WebRequest request = WebRequest.Create(uri); |
461 | request.Method = "DELETE"; | 463 | request.Method = "DELETE"; |
464 | if (ChildOnly) | ||
465 | request.Method += "CHILD"; | ||
462 | request.Timeout = 10000; | 466 | request.Timeout = 10000; |
463 | 467 | ||
464 | StreamReader sr = null; | 468 | StreamReader sr = null; |
@@ -491,6 +495,16 @@ namespace OpenSim.Services.Connectors.Simulation | |||
491 | return true; | 495 | return true; |
492 | } | 496 | } |
493 | 497 | ||
498 | public bool CloseChildAgent(GridRegion destination, UUID id) | ||
499 | { | ||
500 | return CloseAgent(destination, id, true); | ||
501 | } | ||
502 | |||
503 | public bool CloseAgent(GridRegion destination, UUID id) | ||
504 | { | ||
505 | return CloseAgent(destination, id, false); | ||
506 | } | ||
507 | |||
494 | #endregion Agents | 508 | #endregion Agents |
495 | 509 | ||
496 | #region Objects | 510 | #region Objects |
@@ -502,8 +516,10 @@ namespace OpenSim.Services.Connectors.Simulation | |||
502 | 516 | ||
503 | public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) | 517 | public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) |
504 | { | 518 | { |
519 | IPEndPoint ext = destination.ExternalEndPoint; | ||
520 | if (ext == null) return false; | ||
505 | string uri | 521 | string uri |
506 | = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + ObjectPath() + sog.UUID + "/"; | 522 | = "http://" + ext.Address + ":" + destination.HttpPort + ObjectPath() + sog.UUID + "/"; |
507 | //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri); | 523 | //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri); |
508 | 524 | ||
509 | WebRequest ObjectCreateRequest = WebRequest.Create(uri); | 525 | WebRequest ObjectCreateRequest = WebRequest.Create(uri); |