diff options
author | Justin Clarke Casey | 2009-01-06 17:27:04 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-01-06 17:27:04 +0000 |
commit | b1c2cb3d8206b845a26fe04371dc1a1a6b2cbec2 (patch) | |
tree | a8b3e4dc31294e0d9507dcdbd0bfae5e1a42145c | |
parent | * Remove unused CAPSService (diff) | |
download | opensim-SC-b1c2cb3d8206b845a26fe04371dc1a1a6b2cbec2.zip opensim-SC-b1c2cb3d8206b845a26fe04371dc1a1a6b2cbec2.tar.gz opensim-SC-b1c2cb3d8206b845a26fe04371dc1a1a6b2cbec2.tar.bz2 opensim-SC-b1c2cb3d8206b845a26fe04371dc1a1a6b2cbec2.tar.xz |
* minor: Move GetRandomCapsPath() to a CapsUtil class
Diffstat (limited to '')
6 files changed, 22 insertions, 31 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 396996a..8e7eac7 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -334,14 +334,6 @@ namespace OpenSim.Framework | |||
334 | return sb.ToString(); | 334 | return sb.ToString(); |
335 | } | 335 | } |
336 | 336 | ||
337 | public static string GetRandomCapsPath() | ||
338 | { | ||
339 | UUID caps = UUID.Random(); | ||
340 | string capsPath = caps.ToString(); | ||
341 | capsPath = capsPath.Remove(capsPath.Length - 4, 4); | ||
342 | return capsPath; | ||
343 | } | ||
344 | |||
345 | public static int fast_distance2d(int x, int y) | 337 | public static int fast_distance2d(int x, int y) |
346 | { | 338 | { |
347 | x = Math.Abs(x); | 339 | x = Math.Abs(x); |
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index 4819337..a6e0947 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs | |||
@@ -37,6 +37,7 @@ using OpenSim.Data; | |||
37 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Communications; | 38 | using OpenSim.Framework.Communications; |
39 | using OpenSim.Framework.Communications.Cache; | 39 | using OpenSim.Framework.Communications.Cache; |
40 | using OpenSim.Framework.Communications.Capabilities; | ||
40 | 41 | ||
41 | namespace OpenSim.Grid.UserServer | 42 | namespace OpenSim.Grid.UserServer |
42 | { | 43 | { |
@@ -309,7 +310,7 @@ namespace OpenSim.Grid.UserServer | |||
309 | response.RegionY = regionInfo.regionLocY; | 310 | response.RegionY = regionInfo.regionLocY; |
310 | 311 | ||
311 | //Not sure if the + "/CAPS/" should in fact be +"CAPS/" depending if there is already a / as part of httpServerURI | 312 | //Not sure if the + "/CAPS/" should in fact be +"CAPS/" depending if there is already a / as part of httpServerURI |
312 | string capsPath = Util.GetRandomCapsPath(); | 313 | string capsPath = CapsUtil.GetRandomCapsPath(); |
313 | response.SeedCapability = regionInfo.httpServerURI + "CAPS/" + capsPath + "0000/"; | 314 | response.SeedCapability = regionInfo.httpServerURI + "CAPS/" + capsPath + "0000/"; |
314 | 315 | ||
315 | // Notify the target of an incoming user | 316 | // Notify the target of an incoming user |
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index e68398b..f3f3434 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs | |||
@@ -35,6 +35,7 @@ using log4net; | |||
35 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Communications; | 36 | using OpenSim.Framework.Communications; |
37 | using OpenSim.Framework.Communications.Cache; | 37 | using OpenSim.Framework.Communications.Cache; |
38 | using OpenSim.Framework.Communications.Capabilities; | ||
38 | 39 | ||
39 | namespace OpenSim.Region.Communications.Local | 40 | namespace OpenSim.Region.Communications.Local |
40 | { | 41 | { |
@@ -295,7 +296,7 @@ namespace OpenSim.Region.Communications.Local | |||
295 | response.RegionX = regionInfo.RegionLocX; | 296 | response.RegionX = regionInfo.RegionLocX; |
296 | response.RegionY = regionInfo.RegionLocY; | 297 | response.RegionY = regionInfo.RegionLocY; |
297 | 298 | ||
298 | string capsPath = Util.GetRandomCapsPath(); | 299 | string capsPath = CapsUtil.GetRandomCapsPath(); |
299 | 300 | ||
300 | // Don't use the following! It Fails for logging into any region not on the same port as the http server! | 301 | // Don't use the following! It Fails for logging into any region not on the same port as the http server! |
301 | // Kept here so it doesn't happen again! | 302 | // Kept here so it doesn't happen again! |
diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs index 8534b56..75755cb 100644 --- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs | |||
@@ -42,6 +42,7 @@ using OpenMetaverse.Packets; | |||
42 | using log4net; | 42 | using log4net; |
43 | using Nini.Config; | 43 | using Nini.Config; |
44 | using OpenSim.Framework; | 44 | using OpenSim.Framework; |
45 | using OpenSim.Framework.Communications.Capabilities; | ||
45 | using OpenSim.Framework.Servers; | 46 | using OpenSim.Framework.Servers; |
46 | using OpenSim.Region.Environment.Interfaces; | 47 | using OpenSim.Region.Environment.Interfaces; |
47 | using OpenSim.Region.Environment.Scenes; | 48 | using OpenSim.Region.Environment.Scenes; |
@@ -377,7 +378,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
377 | */ | 378 | */ |
378 | } | 379 | } |
379 | 380 | ||
380 | |||
381 | public OSD RequestRezAvatarMethod(string path, OSD request) | 381 | public OSD RequestRezAvatarMethod(string path, OSD request) |
382 | { | 382 | { |
383 | //System.Console.WriteLine("[REQUESTREZAVATAR]: " + request.ToString()); | 383 | //System.Console.WriteLine("[REQUESTREZAVATAR]: " + request.ToString()); |
@@ -468,28 +468,28 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
468 | // Generate a dummy agent for the user so we can get back a CAPS path | 468 | // Generate a dummy agent for the user so we can get back a CAPS path |
469 | AgentCircuitData agentData = new AgentCircuitData(); | 469 | AgentCircuitData agentData = new AgentCircuitData(); |
470 | agentData.AgentID = LocalAgentID; | 470 | agentData.AgentID = LocalAgentID; |
471 | agentData.BaseFolder=UUID.Zero; | 471 | agentData.BaseFolder = UUID.Zero; |
472 | agentData.CapsPath=Util.GetRandomCapsPath(); | 472 | agentData.CapsPath = CapsUtil.GetRandomCapsPath(); |
473 | agentData.child = false; | 473 | agentData.child = false; |
474 | agentData.circuitcode = (uint)(Util.RandomClass.Next()); | 474 | agentData.circuitcode = (uint)(Util.RandomClass.Next()); |
475 | agentData.firstname = FirstName; | 475 | agentData.firstname = FirstName; |
476 | agentData.lastname = LastName; | 476 | agentData.lastname = LastName; |
477 | agentData.SecureSessionID=UUID.Random(); | 477 | agentData.SecureSessionID = UUID.Random(); |
478 | agentData.SessionID=UUID.Random(); | 478 | agentData.SessionID = UUID.Random(); |
479 | agentData.startpos = new Vector3(128f, 128f, 100f); | 479 | agentData.startpos = new Vector3(128f, 128f, 100f); |
480 | 480 | ||
481 | // Pre-Fill our region cache with information on the agent. | 481 | // Pre-Fill our region cache with information on the agent. |
482 | UserAgentData useragent = new UserAgentData(); | 482 | UserAgentData useragent = new UserAgentData(); |
483 | useragent.AgentIP="unknown"; | 483 | useragent.AgentIP = "unknown"; |
484 | useragent.AgentOnline=true; | 484 | useragent.AgentOnline = true; |
485 | useragent.AgentPort = (uint)0; | 485 | useragent.AgentPort = (uint)0; |
486 | useragent.Handle = regionhandle; | 486 | useragent.Handle = regionhandle; |
487 | useragent.InitialRegion = reg.originRegionID; | 487 | useragent.InitialRegion = reg.originRegionID; |
488 | useragent.LoginTime=Util.UnixTimeSinceEpoch(); | 488 | useragent.LoginTime = Util.UnixTimeSinceEpoch(); |
489 | useragent.LogoutTime = 0; | 489 | useragent.LogoutTime = 0; |
490 | useragent.Position=agentData.startpos; | 490 | useragent.Position = agentData.startpos; |
491 | useragent.Region=reg.originRegionID; | 491 | useragent.Region = reg.originRegionID; |
492 | useragent.SecureSessionID=agentData.SecureSessionID; | 492 | useragent.SecureSessionID = agentData.SecureSessionID; |
493 | useragent.SessionID = agentData.SessionID; | 493 | useragent.SessionID = agentData.SessionID; |
494 | 494 | ||
495 | UserProfileData userProfile = new UserProfileData(); | 495 | UserProfileData userProfile = new UserProfileData(); |
@@ -565,7 +565,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
565 | string httpaddr = reg.ExternalHostName; | 565 | string httpaddr = reg.ExternalHostName; |
566 | string urlport = reg.HttpPort.ToString(); | 566 | string urlport = reg.HttpPort.ToString(); |
567 | 567 | ||
568 | |||
569 | if (httpSSL) | 568 | if (httpSSL) |
570 | { | 569 | { |
571 | rezHttpProtocol = "https://"; | 570 | rezHttpProtocol = "https://"; |
@@ -576,8 +575,6 @@ namespace OpenSim.Region.Environment.Modules.InterGrid | |||
576 | httpaddr = httpsCN; | 575 | httpaddr = httpsCN; |
577 | } | 576 | } |
578 | 577 | ||
579 | |||
580 | |||
581 | // DEPRECIATED | 578 | // DEPRECIATED |
582 | responseMap["seed_capability"] = OSD.FromString(regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); | 579 | responseMap["seed_capability"] = OSD.FromString(regionCapsHttpProtocol + httpaddr + ":" + reg.HttpPort + "/CAPS/" + userCap.CapsObjectPath + "0000/"); |
583 | 580 | ||
diff --git a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs index c53605f..b793de1 100644 --- a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs | |||
@@ -31,17 +31,16 @@ using System.Collections.Generic; | |||
31 | using System.Net; | 31 | using System.Net; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Threading; | 33 | using System.Threading; |
34 | |||
35 | using OpenMetaverse; | ||
36 | |||
37 | using log4net; | 34 | using log4net; |
35 | using OpenMetaverse; | ||
36 | using OSD = OpenMetaverse.StructuredData.OSD; | ||
38 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
39 | using OpenSim.Framework.Communications; | 38 | using OpenSim.Framework.Communications; |
40 | using OpenSim.Framework.Communications.Cache; | 39 | using OpenSim.Framework.Communications.Cache; |
40 | using OpenSim.Framework.Communications.Capabilities; | ||
41 | using OpenSim.Region.Environment.Scenes; | 41 | using OpenSim.Region.Environment.Scenes; |
42 | using OpenSim.Region.Environment; | 42 | using OpenSim.Region.Environment; |
43 | using OpenSim.Region.Interfaces; | 43 | using OpenSim.Region.Interfaces; |
44 | using OSD = OpenMetaverse.StructuredData.OSD; | ||
45 | 44 | ||
46 | namespace OpenSim.Region.Environment.Scenes.Hypergrid | 45 | namespace OpenSim.Region.Environment.Scenes.Hypergrid |
47 | { | 46 | { |
@@ -189,7 +188,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
189 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) | 188 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) |
190 | { | 189 | { |
191 | // brand new agent, let's create a new caps seed | 190 | // brand new agent, let's create a new caps seed |
192 | agentCircuit.CapsPath = Util.GetRandomCapsPath(); | 191 | agentCircuit.CapsPath = CapsUtil.GetRandomCapsPath(); |
193 | } | 192 | } |
194 | 193 | ||
195 | //if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agentCircuit)) | 194 | //if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agentCircuit)) |
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 9282f14..82b9d89 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs | |||
@@ -36,6 +36,7 @@ using log4net; | |||
36 | using OpenSim.Region.Environment.Interfaces; | 36 | using OpenSim.Region.Environment.Interfaces; |
37 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
38 | using OpenSim.Framework.Communications; | 38 | using OpenSim.Framework.Communications; |
39 | using OpenSim.Framework.Communications.Capabilities; | ||
39 | using OpenSim.Region.Interfaces; | 40 | using OpenSim.Region.Interfaces; |
40 | using OSD = OpenMetaverse.StructuredData.OSD; | 41 | using OSD = OpenMetaverse.StructuredData.OSD; |
41 | 42 | ||
@@ -393,7 +394,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
393 | 394 | ||
394 | if (newRegions.Contains(neighbour.RegionHandle)) | 395 | if (newRegions.Contains(neighbour.RegionHandle)) |
395 | { | 396 | { |
396 | agent.CapsPath = Util.GetRandomCapsPath(); | 397 | agent.CapsPath = CapsUtil.GetRandomCapsPath(); |
397 | avatar.AddNeighbourRegion(neighbour.RegionHandle, agent.CapsPath); | 398 | avatar.AddNeighbourRegion(neighbour.RegionHandle, agent.CapsPath); |
398 | seeds.Add(neighbour.RegionHandle, agent.CapsPath); | 399 | seeds.Add(neighbour.RegionHandle, agent.CapsPath); |
399 | } | 400 | } |
@@ -784,7 +785,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
784 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) | 785 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) |
785 | { | 786 | { |
786 | // brand new agent, let's create a new caps seed | 787 | // brand new agent, let's create a new caps seed |
787 | agentCircuit.CapsPath = Util.GetRandomCapsPath(); | 788 | agentCircuit.CapsPath = CapsUtil.GetRandomCapsPath(); |
788 | } | 789 | } |
789 | 790 | ||
790 | // Let's create an agent there if one doesn't exist yet. | 791 | // Let's create an agent there if one doesn't exist yet. |