aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJonathan Freedman2010-10-11 16:53:00 -0400
committerTeravus Ovares (Dan Olivares)2010-10-20 22:21:45 -0400
commit58f75fa19d9aea18283ecdbd44559efb81781c9d (patch)
treee8bfce52ff388d7e6f02fd48b406280d139bbf29 /OpenSim
parent* additional serveruri cleanup (diff)
downloadopensim-SC_OLD-58f75fa19d9aea18283ecdbd44559efb81781c9d.zip
opensim-SC_OLD-58f75fa19d9aea18283ecdbd44559efb81781c9d.tar.gz
opensim-SC_OLD-58f75fa19d9aea18283ecdbd44559efb81781c9d.tar.bz2
opensim-SC_OLD-58f75fa19d9aea18283ecdbd44559efb81781c9d.tar.xz
* more url / hg cleanup
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Capabilities/CapsUtil.cs2
-rw-r--r--OpenSim/Framework/RegionInfo.cs31
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs34
-rw-r--r--OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs4
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs2
-rw-r--r--OpenSim/Services/GridService/HypergridLinker.cs18
-rw-r--r--OpenSim/Services/HypergridService/UserAgentService.cs1
-rw-r--r--OpenSim/Services/Interfaces/IGridService.cs9
8 files changed, 56 insertions, 45 deletions
diff --git a/OpenSim/Framework/Capabilities/CapsUtil.cs b/OpenSim/Framework/Capabilities/CapsUtil.cs
index 0334e4b..faf2708 100644
--- a/OpenSim/Framework/Capabilities/CapsUtil.cs
+++ b/OpenSim/Framework/Capabilities/CapsUtil.cs
@@ -41,7 +41,7 @@ namespace OpenSim.Framework.Capabilities
41 /// <returns></returns> 41 /// <returns></returns>
42 public static string GetCapsSeedPath(string capsObjectPath) 42 public static string GetCapsSeedPath(string capsObjectPath)
43 { 43 {
44 return "/CAPS/" + capsObjectPath + "0000/"; 44 return "CAPS/" + capsObjectPath + "0000/";
45 } 45 }
46 46
47 /// <summary> 47 /// <summary>
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index 949a289..73b8bd0 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -115,7 +115,13 @@ namespace OpenSim.Framework
115 /// </summary> 115 /// </summary>
116 public string ServerURI 116 public string ServerURI
117 { 117 {
118 get { return m_serverURI; } 118 get {
119 if ( m_serverURI != string.Empty ) {
120 return m_serverURI;
121 } else {
122 return "http://" + m_externalHostName + ":" + m_httpPort + "/";
123 }
124 }
119 set { 125 set {
120 if ( value.EndsWith("/") ) { 126 if ( value.EndsWith("/") ) {
121 m_serverURI = value; 127 m_serverURI = value;
@@ -147,6 +153,7 @@ namespace OpenSim.Framework
147 153
148 public SimpleRegionInfo() 154 public SimpleRegionInfo()
149 { 155 {
156 m_serverURI = string.Empty;
150 } 157 }
151 158
152 public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) 159 public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri)
@@ -156,6 +163,7 @@ namespace OpenSim.Framework
156 163
157 m_internalEndPoint = internalEndPoint; 164 m_internalEndPoint = internalEndPoint;
158 m_externalHostName = externalUri; 165 m_externalHostName = externalUri;
166 m_serverURI = string.Empty;
159 } 167 }
160 168
161 public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, uint port) 169 public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, uint port)
@@ -166,6 +174,7 @@ namespace OpenSim.Framework
166 m_externalHostName = externalUri; 174 m_externalHostName = externalUri;
167 175
168 m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) port); 176 m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) port);
177 m_serverURI = string.Empty;
169 } 178 }
170 179
171 public SimpleRegionInfo(RegionInfo ConvertFrom) 180 public SimpleRegionInfo(RegionInfo ConvertFrom)
@@ -455,6 +464,7 @@ namespace OpenSim.Framework
455 configMember = 464 configMember =
456 new ConfigurationMember(xmlNode, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig); 465 new ConfigurationMember(xmlNode, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig);
457 configMember.performConfigurationRetrieve(); 466 configMember.performConfigurationRetrieve();
467 m_serverURI = string.Empty;
458 } 468 }
459 469
460 public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) 470 public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri)
@@ -464,10 +474,12 @@ namespace OpenSim.Framework
464 474
465 m_internalEndPoint = internalEndPoint; 475 m_internalEndPoint = internalEndPoint;
466 m_externalHostName = externalUri; 476 m_externalHostName = externalUri;
477 m_serverURI = string.Empty;
467 } 478 }
468 479
469 public RegionInfo() 480 public RegionInfo()
470 { 481 {
482 m_serverURI = string.Empty;
471 } 483 }
472 484
473 public EstateSettings EstateSettings 485 public EstateSettings EstateSettings
@@ -557,10 +569,23 @@ namespace OpenSim.Framework
557 /// <summary> 569 /// <summary>
558 /// A well-formed URI for the host region server (namely "http://" + ExternalHostName) 570 /// A well-formed URI for the host region server (namely "http://" + ExternalHostName)
559 /// </summary> 571 /// </summary>
572
560 public string ServerURI 573 public string ServerURI
561 { 574 {
562 get { return m_serverURI; } 575 get {
563 set { m_serverURI = value; } 576 if ( m_serverURI != string.Empty ) {
577 return m_serverURI;
578 } else {
579 return "http://" + m_externalHostName + ":" + m_httpPort + "/";
580 }
581 }
582 set {
583 if ( value.EndsWith("/") ) {
584 m_serverURI = value;
585 } else {
586 m_serverURI = value + '/';
587 }
588 }
564 } 589 }
565 590
566 public string RegionName 591 public string RegionName
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 3791e1d..54cc80f 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -327,34 +327,21 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
327 327
328 // OK, it got this agent. Let's close some child agents 328 // OK, it got this agent. Let's close some child agents
329 sp.CloseChildAgents(newRegionX, newRegionY); 329 sp.CloseChildAgents(newRegionX, newRegionY);
330 330 IClientIPEndpoint ipepClient;
331 if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY)) 331 if (NeedsNewAgent(oldRegionX, newRegionX, oldRegionY, newRegionY))
332 { 332 {
333 //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent..."); 333 //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent...");
334
335 #region IP Translation for NAT 334 #region IP Translation for NAT
336 IClientIPEndpoint ipepClient; 335 // Uses ipepClient above
337 if (sp.ClientView.TryGet(out ipepClient)) 336 if (sp.ClientView.TryGet(out ipepClient))
338 { 337 {
339 capsPath 338 endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address);
340 = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
341 }
342 else
343 {
344 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
345 } 339 }
346 #endregion 340 #endregion
341 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
347 342
348 if (eq != null) 343 if (eq != null)
349 { 344 {
350 #region IP Translation for NAT
351 // Uses ipepClient above
352 if (sp.ClientView.TryGet(out ipepClient))
353 {
354 endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address);
355 }
356 #endregion
357
358 eq.EnableSimulator(destinationHandle, endPoint, sp.UUID); 345 eq.EnableSimulator(destinationHandle, endPoint, sp.UUID);
359 346
360 // ES makes the client send a UseCircuitCode message to the destination, 347 // ES makes the client send a UseCircuitCode message to the destination,
@@ -373,7 +360,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
373 else 360 else
374 { 361 {
375 agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle); 362 agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle);
376 capsPath = finalDestination.ServerURI + "/CAPS/" + agentCircuit.CapsPath + "0000/"; 363 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
377 } 364 }
378 365
379 // Expect avatar crossing is a heavy-duty function at the destination. 366 // Expect avatar crossing is a heavy-duty function at the destination.
@@ -506,7 +493,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
506 493
507 protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) 494 protected virtual void SetCallbackURL(AgentData agent, RegionInfo region)
508 { 495 {
509 agent.CallbackURI = region.ServerURI + "/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/"; 496 agent.CallbackURI = region.ServerURI + "agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/";
497 m_log.Debug("Set callback URL to " + agent.CallbackURI);
510 498
511 } 499 }
512 500
@@ -832,7 +820,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
832 if (isFlying) 820 if (isFlying)
833 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; 821 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
834 cAgent.CallbackURI = m_scene.RegionInfo.ServerURI + 822 cAgent.CallbackURI = m_scene.RegionInfo.ServerURI +
835 "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; 823 "agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/";
836 824
837 if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) 825 if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
838 { 826 {
@@ -857,9 +845,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
857 neighbourRegion.RegionHandle); 845 neighbourRegion.RegionHandle);
858 return agent; 846 return agent;
859 } 847 }
860 // TODO Should construct this behind a method 848 string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps);
861 string capsPath =
862 neighbourRegion.ServerURI + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/";
863 849
864 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); 850 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
865 851
@@ -1178,7 +1164,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1178 y = y / Constants.RegionSize; 1164 y = y / Constants.RegionSize;
1179 m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")"); 1165 m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")");
1180 1166
1181 string capsPath = reg.ServerURI + "/CAPS/" + a.CapsPath + "0000/"; 1167 string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath);
1182 1168
1183 string reason = String.Empty; 1169 string reason = String.Empty;
1184 1170
diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
index fd0e879..2dd7767 100644
--- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
+++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
@@ -595,12 +595,12 @@ namespace OpenSim.Region.CoreModules.InterGrid
595 // DEPRECATED 595 // DEPRECATED
596 responseMap["seed_capability"] 596 responseMap["seed_capability"]
597 = OSD.FromString( 597 = OSD.FromString(
598 regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath)); 598 regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/" + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath));
599 599
600 // REPLACEMENT 600 // REPLACEMENT
601 responseMap["region_seed_capability"] 601 responseMap["region_seed_capability"]
602 = OSD.FromString( 602 = OSD.FromString(
603 regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath)); 603 regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/" + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath));
604 604
605 responseMap["rez_avatar"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); 605 responseMap["rez_avatar"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath);
606 responseMap["rez_avatar/rez"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); 606 responseMap["rez_avatar/rez"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath);
diff --git a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
index f64a079..a1bcba6 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
@@ -124,6 +124,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
124 UUID uuid = UUID.Zero; 124 UUID uuid = UUID.Zero;
125 string regionname = string.Empty; 125 string regionname = string.Empty;
126 string gatekeeper_host = string.Empty; 126 string gatekeeper_host = string.Empty;
127 string server_uri = string.Empty;
127 int gatekeeper_port = 0; 128 int gatekeeper_port = 0;
128 IPEndPoint client_ipaddress = null; 129 IPEndPoint client_ipaddress = null;
129 130
@@ -173,6 +174,7 @@ namespace OpenSim.Server.Handlers.Hypergrid
173 destination.RegionLocX = x; 174 destination.RegionLocX = x;
174 destination.RegionLocY = y; 175 destination.RegionLocY = y;
175 destination.RegionName = regionname; 176 destination.RegionName = regionname;
177
176 178
177 AgentCircuitData aCircuit = new AgentCircuitData(); 179 AgentCircuitData aCircuit = new AgentCircuitData();
178 try 180 try
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 11df7e0..74e864b 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -198,21 +198,8 @@ namespace OpenSim.Services.GridService
198 198
199 return null; 199 return null;
200 } 200 }
201
202 public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string externalRegionName, string serverURI, out GridRegion regInfo, out string reason)
203 {
204 return TryCreateLink(scopeID, xloc, yloc, externalRegionName, 0, null, serverURI, out regInfo, out reason);
205 }
206
207 public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string externalRegionName, uint externalPort, string externalHostName, out GridRegion regInfo, out string reason) 201 public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string externalRegionName, uint externalPort, string externalHostName, out GridRegion regInfo, out string reason)
208 { 202 {
209 return TryCreateLink(scopeID, xloc, yloc, externalRegionName, externalPort, externalHostName, null, out regInfo, out reason);
210 }
211
212 // From the command line and the 2 above
213 public bool TryCreateLink(UUID scopeID, int xloc, int yloc,
214 string externalRegionName, uint externalPort, string externalHostName, string serverURI, out GridRegion regInfo, out string reason)
215 {
216 m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, externalRegionName, xloc, yloc); 203 m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, externalRegionName, xloc, yloc);
217 204
218 reason = string.Empty; 205 reason = string.Empty;
@@ -226,8 +213,11 @@ namespace OpenSim.Services.GridService
226 213
227 // Big HACK for Simian Grid !!! 214 // Big HACK for Simian Grid !!!
228 // We need to clean up all URLs used in OpenSim !!! 215 // We need to clean up all URLs used in OpenSim !!!
229 if (externalHostName.Contains("/")) 216 if (externalHostName.Contains("/")) {
230 regInfo.ServerURI = externalHostName; 217 regInfo.ServerURI = externalHostName;
218 } else {
219 regInfo.ServerURI = "http://" + externalHostName + ":" + externalPort.ToString();
220 }
231 221
232 try 222 try
233 { 223 {
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs
index d5dda11..aed2dc8 100644
--- a/OpenSim/Services/HypergridService/UserAgentService.cs
+++ b/OpenSim/Services/HypergridService/UserAgentService.cs
@@ -136,6 +136,7 @@ namespace OpenSim.Services.HypergridService
136 m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}", 136 m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}",
137 agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()), 137 agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()),
138 gatekeeper.ExternalHostName +":"+ gatekeeper.HttpPort); 138 gatekeeper.ExternalHostName +":"+ gatekeeper.HttpPort);
139 m_log.Debug("gatekeeper serveruri -> " + gatekeeper.ServerURI );
139 140
140 // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination 141 // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination
141 GridRegion region = new GridRegion(gatekeeper); 142 GridRegion region = new GridRegion(gatekeeper);
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index bf441e6..6d3bff7 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -115,7 +115,13 @@ namespace OpenSim.Services.Interfaces
115 /// </summary> 115 /// </summary>
116 public string ServerURI 116 public string ServerURI
117 { 117 {
118 get { return m_serverURI; } 118 get {
119 if ( m_serverURI != string.Empty ) {
120 return m_serverURI;
121 } else {
122 return "http://" + m_externalHostName + ":" + m_httpPort + "/";
123 }
124 }
119 set { 125 set {
120 if ( value.EndsWith("/") ) { 126 if ( value.EndsWith("/") ) {
121 m_serverURI = value; 127 m_serverURI = value;
@@ -170,6 +176,7 @@ namespace OpenSim.Services.Interfaces
170 176
171 public GridRegion() 177 public GridRegion()
172 { 178 {
179 m_serverURI = string.Empty;
173 } 180 }
174 181
175 public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri) 182 public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri)