aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
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, 45 insertions, 56 deletions
diff --git a/OpenSim/Framework/Capabilities/CapsUtil.cs b/OpenSim/Framework/Capabilities/CapsUtil.cs
index faf2708..0334e4b 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 73b8bd0..949a289 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -115,13 +115,7 @@ namespace OpenSim.Framework
115 /// </summary> 115 /// </summary>
116 public string ServerURI 116 public string ServerURI
117 { 117 {
118 get { 118 get { return m_serverURI; }
119 if ( m_serverURI != string.Empty ) {
120 return m_serverURI;
121 } else {
122 return "http://" + m_externalHostName + ":" + m_httpPort + "/";
123 }
124 }
125 set { 119 set {
126 if ( value.EndsWith("/") ) { 120 if ( value.EndsWith("/") ) {
127 m_serverURI = value; 121 m_serverURI = value;
@@ -153,7 +147,6 @@ namespace OpenSim.Framework
153 147
154 public SimpleRegionInfo() 148 public SimpleRegionInfo()
155 { 149 {
156 m_serverURI = string.Empty;
157 } 150 }
158 151
159 public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) 152 public SimpleRegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri)
@@ -163,7 +156,6 @@ namespace OpenSim.Framework
163 156
164 m_internalEndPoint = internalEndPoint; 157 m_internalEndPoint = internalEndPoint;
165 m_externalHostName = externalUri; 158 m_externalHostName = externalUri;
166 m_serverURI = string.Empty;
167 } 159 }
168 160
169 public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, uint port) 161 public SimpleRegionInfo(uint regionLocX, uint regionLocY, string externalUri, uint port)
@@ -174,7 +166,6 @@ namespace OpenSim.Framework
174 m_externalHostName = externalUri; 166 m_externalHostName = externalUri;
175 167
176 m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) port); 168 m_internalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int) port);
177 m_serverURI = string.Empty;
178 } 169 }
179 170
180 public SimpleRegionInfo(RegionInfo ConvertFrom) 171 public SimpleRegionInfo(RegionInfo ConvertFrom)
@@ -464,7 +455,6 @@ namespace OpenSim.Framework
464 configMember = 455 configMember =
465 new ConfigurationMember(xmlNode, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig); 456 new ConfigurationMember(xmlNode, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig);
466 configMember.performConfigurationRetrieve(); 457 configMember.performConfigurationRetrieve();
467 m_serverURI = string.Empty;
468 } 458 }
469 459
470 public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri) 460 public RegionInfo(uint regionLocX, uint regionLocY, IPEndPoint internalEndPoint, string externalUri)
@@ -474,12 +464,10 @@ namespace OpenSim.Framework
474 464
475 m_internalEndPoint = internalEndPoint; 465 m_internalEndPoint = internalEndPoint;
476 m_externalHostName = externalUri; 466 m_externalHostName = externalUri;
477 m_serverURI = string.Empty;
478 } 467 }
479 468
480 public RegionInfo() 469 public RegionInfo()
481 { 470 {
482 m_serverURI = string.Empty;
483 } 471 }
484 472
485 public EstateSettings EstateSettings 473 public EstateSettings EstateSettings
@@ -569,23 +557,10 @@ namespace OpenSim.Framework
569 /// <summary> 557 /// <summary>
570 /// A well-formed URI for the host region server (namely "http://" + ExternalHostName) 558 /// A well-formed URI for the host region server (namely "http://" + ExternalHostName)
571 /// </summary> 559 /// </summary>
572
573 public string ServerURI 560 public string ServerURI
574 { 561 {
575 get { 562 get { return m_serverURI; }
576 if ( m_serverURI != string.Empty ) { 563 set { m_serverURI = value; }
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 }
589 } 564 }
590 565
591 public string RegionName 566 public string RegionName
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 54cc80f..3791e1d 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -327,21 +327,34 @@ 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 IClientIPEndpoint ipepClient; 330
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
334 #region IP Translation for NAT 335 #region IP Translation for NAT
335 // Uses ipepClient above 336 IClientIPEndpoint ipepClient;
336 if (sp.ClientView.TryGet(out ipepClient)) 337 if (sp.ClientView.TryGet(out ipepClient))
337 { 338 {
338 endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address); 339 capsPath
340 = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
341 }
342 else
343 {
344 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
339 } 345 }
340 #endregion 346 #endregion
341 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
342 347
343 if (eq != null) 348 if (eq != null)
344 { 349 {
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
345 eq.EnableSimulator(destinationHandle, endPoint, sp.UUID); 358 eq.EnableSimulator(destinationHandle, endPoint, sp.UUID);
346 359
347 // ES makes the client send a UseCircuitCode message to the destination, 360 // ES makes the client send a UseCircuitCode message to the destination,
@@ -360,7 +373,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
360 else 373 else
361 { 374 {
362 agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle); 375 agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle);
363 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); 376 capsPath = finalDestination.ServerURI + "/CAPS/" + agentCircuit.CapsPath + "0000/";
364 } 377 }
365 378
366 // Expect avatar crossing is a heavy-duty function at the destination. 379 // Expect avatar crossing is a heavy-duty function at the destination.
@@ -493,8 +506,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
493 506
494 protected virtual void SetCallbackURL(AgentData agent, RegionInfo region) 507 protected virtual void SetCallbackURL(AgentData agent, RegionInfo region)
495 { 508 {
496 agent.CallbackURI = region.ServerURI + "agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/"; 509 agent.CallbackURI = region.ServerURI + "/agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/";
497 m_log.Debug("Set callback URL to " + agent.CallbackURI);
498 510
499 } 511 }
500 512
@@ -820,7 +832,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
820 if (isFlying) 832 if (isFlying)
821 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; 833 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
822 cAgent.CallbackURI = m_scene.RegionInfo.ServerURI + 834 cAgent.CallbackURI = m_scene.RegionInfo.ServerURI +
823 "agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; 835 "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/";
824 836
825 if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) 837 if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
826 { 838 {
@@ -845,7 +857,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
845 neighbourRegion.RegionHandle); 857 neighbourRegion.RegionHandle);
846 return agent; 858 return agent;
847 } 859 }
848 string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); 860 // TODO Should construct this behind a method
861 string capsPath =
862 neighbourRegion.ServerURI + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/";
849 863
850 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); 864 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
851 865
@@ -1164,7 +1178,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1164 y = y / Constants.RegionSize; 1178 y = y / Constants.RegionSize;
1165 m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")"); 1179 m_log.Info("[ENTITY TRANSFER MODULE]: Starting to inform client about neighbour " + x + ", " + y + "(" + endPoint.ToString() + ")");
1166 1180
1167 string capsPath = reg.ServerURI + CapsUtil.GetCapsSeedPath(a.CapsPath); 1181 string capsPath = reg.ServerURI + "/CAPS/" + a.CapsPath + "0000/";
1168 1182
1169 string reason = String.Empty; 1183 string reason = String.Empty;
1170 1184
diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs
index 2dd7767..fd0e879 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 a1bcba6..f64a079 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HomeAgentHandlers.cs
@@ -124,7 +124,6 @@ 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;
128 int gatekeeper_port = 0; 127 int gatekeeper_port = 0;
129 IPEndPoint client_ipaddress = null; 128 IPEndPoint client_ipaddress = null;
130 129
@@ -174,7 +173,6 @@ namespace OpenSim.Server.Handlers.Hypergrid
174 destination.RegionLocX = x; 173 destination.RegionLocX = x;
175 destination.RegionLocY = y; 174 destination.RegionLocY = y;
176 destination.RegionName = regionname; 175 destination.RegionName = regionname;
177
178 176
179 AgentCircuitData aCircuit = new AgentCircuitData(); 177 AgentCircuitData aCircuit = new AgentCircuitData();
180 try 178 try
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs
index 74e864b..11df7e0 100644
--- a/OpenSim/Services/GridService/HypergridLinker.cs
+++ b/OpenSim/Services/GridService/HypergridLinker.cs
@@ -198,8 +198,21 @@ 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
201 public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string externalRegionName, uint externalPort, string externalHostName, out GridRegion regInfo, out string reason) 207 public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string externalRegionName, uint externalPort, string externalHostName, out GridRegion regInfo, out string reason)
202 { 208 {
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 {
203 m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, externalRegionName, xloc, yloc); 216 m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, externalRegionName, xloc, yloc);
204 217
205 reason = string.Empty; 218 reason = string.Empty;
@@ -213,11 +226,8 @@ namespace OpenSim.Services.GridService
213 226
214 // Big HACK for Simian Grid !!! 227 // Big HACK for Simian Grid !!!
215 // We need to clean up all URLs used in OpenSim !!! 228 // We need to clean up all URLs used in OpenSim !!!
216 if (externalHostName.Contains("/")) { 229 if (externalHostName.Contains("/"))
217 regInfo.ServerURI = externalHostName; 230 regInfo.ServerURI = externalHostName;
218 } else {
219 regInfo.ServerURI = "http://" + externalHostName + ":" + externalPort.ToString();
220 }
221 231
222 try 232 try
223 { 233 {
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs
index aed2dc8..d5dda11 100644
--- a/OpenSim/Services/HypergridService/UserAgentService.cs
+++ b/OpenSim/Services/HypergridService/UserAgentService.cs
@@ -136,7 +136,6 @@ 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 );
140 139
141 // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination 140 // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination
142 GridRegion region = new GridRegion(gatekeeper); 141 GridRegion region = new GridRegion(gatekeeper);
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs
index 6d3bff7..bf441e6 100644
--- a/OpenSim/Services/Interfaces/IGridService.cs
+++ b/OpenSim/Services/Interfaces/IGridService.cs
@@ -115,13 +115,7 @@ namespace OpenSim.Services.Interfaces
115 /// </summary> 115 /// </summary>
116 public string ServerURI 116 public string ServerURI
117 { 117 {
118 get { 118 get { return m_serverURI; }
119 if ( m_serverURI != string.Empty ) {
120 return m_serverURI;
121 } else {
122 return "http://" + m_externalHostName + ":" + m_httpPort + "/";
123 }
124 }
125 set { 119 set {
126 if ( value.EndsWith("/") ) { 120 if ( value.EndsWith("/") ) {
127 m_serverURI = value; 121 m_serverURI = value;
@@ -176,7 +170,6 @@ namespace OpenSim.Services.Interfaces
176 170
177 public GridRegion() 171 public GridRegion()
178 { 172 {
179 m_serverURI = string.Empty;
180 } 173 }
181 174
182 public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri) 175 public GridRegion(int regionLocX, int regionLocY, IPEndPoint internalEndPoint, string externalUri)