* refactor refactor refactor ServerURI 4 lyfe

This commit is contained in:
Jonathan Freedman
2010-10-02 19:17:02 -04:00
committed by Teravus Ovares (Dan Olivares)
parent a7acb650d4
commit 55974df14b
14 changed files with 72 additions and 94 deletions

View File

@@ -104,24 +104,7 @@ namespace OpenSim.Services.Connectors.Simulation
return false;
}
string uri = string.Empty;
// HACK -- Simian grid make it work!!!
if (destination.ServerURI != null && destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:"))
uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
else
{
try
{
uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/";
}
catch (Exception e)
{
m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message);
reason = e.Message;
return false;
}
}
string uri = destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
//Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri);
@@ -277,16 +260,7 @@ namespace OpenSim.Services.Connectors.Simulation
private bool UpdateAgent(GridRegion destination, IAgentData cAgentData)
{
// Eventually, we want to use a caps url instead of the agentID
string uri = string.Empty;
try
{
uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + cAgentData.AgentID + "/";
}
catch (Exception e)
{
m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent update. Reason: " + e.Message);
return false;
}
string uri = destination.ServerURI + AgentPath() + cAgentData.AgentID + "/";
//Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri);
HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri);
@@ -385,7 +359,7 @@ namespace OpenSim.Services.Connectors.Simulation
{
agent = null;
// Eventually, we want to use a caps url instead of the agentID
string uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
//Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
@@ -479,16 +453,7 @@ namespace OpenSim.Services.Connectors.Simulation
public bool CloseAgent(GridRegion destination, UUID id)
{
string uri = string.Empty;
try
{
uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
}
catch (Exception e)
{
m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent close. Reason: " + e.Message);
return false;
}
string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
//Console.WriteLine(" >>> DoCloseAgentCall <<< " + uri);
@@ -538,7 +503,7 @@ namespace OpenSim.Services.Connectors.Simulation
public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall)
{
string uri
= "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + ObjectPath() + sog.UUID + "/";
= destination.ServerURI + ObjectPath() + sog.UUID + "/";
//m_log.Debug(" >>> DoCreateObjectCall <<< " + uri);
WebRequest ObjectCreateRequest = WebRequest.Create(uri);