diff options
Diffstat (limited to 'OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs')
-rw-r--r-- | OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index 95c4f87..508baf7 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs | |||
@@ -86,6 +86,7 @@ namespace OpenSim.Services.Connectors.Simulation | |||
86 | reason = String.Empty; | 86 | reason = String.Empty; |
87 | if (destination == null) | 87 | if (destination == null) |
88 | { | 88 | { |
89 | reason = "Destination not found"; | ||
89 | m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Given destination is null"); | 90 | m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Given destination is null"); |
90 | return false; | 91 | return false; |
91 | } | 92 | } |
@@ -359,6 +360,10 @@ namespace OpenSim.Services.Connectors.Simulation | |||
359 | return false; | 360 | return false; |
360 | } | 361 | } |
361 | 362 | ||
363 | OSDMap resp = (OSDMap)result["_Result"]; | ||
364 | success = resp["success"].AsBoolean(); | ||
365 | reason = resp["reason"].AsString(); | ||
366 | |||
362 | return success; | 367 | return success; |
363 | } | 368 | } |
364 | catch (Exception e) | 369 | catch (Exception e) |
@@ -387,26 +392,35 @@ namespace OpenSim.Services.Connectors.Simulation | |||
387 | return true; | 392 | return true; |
388 | } | 393 | } |
389 | 394 | ||
390 | /// <summary> | 395 | private bool CloseAgent(GridRegion destination, UUID id, bool ChildOnly) |
391 | /// </summary> | ||
392 | public bool CloseAgent(GridRegion destination, UUID id) | ||
393 | { | 396 | { |
394 | // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CloseAgent start"); | 397 | // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: CloseAgent start"); |
398 | Util.FireAndForget(x => { | ||
399 | string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; | ||
395 | 400 | ||
396 | string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; | 401 | try |
397 | 402 | { | |
398 | try | 403 | WebUtil.ServiceOSDRequest(uri, null, "DELETE", 10000, false); |
399 | { | 404 | } |
400 | WebUtil.ServiceOSDRequest(uri, null, "DELETE", 10000, false); | 405 | catch (Exception e) |
401 | } | 406 | { |
402 | catch (Exception e) | 407 | m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] CloseAgent failed with exception; {0}",e.ToString()); |
403 | { | 408 | } |
404 | m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] CloseAgent failed with exception; {0}",e.ToString()); | 409 | }); |
405 | } | ||
406 | 410 | ||
407 | return true; | 411 | return true; |
408 | } | 412 | } |
409 | 413 | ||
414 | public bool CloseChildAgent(GridRegion destination, UUID id) | ||
415 | { | ||
416 | return CloseAgent(destination, id, true); | ||
417 | } | ||
418 | |||
419 | public bool CloseAgent(GridRegion destination, UUID id) | ||
420 | { | ||
421 | return CloseAgent(destination, id, false); | ||
422 | } | ||
423 | |||
410 | #endregion Agents | 424 | #endregion Agents |
411 | 425 | ||
412 | #region Objects | 426 | #region Objects |
@@ -444,11 +458,14 @@ namespace OpenSim.Services.Connectors.Simulation | |||
444 | args["destination_name"] = OSD.FromString(destination.RegionName); | 458 | args["destination_name"] = OSD.FromString(destination.RegionName); |
445 | args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); | 459 | args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); |
446 | 460 | ||
447 | WebUtil.PostToService(uri, args, 40000); | 461 | OSDMap response = WebUtil.PostToService(uri, args, 40000); |
462 | if (response["Success"] == "False") | ||
463 | return false; | ||
448 | } | 464 | } |
449 | catch (Exception e) | 465 | catch (Exception e) |
450 | { | 466 | { |
451 | m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] CreateObject failed with exception; {0}",e.ToString()); | 467 | m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR] CreateObject failed with exception; {0}",e.ToString()); |
468 | return false; | ||
452 | } | 469 | } |
453 | 470 | ||
454 | return true; | 471 | return true; |