mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 17:55:48 +08:00
Revert "Merge remote branch 'otakup0pe/mantis5110'"
This reverts commit21187f459e, reversing changes made to8f34e46d74.
This commit is contained in:
@@ -72,7 +72,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||
|
||||
protected virtual string AgentPath()
|
||||
{
|
||||
return "agent/";
|
||||
return "/agent/";
|
||||
}
|
||||
|
||||
public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason)
|
||||
@@ -104,7 +104,26 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||
return false;
|
||||
}
|
||||
|
||||
string uri = destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
//Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri);
|
||||
|
||||
AgentCreateRequest = (HttpWebRequest)WebRequest.Create(uri);
|
||||
AgentCreateRequest.Method = "POST";
|
||||
@@ -258,7 +277,17 @@ 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 = destination.ServerURI + AgentPath() + cAgentData.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;
|
||||
}
|
||||
//Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri);
|
||||
|
||||
HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri);
|
||||
ChildUpdateRequest.Method = "PUT";
|
||||
@@ -356,7 +385,8 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||
{
|
||||
agent = null;
|
||||
// Eventually, we want to use a caps url instead of the agentID
|
||||
string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
|
||||
string uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
|
||||
//Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri);
|
||||
|
||||
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
|
||||
request.Method = "GET";
|
||||
@@ -377,6 +407,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||
sr = new StreamReader(webResponse.GetResponseStream());
|
||||
reply = sr.ReadToEnd().Trim();
|
||||
|
||||
//Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: ChilAgentUpdate reply was " + reply);
|
||||
|
||||
}
|
||||
catch (WebException ex)
|
||||
@@ -397,6 +428,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||
OSDMap args = Util.GetOSDMap(reply);
|
||||
if (args == null)
|
||||
{
|
||||
//Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: Error getting OSDMap from reply");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -405,6 +437,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||
return true;
|
||||
}
|
||||
|
||||
//Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: DoRetrieveRootAgentCall returned status " + webResponse.StatusCode);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -446,8 +479,18 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||
|
||||
public bool CloseAgent(GridRegion destination, UUID id)
|
||||
{
|
||||
string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
|
||||
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;
|
||||
}
|
||||
|
||||
//Console.WriteLine(" >>> DoCloseAgentCall <<< " + uri);
|
||||
|
||||
WebRequest request = WebRequest.Create(uri);
|
||||
request.Method = "DELETE";
|
||||
@@ -495,7 +538,7 @@ namespace OpenSim.Services.Connectors.Simulation
|
||||
public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall)
|
||||
{
|
||||
string uri
|
||||
= destination.ServerURI + ObjectPath() + sog.UUID + "/";
|
||||
= "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + ObjectPath() + sog.UUID + "/";
|
||||
//m_log.Debug(" >>> DoCreateObjectCall <<< " + uri);
|
||||
|
||||
WebRequest ObjectCreateRequest = WebRequest.Create(uri);
|
||||
|
||||
Reference in New Issue
Block a user