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.cs55
1 files changed, 6 insertions, 49 deletions
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index a5f748f..c4284eb 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.Debug("[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,7 @@ 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 string uri = destination.ServerURI + AgentPath() + cAgentData.AgentID + "/";
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 }
290 //Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri);
291 262
292 HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri); 263 HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri);
293 ChildUpdateRequest.Method = "PUT"; 264 ChildUpdateRequest.Method = "PUT";
@@ -385,8 +356,7 @@ namespace OpenSim.Services.Connectors.Simulation
385 { 356 {
386 agent = null; 357 agent = null;
387 // Eventually, we want to use a caps url instead of the agentID 358 // 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() + "/"; 359 string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
389 //Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri);
390 360
391 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); 361 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
392 request.Method = "GET"; 362 request.Method = "GET";
@@ -407,7 +377,6 @@ namespace OpenSim.Services.Connectors.Simulation
407 sr = new StreamReader(webResponse.GetResponseStream()); 377 sr = new StreamReader(webResponse.GetResponseStream());
408 reply = sr.ReadToEnd().Trim(); 378 reply = sr.ReadToEnd().Trim();
409 379
410 //Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: ChilAgentUpdate reply was " + reply);
411 380
412 } 381 }
413 catch (WebException ex) 382 catch (WebException ex)
@@ -428,7 +397,6 @@ namespace OpenSim.Services.Connectors.Simulation
428 OSDMap args = Util.GetOSDMap(reply); 397 OSDMap args = Util.GetOSDMap(reply);
429 if (args == null) 398 if (args == null)
430 { 399 {
431 //Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: Error getting OSDMap from reply");
432 return false; 400 return false;
433 } 401 }
434 402
@@ -437,7 +405,6 @@ namespace OpenSim.Services.Connectors.Simulation
437 return true; 405 return true;
438 } 406 }
439 407
440 //Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: DoRetrieveRootAgentCall returned status " + webResponse.StatusCode);
441 return false; 408 return false;
442 } 409 }
443 410
@@ -479,18 +446,8 @@ namespace OpenSim.Services.Connectors.Simulation
479 446
480 public bool CloseAgent(GridRegion destination, UUID id) 447 public bool CloseAgent(GridRegion destination, UUID id)
481 { 448 {
482 string uri = string.Empty; 449 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.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent close. Reason: " + e.Message);
490 return false;
491 }
492 450
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);