aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs')
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs57
1 files changed, 7 insertions, 50 deletions
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index 502fc82..7936cb8 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Services.Connectors.Simulation
72 72
73 protected virtual string AgentPath() 73 protected virtual string AgentPath()
74 { 74 {
75 return "/agent/"; 75 return "agent/";
76 } 76 }
77 77
78 public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason) 78 public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason)
@@ -104,26 +104,7 @@ namespace OpenSim.Services.Connectors.Simulation
104 return false; 104 return false;
105 } 105 }
106 106
107 string uri = string.Empty; 107 string uri = destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
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.Error("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message);
121 reason = e.Message;
122 return false;
123 }
124 }
125
126 //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri);
127 108
128 AgentCreateRequest = (HttpWebRequest)WebRequest.Create(uri); 109 AgentCreateRequest = (HttpWebRequest)WebRequest.Create(uri);
129 AgentCreateRequest.Method = "POST"; 110 AgentCreateRequest.Method = "POST";
@@ -277,17 +258,8 @@ namespace OpenSim.Services.Connectors.Simulation
277 private bool UpdateAgent(GridRegion destination, IAgentData cAgentData) 258 private bool UpdateAgent(GridRegion destination, IAgentData cAgentData)
278 { 259 {
279 // Eventually, we want to use a caps url instead of the agentID 260 // Eventually, we want to use a caps url instead of the agentID
280 string uri = string.Empty; 261
281 try 262 string uri = destination.ServerURI + AgentPath() + cAgentData.AgentID + "/";
282 {
283 uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + cAgentData.AgentID + "/";
284 }
285 catch (Exception e)
286 {
287 m_log.Warn("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent update. Reason: " + e.Message);
288 return false;
289 }
290 //Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri);
291 263
292 HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri); 264 HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri);
293 ChildUpdateRequest.Method = "PUT"; 265 ChildUpdateRequest.Method = "PUT";
@@ -385,8 +357,7 @@ namespace OpenSim.Services.Connectors.Simulation
385 { 357 {
386 agent = null; 358 agent = null;
387 // Eventually, we want to use a caps url instead of the agentID 359 // Eventually, we want to use a caps url instead of the agentID
388 string uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; 360 string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
389 //Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri);
390 361
391 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); 362 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
392 request.Method = "GET"; 363 request.Method = "GET";
@@ -407,7 +378,6 @@ namespace OpenSim.Services.Connectors.Simulation
407 sr = new StreamReader(webResponse.GetResponseStream()); 378 sr = new StreamReader(webResponse.GetResponseStream());
408 reply = sr.ReadToEnd().Trim(); 379 reply = sr.ReadToEnd().Trim();
409 380
410 //Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: ChilAgentUpdate reply was " + reply);
411 381
412 } 382 }
413 catch (WebException ex) 383 catch (WebException ex)
@@ -428,7 +398,6 @@ namespace OpenSim.Services.Connectors.Simulation
428 OSDMap args = Util.GetOSDMap(reply); 398 OSDMap args = Util.GetOSDMap(reply);
429 if (args == null) 399 if (args == null)
430 { 400 {
431 //Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: Error getting OSDMap from reply");
432 return false; 401 return false;
433 } 402 }
434 403
@@ -437,7 +406,6 @@ namespace OpenSim.Services.Connectors.Simulation
437 return true; 406 return true;
438 } 407 }
439 408
440 //Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: DoRetrieveRootAgentCall returned status " + webResponse.StatusCode);
441 return false; 409 return false;
442 } 410 }
443 411
@@ -479,18 +447,7 @@ namespace OpenSim.Services.Connectors.Simulation
479 447
480 public bool CloseAgent(GridRegion destination, UUID id) 448 public bool CloseAgent(GridRegion destination, UUID id)
481 { 449 {
482 string uri = string.Empty; 450 string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
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.Warn("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent close. Reason: " + e.Message);
490 return false;
491 }
492
493 //Console.WriteLine(" >>> DoCloseAgentCall <<< " + uri);
494 451
495 WebRequest request = WebRequest.Create(uri); 452 WebRequest request = WebRequest.Create(uri);
496 request.Method = "DELETE"; 453 request.Method = "DELETE";
@@ -538,7 +495,7 @@ namespace OpenSim.Services.Connectors.Simulation
538 public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) 495 public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall)
539 { 496 {
540 string uri 497 string uri
541 = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + ObjectPath() + sog.UUID + "/"; 498 = destination.ServerURI + ObjectPath() + sog.UUID + "/";
542 //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri); 499 //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri);
543 500
544 WebRequest ObjectCreateRequest = WebRequest.Create(uri); 501 WebRequest ObjectCreateRequest = WebRequest.Create(uri);