aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs45
1 files changed, 40 insertions, 5 deletions
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index 07839d3..a5f748f 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -104,7 +104,24 @@ namespace OpenSim.Services.Connectors.Simulation
104 return false; 104 return false;
105 } 105 }
106 106
107 string uri = destination.ServerURI + AgentPath() + aCircuit.AgentID + "/"; 107 string uri = string.Empty;
108
109 // HACK -- Simian grid make it work!!!
110 if (destination.ServerURI != null && destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:"))
111 uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
112 else
113 {
114 try
115 {
116 uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/";
117 }
118 catch (Exception e)
119 {
120 m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message);
121 reason = e.Message;
122 return false;
123 }
124 }
108 125
109 //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri); 126 //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri);
110 127
@@ -260,7 +277,16 @@ namespace OpenSim.Services.Connectors.Simulation
260 private bool UpdateAgent(GridRegion destination, IAgentData cAgentData) 277 private bool UpdateAgent(GridRegion destination, IAgentData cAgentData)
261 { 278 {
262 // Eventually, we want to use a caps url instead of the agentID 279 // Eventually, we want to use a caps url instead of the agentID
263 string uri = destination.ServerURI + AgentPath() + cAgentData.AgentID + "/"; 280 string uri = string.Empty;
281 try
282 {
283 uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + cAgentData.AgentID + "/";
284 }
285 catch (Exception e)
286 {
287 m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent update. Reason: " + e.Message);
288 return false;
289 }
264 //Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri); 290 //Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri);
265 291
266 HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri); 292 HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri);
@@ -359,7 +385,7 @@ namespace OpenSim.Services.Connectors.Simulation
359 { 385 {
360 agent = null; 386 agent = null;
361 // Eventually, we want to use a caps url instead of the agentID 387 // Eventually, we want to use a caps url instead of the agentID
362 string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; 388 string uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
363 //Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri); 389 //Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri);
364 390
365 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); 391 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
@@ -453,7 +479,16 @@ namespace OpenSim.Services.Connectors.Simulation
453 479
454 public bool CloseAgent(GridRegion destination, UUID id) 480 public bool CloseAgent(GridRegion destination, UUID id)
455 { 481 {
456 string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; 482 string uri = string.Empty;
483 try
484 {
485 uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
486 }
487 catch (Exception e)
488 {
489 m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent close. Reason: " + e.Message);
490 return false;
491 }
457 492
458 //Console.WriteLine(" >>> DoCloseAgentCall <<< " + uri); 493 //Console.WriteLine(" >>> DoCloseAgentCall <<< " + uri);
459 494
@@ -503,7 +538,7 @@ namespace OpenSim.Services.Connectors.Simulation
503 public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) 538 public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall)
504 { 539 {
505 string uri 540 string uri
506 = destination.ServerURI + ObjectPath() + sog.UUID + "/"; 541 = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + ObjectPath() + sog.UUID + "/";
507 //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri); 542 //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri);
508 543
509 WebRequest ObjectCreateRequest = WebRequest.Create(uri); 544 WebRequest ObjectCreateRequest = WebRequest.Create(uri);