diff options
author | Justin Clarke Casey | 2009-01-06 18:06:53 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-01-06 18:06:53 +0000 |
commit | 715a776f7d62d2af7610dbd3137e3e753fdbc25c (patch) | |
tree | 0800abc6a4c7f875c47af19586c79b3aedd79e4c /OpenSim | |
parent | * Yeah, might just want to add the new class as well - sigh (diff) | |
download | opensim-SC-715a776f7d62d2af7610dbd3137e3e753fdbc25c.zip opensim-SC-715a776f7d62d2af7610dbd3137e3e753fdbc25c.tar.gz opensim-SC-715a776f7d62d2af7610dbd3137e3e753fdbc25c.tar.bz2 opensim-SC-715a776f7d62d2af7610dbd3137e3e753fdbc25c.tar.xz |
* Move common string aggregation for caps seed path to a method in CapsUtil
Diffstat (limited to 'OpenSim')
6 files changed, 33 insertions, 15 deletions
diff --git a/OpenSim/Framework/Communications/Capabilities/CapsUtil.cs b/OpenSim/Framework/Communications/Capabilities/CapsUtil.cs index cbd6465..27ce402 100644 --- a/OpenSim/Framework/Communications/Capabilities/CapsUtil.cs +++ b/OpenSim/Framework/Communications/Capabilities/CapsUtil.cs | |||
@@ -35,6 +35,16 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
35 | /// </summary> | 35 | /// </summary> |
36 | public class CapsUtil | 36 | public class CapsUtil |
37 | { | 37 | { |
38 | /// <summary> | ||
39 | /// Generate a CAPS seed path using a previously generated CAPS object path component | ||
40 | /// </summary> | ||
41 | /// <param name="capsKey"></param> | ||
42 | /// <returns></returns> | ||
43 | public static string GetCapsSeedPath(string capsObjectPath) | ||
44 | { | ||
45 | return "/CAPS/" + capsKey + "0000/"; | ||
46 | } | ||
47 | |||
38 | public static string GetRandomCapsPath() | 48 | public static string GetRandomCapsPath() |
39 | { | 49 | { |
40 | UUID caps = UUID.Random(); | 50 | UUID caps = UUID.Random(); |
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index a6e0947..deff45e 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs | |||
@@ -309,9 +309,8 @@ namespace OpenSim.Grid.UserServer | |||
309 | response.RegionX = regionInfo.regionLocX; | 309 | response.RegionX = regionInfo.regionLocX; |
310 | response.RegionY = regionInfo.regionLocY; | 310 | response.RegionY = regionInfo.regionLocY; |
311 | 311 | ||
312 | //Not sure if the + "/CAPS/" should in fact be +"CAPS/" depending if there is already a / as part of httpServerURI | ||
313 | string capsPath = CapsUtil.GetRandomCapsPath(); | 312 | string capsPath = CapsUtil.GetRandomCapsPath(); |
314 | response.SeedCapability = regionInfo.httpServerURI + "CAPS/" + capsPath + "0000/"; | 313 | response.SeedCapability = regionInfo.httpServerURI + CapsUtil.GetCapsSeedPath(capsPath); |
315 | 314 | ||
316 | // Notify the target of an incoming user | 315 | // Notify the target of an incoming user |
317 | m_log.InfoFormat( | 316 | m_log.InfoFormat( |
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index f3f3434..8a805df 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs | |||
@@ -297,20 +297,21 @@ namespace OpenSim.Region.Communications.Local | |||
297 | response.RegionY = regionInfo.RegionLocY; | 297 | response.RegionY = regionInfo.RegionLocY; |
298 | 298 | ||
299 | string capsPath = CapsUtil.GetRandomCapsPath(); | 299 | string capsPath = CapsUtil.GetRandomCapsPath(); |
300 | string capsSeedPath = CapsUtil.GetCapsSeedPath(capsPath); | ||
300 | 301 | ||
301 | // Don't use the following! It Fails for logging into any region not on the same port as the http server! | 302 | // Don't use the following! It Fails for logging into any region not on the same port as the http server! |
302 | // Kept here so it doesn't happen again! | 303 | // Kept here so it doesn't happen again! |
303 | // response.SeedCapability = regionInfo.ServerURI + "/CAPS/" + capsPath + "0000/"; | 304 | // response.SeedCapability = regionInfo.ServerURI + capsSeedPath; |
304 | 305 | ||
305 | string seedcap = "http://"; | 306 | string seedcap = "http://"; |
306 | 307 | ||
307 | if (serversInfo.HttpUsesSSL) | 308 | if (serversInfo.HttpUsesSSL) |
308 | { | 309 | { |
309 | seedcap = "https://" + serversInfo.HttpSSLCN + ":" + serversInfo.httpSSLPort + "/CAPS/" + capsPath + "0000/"; | 310 | seedcap = "https://" + serversInfo.HttpSSLCN + ":" + serversInfo.httpSSLPort + capsSeedPath; |
310 | } | 311 | } |
311 | else | 312 | else |
312 | { | 313 | { |
313 | seedcap = "http://" + regionInfo.ExternalHostName + ":" + serversInfo.HttpListenerPort + "/CAPS/" + capsPath + "0000/"; | 314 | seedcap = "http://" + regionInfo.ExternalHostName + ":" + serversInfo.HttpListenerPort + capsSeedPath; |
314 | } | 315 | } |
315 | 316 | ||
316 | response.SeedCapability = seedcap; | 317 | response.SeedCapability = seedcap; |
diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs index 75755cb..a03bae3 100644 --- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs | |||
@@ -576,10 +576,14 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
576 | } | 576 | } |
577 | 577 | ||
578 | // DEPRECIATED | 578 | // DEPRECIATED |
579 | responseMap["seed_capability"] = OSD.FromString(regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); | 579 | responseMap["seed_capability"] |
580 | = OSD.FromString( | ||
581 | regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath)); | ||
580 | 582 | ||
581 | // REPLACEMENT | 583 | // REPLACEMENT |
582 | responseMap["region_seed_capability"] = OSD.FromString(regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); | 584 | responseMap["region_seed_capability"] |
585 | = OSD.FromString( | ||
586 | regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + CapsUtil.GetCapsSeedPath(userCap.CapsObjectPath)); | ||
583 | 587 | ||
584 | responseMap["rez_avatar"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); | 588 | responseMap["rez_avatar"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); |
585 | responseMap["rez_avatar/rez"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); | 589 | responseMap["rez_avatar/rez"] = OSD.FromString(rezHttpProtocol + httpaddr + ":" + urlport + rezAvatarPath); |
diff --git a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs index b793de1..14e0a15 100644 --- a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs | |||
@@ -210,10 +210,12 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
210 | 210 | ||
211 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY) || isHyperLink) | 211 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY) || isHyperLink) |
212 | { | 212 | { |
213 | // TODO Should construct this behind a method | 213 | capsPath |
214 | capsPath = | 214 | = "http://" |
215 | "http://" + reg.ExternalHostName + ":" + reg.HttpPort | 215 | + reg.ExternalHostName |
216 | + "/CAPS/" + agentCircuit.CapsPath + "0000/"; | 216 | + ":" |
217 | + reg.HttpPort | ||
218 | + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | ||
217 | 219 | ||
218 | if (eq != null) | 220 | if (eq != null) |
219 | { | 221 | { |
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 82b9d89..7f56e71 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | |||
@@ -801,10 +801,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
801 | 801 | ||
802 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) | 802 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) |
803 | { | 803 | { |
804 | // TODO Should construct this behind a method | 804 | capsPath |
805 | capsPath = | 805 | = "http://" |
806 | "http://" + reg.ExternalHostName + ":" + reg.HttpPort | 806 | + reg.ExternalHostName |
807 | + "/CAPS/" + agentCircuit.CapsPath + "0000/"; | 807 | + ":" |
808 | + reg.HttpPort | ||
809 | + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | ||
808 | 810 | ||
809 | if (eq != null) | 811 | if (eq != null) |
810 | { | 812 | { |