* refactor refactor refactor ServerURI 4 lyfe

viewer-2-initial-appearance
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

@ -116,7 +116,13 @@ namespace OpenSim.Framework
public string ServerURI public string ServerURI
{ {
get { return m_serverURI; } get { return m_serverURI; }
set { m_serverURI = value; } set {
if ( value.EndsWith("/") ) {
m_serverURI = value;
} else {
m_serverURI = value + '/';
}
}
} }
protected string m_serverURI; protected string m_serverURI;

View File

@ -348,7 +348,7 @@ namespace OpenSim.Framework.Servers.HttpServer
{ {
try try
{ {
// m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl); m_log.Debug("[BASE HTTP SERVER]: Handling request to " + request.RawUrl);
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true); Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", true);
@ -376,11 +376,11 @@ namespace OpenSim.Framework.Servers.HttpServer
string path = request.RawUrl; string path = request.RawUrl;
string handlerKey = GetHandlerKey(request.HttpMethod, path); string handlerKey = GetHandlerKey(request.HttpMethod, path);
// m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path); m_log.DebugFormat("[BASE HTTP SERVER]: Handling {0} request for {1}", request.HttpMethod, path);
if (TryGetStreamHandler(handlerKey, out requestHandler)) if (TryGetStreamHandler(handlerKey, out requestHandler))
{ {
//m_log.Debug("[BASE HTTP SERVER]: Found Stream Handler"); m_log.Debug("[BASE HTTP SERVER]: Found Stream Handler");
// Okay, so this is bad, but should be considered temporary until everything is IStreamHandler. // Okay, so this is bad, but should be considered temporary until everything is IStreamHandler.
byte[] buffer = null; byte[] buffer = null;
@ -395,7 +395,7 @@ namespace OpenSim.Framework.Servers.HttpServer
} }
else if (requestHandler is IGenericHTTPHandler) else if (requestHandler is IGenericHTTPHandler)
{ {
//m_log.Debug("[BASE HTTP SERVER]: Found Caps based HTTP Handler"); m_log.Debug("[BASE HTTP SERVER]: Found Caps based HTTP Handler");
IGenericHTTPHandler HTTPRequestHandler = requestHandler as IGenericHTTPHandler; IGenericHTTPHandler HTTPRequestHandler = requestHandler as IGenericHTTPHandler;
Stream requestStream = request.InputStream; Stream requestStream = request.InputStream;
@ -422,7 +422,7 @@ namespace OpenSim.Framework.Servers.HttpServer
foreach (string headername in rHeaders) foreach (string headername in rHeaders)
{ {
//m_log.Warn("[HEADER]: " + headername + "=" + request.Headers[headername]); m_log.Warn("[HEADER]: " + headername + "=" + request.Headers[headername]);
headervals[headername] = request.Headers[headername]; headervals[headername] = request.Headers[headername];
} }

View File

@ -327,8 +327,8 @@ namespace OpenSim
//regionInfo.originRegionID = regionInfo.RegionID; //regionInfo.originRegionID = regionInfo.RegionID;
// set initial ServerURI // set initial ServerURI
regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.InternalEndPoint.Port;
regionInfo.HttpPort = m_httpServerPort; regionInfo.HttpPort = m_httpServerPort;
regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort.ToString();
regionInfo.osSecret = m_osSecret; regionInfo.osSecret = m_osSecret;

View File

@ -337,20 +337,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (sp.ClientView.TryGet(out ipepClient)) if (sp.ClientView.TryGet(out ipepClient))
{ {
capsPath capsPath
= "http://" = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
+ NetworkUtil.GetHostFor(ipepClient.EndPoint, finalDestination.ExternalHostName)
+ ":"
+ finalDestination.HttpPort
+ CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
} }
else else
{ {
capsPath capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
= "http://"
+ finalDestination.ExternalHostName
+ ":"
+ finalDestination.HttpPort
+ CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
} }
#endregion #endregion
@ -382,8 +373,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
else else
{ {
agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle); agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle);
capsPath = "http://" + finalDestination.ExternalHostName + ":" + finalDestination.HttpPort capsPath = finalDestination.ServerURI + "/CAPS/" + agentCircuit.CapsPath + "0000/";
+ "/CAPS/" + agentCircuit.CapsPath + "0000/";
} }
// Expect avatar crossing is a heavy-duty function at the destination. // Expect avatar crossing is a heavy-duty function at the destination.
@ -516,8 +506,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) protected virtual void SetCallbackURL(AgentData agent, RegionInfo region)
{ {
agent.CallbackURI = "http://" + region.ExternalHostName + ":" + region.HttpPort + agent.CallbackURI = region.ServerURI + "/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/";
"/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/";
} }
@ -842,7 +831,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
cAgent.Position = pos; cAgent.Position = pos;
if (isFlying) if (isFlying)
cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
cAgent.CallbackURI = "http://" + m_scene.RegionInfo.ExternalHostName + ":" + m_scene.RegionInfo.HttpPort + cAgent.CallbackURI = m_scene.RegionInfo.ServerURI +
"/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/";
if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
@ -870,8 +859,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
} }
// TODO Should construct this behind a method // TODO Should construct this behind a method
string capsPath = string capsPath =
"http://" + neighbourRegion.ExternalHostName + ":" + neighbourRegion.HttpPort neighbourRegion.ServerURI + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/";
+ "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/";
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
@ -1190,8 +1178,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
y = y / Constants.RegionSize; y = y / Constants.RegionSize;
m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")"); m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")");
string capsPath = "http://" + reg.ExternalHostName + ":" + reg.HttpPort string capsPath = reg.ServerURI + "/CAPS/" + a.CapsPath + "0000/";
+ "/CAPS/" + a.CapsPath + "0000/";
string reason = String.Empty; string reason = String.Empty;

View File

@ -147,7 +147,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
string regionimage = "regionImage" + m_scene.RegionInfo.RegionID.ToString(); string regionimage = "regionImage" + m_scene.RegionInfo.RegionID.ToString();
regionimage = regionimage.Replace("-", ""); regionimage = regionimage.Replace("-", "");
m_log.Info("[WORLD MAP]: JPEG Map location: http://" + m_scene.RegionInfo.ExternalEndPoint.Address.ToString() + ":" + m_scene.RegionInfo.HttpPort.ToString() + "/index.php?method=" + regionimage); m_log.Info("[WORLD MAP]: JPEG Map location: " + m_scene.RegionInfo.ServerURI + "/index.php?method=" + regionimage);
MainServer.Instance.AddHTTPHandler(regionimage, OnHTTPGetMapImage); MainServer.Instance.AddHTTPHandler(regionimage, OnHTTPGetMapImage);
MainServer.Instance.AddLLSDHandler( MainServer.Instance.AddLLSDHandler(

View File

@ -108,8 +108,8 @@ namespace OpenSim.Services.Connectors.Hypergrid
} }
hash = (Hashtable)response.Value; hash = (Hashtable)response.Value;
//foreach (Object o in hash) foreach (Object o in hash)
// m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
try try
{ {
bool success = false; bool success = false;
@ -117,16 +117,20 @@ namespace OpenSim.Services.Connectors.Hypergrid
if (success) if (success)
{ {
UUID.TryParse((string)hash["uuid"], out regionID); UUID.TryParse((string)hash["uuid"], out regionID);
//m_log.Debug(">> HERE, uuid: " + uuid); m_log.Debug(">> HERE, uuid: " + regionID);
if ((string)hash["handle"] != null) if ((string)hash["handle"] != null)
{ {
realHandle = Convert.ToUInt64((string)hash["handle"]); realHandle = Convert.ToUInt64((string)hash["handle"]);
//m_log.Debug(">> HERE, realHandle: " + realHandle); m_log.Debug(">> HERE, realHandle: " + realHandle);
} }
if (hash["region_image"] != null) if (hash["region_image"] != null) {
imageURL = (string)hash["region_image"]; imageURL = (string)hash["region_image"];
if (hash["external_name"] != null) m_log.Debug(">> HERE, imageURL: " + imageURL);
}
if (hash["external_name"] != null) {
externalName = (string)hash["external_name"]; externalName = (string)hash["external_name"];
m_log.Debug(">> HERE, externalName: " + externalName);
}
} }
} }
@ -208,8 +212,8 @@ namespace OpenSim.Services.Connectors.Hypergrid
} }
hash = (Hashtable)response.Value; hash = (Hashtable)response.Value;
//foreach (Object o in hash) foreach (Object o in hash)
// m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
try try
{ {
bool success = false; bool success = false;
@ -219,38 +223,41 @@ namespace OpenSim.Services.Connectors.Hypergrid
GridRegion region = new GridRegion(); GridRegion region = new GridRegion();
UUID.TryParse((string)hash["uuid"], out region.RegionID); UUID.TryParse((string)hash["uuid"], out region.RegionID);
//m_log.Debug(">> HERE, uuid: " + region.RegionID); m_log.Debug(">> HERE, uuid: " + region.RegionID);
int n = 0; int n = 0;
if (hash["x"] != null) if (hash["x"] != null)
{ {
Int32.TryParse((string)hash["x"], out n); Int32.TryParse((string)hash["x"], out n);
region.RegionLocX = n; region.RegionLocX = n;
//m_log.Debug(">> HERE, x: " + region.RegionLocX); m_log.Debug(">> HERE, x: " + region.RegionLocX);
} }
if (hash["y"] != null) if (hash["y"] != null)
{ {
Int32.TryParse((string)hash["y"], out n); Int32.TryParse((string)hash["y"], out n);
region.RegionLocY = n; region.RegionLocY = n;
//m_log.Debug(">> HERE, y: " + region.RegionLocY); m_log.Debug(">> HERE, y: " + region.RegionLocY);
} }
if (hash["region_name"] != null) if (hash["region_name"] != null)
{ {
region.RegionName = (string)hash["region_name"]; region.RegionName = (string)hash["region_name"];
//m_log.Debug(">> HERE, name: " + region.RegionName); m_log.Debug(">> HERE, region_name: " + region.RegionName);
} }
if (hash["hostname"] != null) if (hash["hostname"] != null)
region.ExternalHostName = (string)hash["hostname"]; region.ExternalHostName = (string)hash["hostname"];
m_log.Debug(">> HERE, hostname: " + region.ExternalHostName);
if (hash["http_port"] != null) if (hash["http_port"] != null)
{ {
uint p = 0; uint p = 0;
UInt32.TryParse((string)hash["http_port"], out p); UInt32.TryParse((string)hash["http_port"], out p);
region.HttpPort = p; region.HttpPort = p;
m_log.Debug(">> HERE, http_port: " + region.HttpPort);
} }
if (hash["internal_port"] != null) if (hash["internal_port"] != null)
{ {
int p = 0; int p = 0;
Int32.TryParse((string)hash["internal_port"], out p); Int32.TryParse((string)hash["internal_port"], out p);
region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p); region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p);
m_log.Debug(">> HERE, internal_port: " + region.InternalEndPoint);
} }
// Successful return // Successful return

View File

@ -84,8 +84,7 @@ namespace OpenSim.Services.Connectors
if (info != null) // just to be sure if (info != null) // just to be sure
{ {
XmlRpcRequest request = new XmlRpcRequest("land_data", paramList); XmlRpcRequest request = new XmlRpcRequest("land_data", paramList);
string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/"; XmlRpcResponse response = request.Send(info.ServerURI, 10000);
XmlRpcResponse response = request.Send(uri, 10000);
if (response.IsFault) if (response.IsFault)
{ {
m_log.ErrorFormat("[LAND CONNECTOR]: remote call returned an error: {0}", response.FaultString); m_log.ErrorFormat("[LAND CONNECTOR]: remote call returned an error: {0}", response.FaultString);

View File

@ -87,7 +87,7 @@ namespace OpenSim.Services.Connectors
public bool DoHelloNeighbourCall(GridRegion region, RegionInfo thisRegion) public bool DoHelloNeighbourCall(GridRegion region, RegionInfo thisRegion)
{ {
string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/region/" + thisRegion.RegionID + "/"; string uri = region.ServerURI + "/region/" + thisRegion.RegionID + "/";
//m_log.Debug(" >>> DoHelloNeighbourCall <<< " + uri); //m_log.Debug(" >>> DoHelloNeighbourCall <<< " + uri);
WebRequest HelloNeighbourRequest = WebRequest.Create(uri); WebRequest HelloNeighbourRequest = WebRequest.Create(uri);

View File

@ -145,8 +145,6 @@ namespace OpenSim.Services.Connectors.SimianGrid
Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0); Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0);
Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0); Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0);
string httpAddress = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "/";
OSDMap extraData = new OSDMap OSDMap extraData = new OSDMap
{ {
{ "ServerURI", OSD.FromString(regionInfo.ServerURI) }, { "ServerURI", OSD.FromString(regionInfo.ServerURI) },
@ -168,7 +166,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
{ "Name", regionInfo.RegionName }, { "Name", regionInfo.RegionName },
{ "MinPosition", minPosition.ToString() }, { "MinPosition", minPosition.ToString() },
{ "MaxPosition", maxPosition.ToString() }, { "MaxPosition", maxPosition.ToString() },
{ "Address", httpAddress }, { "Address", regionInfo.ServerURI },
{ "Enabled", "1" }, { "Enabled", "1" },
{ "ExtraData", OSDParser.SerializeJsonString(extraData) } { "ExtraData", OSDParser.SerializeJsonString(extraData) }
}; };

View File

@ -104,24 +104,7 @@ namespace OpenSim.Services.Connectors.Simulation
return false; return false;
} }
string uri = string.Empty; string uri = destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
// 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); //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri);
@ -277,16 +260,7 @@ namespace OpenSim.Services.Connectors.Simulation
private bool UpdateAgent(GridRegion destination, IAgentData cAgentData) private bool UpdateAgent(GridRegion destination, IAgentData cAgentData)
{ {
// Eventually, we want to use a caps url instead of the agentID // Eventually, we want to use a caps url instead of the agentID
string uri = string.Empty; string uri = destination.ServerURI + AgentPath() + cAgentData.AgentID + "/";
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); //Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri);
HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri); HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri);
@ -385,7 +359,7 @@ namespace OpenSim.Services.Connectors.Simulation
{ {
agent = null; agent = null;
// Eventually, we want to use a caps url instead of the agentID // 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); //Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
@ -479,16 +453,7 @@ namespace OpenSim.Services.Connectors.Simulation
public bool CloseAgent(GridRegion destination, UUID id) public bool CloseAgent(GridRegion destination, UUID id)
{ {
string uri = string.Empty; string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
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); //Console.WriteLine(" >>> DoCloseAgentCall <<< " + uri);
@ -538,7 +503,7 @@ namespace OpenSim.Services.Connectors.Simulation
public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall) public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall)
{ {
string uri string uri
= "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + ObjectPath() + sog.UUID + "/"; = destination.ServerURI + ObjectPath() + sog.UUID + "/";
//m_log.Debug(" >>> DoCreateObjectCall <<< " + uri); //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri);
WebRequest ObjectCreateRequest = WebRequest.Create(uri); WebRequest ObjectCreateRequest = WebRequest.Create(uri);

View File

@ -127,7 +127,7 @@ namespace OpenSim.Services.GridService
if (MainConsole.Instance != null) if (MainConsole.Instance != null)
{ {
MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region", MainConsole.Instance.Commands.AddCommand("hypergrid", false, "link-region",
"link-region <Xloc> <Yloc> <HostName>:<HttpPort>[:<RemoteRegionName>] <cr>", "link-region <Xloc> <Yloc> <RegionIP> <RegionPort> [<RegionServerURI] [<RemoteRegionName>] <cr>",
"Link a hypergrid region", RunCommand); "Link a hypergrid region", RunCommand);
MainConsole.Instance.Commands.AddCommand("hypergrid", false, "unlink-region", MainConsole.Instance.Commands.AddCommand("hypergrid", false, "unlink-region",
"unlink-region <local name> or <HostName>:<HttpPort> <cr>", "unlink-region <local name> or <HostName>:<HttpPort> <cr>",
@ -200,9 +200,15 @@ namespace OpenSim.Services.GridService
} }
// From the command line and the 2 above
public bool TryCreateLink(UUID scopeID, int xloc, int yloc, public bool TryCreateLink(UUID scopeID, int xloc, int yloc,
string externalRegionName, uint externalPort, string externalHostName, out GridRegion regInfo, out string reason) string externalRegionName, uint externalPort, string externalHostName, out GridRegion regInfo, out string reason)
{
TryCreateLink(scopeID, xloc, yloc, externalRegionName, externalPort, externalHostName, null, regInfo, reason);
}
// From the command line and the 2 above
public bool TryCreateLink(UUID scopeID, int xloc, int yloc,
string externalRegionName, uint externalPort, string externalHostName, string serverURI, out GridRegion regInfo, out string reason)
{ {
m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, externalRegionName, xloc, yloc); m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, externalRegionName, xloc, yloc);
@ -509,12 +515,16 @@ namespace OpenSim.Services.GridService
int xloc, yloc; int xloc, yloc;
uint externalPort; uint externalPort;
string externalHostName; string externalHostName;
string serverURI;
try try
{ {
xloc = Convert.ToInt32(cmdparams[0]); xloc = Convert.ToInt32(cmdparams[0]);
yloc = Convert.ToInt32(cmdparams[1]); yloc = Convert.ToInt32(cmdparams[1]);
externalPort = Convert.ToUInt32(cmdparams[3]); externalPort = Convert.ToUInt32(cmdparams[3]);
externalHostName = cmdparams[2]; externalHostName = cmdparams[2];
if ( cmdparams.Length == 4 ) {
}
//internalPort = Convert.ToUInt32(cmdparams[4]); //internalPort = Convert.ToUInt32(cmdparams[4]);
//remotingPort = Convert.ToUInt32(cmdparams[5]); //remotingPort = Convert.ToUInt32(cmdparams[5]);
} }

View File

@ -157,7 +157,7 @@ namespace OpenSim.Services.HypergridService
string regionimage = "regionImage" + region.RegionID.ToString(); string regionimage = "regionImage" + region.RegionID.ToString();
regionimage = regionimage.Replace("-", ""); regionimage = regionimage.Replace("-", "");
imageURL = "http://" + region.ExternalHostName + ":" + region.HttpPort + "/index.php?method=" + regionimage; imageURL = region.ServerURI + "index.php?method=" + regionimage;
return true; return true;
} }

View File

@ -145,12 +145,12 @@ namespace OpenSim.Services.HypergridService
region.RegionLocY = finalDestination.RegionLocY; region.RegionLocY = finalDestination.RegionLocY;
// Generate a new service session // Generate a new service session
agentCircuit.ServiceSessionID = "http://" + region.ExternalHostName + ":" + region.HttpPort + ";" + UUID.Random(); agentCircuit.ServiceSessionID = region.ServerURI + ";" + UUID.Random();
TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region);
bool success = false; bool success = false;
string myExternalIP = string.Empty; string myExternalIP = string.Empty;
string gridName = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort; string gridName = gatekeeper.ServerURI;
if (m_GridName == gridName) if (m_GridName == gridName)
success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason);
else else
@ -159,7 +159,7 @@ namespace OpenSim.Services.HypergridService
if (!success) if (!success)
{ {
m_log.DebugFormat("[USER AGENT SERVICE]: Unable to login user {0} {1} to grid {2}, reason: {3}", m_log.DebugFormat("[USER AGENT SERVICE]: Unable to login user {0} {1} to grid {2}, reason: {3}",
agentCircuit.firstname, agentCircuit.lastname, region.ExternalHostName + ":" + region.HttpPort, reason); agentCircuit.firstname, agentCircuit.lastname, region.ServerURI, reason);
// restore the old travel info // restore the old travel info
lock (m_TravelingAgents) lock (m_TravelingAgents)
@ -210,7 +210,7 @@ namespace OpenSim.Services.HypergridService
m_TravelingAgents[agentCircuit.SessionID] = travel; m_TravelingAgents[agentCircuit.SessionID] = travel;
} }
travel.UserID = agentCircuit.AgentID; travel.UserID = agentCircuit.AgentID;
travel.GridExternalName = "http://" + region.ExternalHostName + ":" + region.HttpPort; travel.GridExternalName = region.ServerURI;
travel.ServiceToken = agentCircuit.ServiceSessionID; travel.ServiceToken = agentCircuit.ServiceSessionID;
if (old != null) if (old != null)
travel.ClientIPAddress = old.ClientIPAddress; travel.ClientIPAddress = old.ClientIPAddress;

View File

@ -116,7 +116,13 @@ namespace OpenSim.Services.Interfaces
public string ServerURI public string ServerURI
{ {
get { return m_serverURI; } get { return m_serverURI; }
set { m_serverURI = value; } set {
if ( value.EndsWith("/") ) {
m_serverURI = value;
} else {
m_serverURI = value + '/';
}
}
} }
protected string m_serverURI; protected string m_serverURI;