From 903cfa8c7ee73e7cd3fa8dc06c0b7ac8ac48cbad Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 7 Aug 2010 22:28:42 +0100 Subject: [PATCH 1/7] minor: Remove overly verbose schedule full update log message for attachments --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index e26e4aef14..a2c3c074cf 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -2001,8 +2001,8 @@ namespace OpenSim.Region.Framework.Scenes /// public void ScheduleGroupForFullUpdate() { - if (IsAttachment) - m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId); +// if (IsAttachment) +// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId); checkAtTargets(); RootPart.ScheduleFullUpdate(); From ab5a461c5c2307bdef6924492eae76b6bbd86f62 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 7 Aug 2010 22:24:17 +0100 Subject: [PATCH 2/7] Add search URL to Login Service --- .../Services/LLLoginService/LLLoginResponse.cs | 18 +++++++++++++++++- .../Services/LLLoginService/LLLoginService.cs | 4 +++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index 336692225d..a01ea1e4c0 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs @@ -173,6 +173,8 @@ namespace OpenSim.Services.LLLoginService // Web map private string mapTileURL; + private string searchURL; + // Error Flags private string errorReason; private string errorMessage; @@ -221,7 +223,7 @@ namespace OpenSim.Services.LLLoginService public LLLoginResponse(UserAccount account, AgentCircuitData aCircuit, GridUserInfo pinfo, GridRegion destination, List invSkel, FriendInfo[] friendsList, ILibraryService libService, string where, string startlocation, Vector3 position, Vector3 lookAt, List gestures, string message, - GridRegion home, IPEndPoint clientIP, string mapTileURL) + GridRegion home, IPEndPoint clientIP, string mapTileURL, string searchURL) : this() { FillOutInventoryData(invSkel, libService); @@ -238,6 +240,7 @@ namespace OpenSim.Services.LLLoginService BuddList = ConvertFriendListItem(friendsList); StartLocation = where; MapTileURL = mapTileURL; + SearchURL = searchURL; FillOutHomeData(pinfo, home); LookAt = String.Format("[r{0},r{1},r{2}]", lookAt.X, lookAt.Y, lookAt.Z); @@ -410,6 +413,7 @@ namespace OpenSim.Services.LLLoginService InitialOutfitHash["gender"] = "female"; initialOutfit.Add(InitialOutfitHash); mapTileURL = String.Empty; + searchURL = String.Empty; } @@ -473,6 +477,9 @@ namespace OpenSim.Services.LLLoginService responseData["region_x"] = (Int32)(RegionX); responseData["region_y"] = (Int32)(RegionY); + if (searchURL != String.Empty) + responseData["search"] = searchURL; + if (mapTileURL != String.Empty) responseData["map-server-url"] = mapTileURL; @@ -575,6 +582,9 @@ namespace OpenSim.Services.LLLoginService if (mapTileURL != String.Empty) map["map-server-url"] = OSD.FromString(mapTileURL); + if (searchURL != String.Empty) + map["search"] = OSD.FromString(searchURL); + if (m_buddyList != null) { map["buddy-list"] = ArrayListToOSDArray(m_buddyList.ToArray()); @@ -932,6 +942,12 @@ namespace OpenSim.Services.LLLoginService set { mapTileURL = value; } } + public string SearchURL + { + get { return searchURL; } + set { searchURL = value; } + } + public string Message { get { return welcomeMessage; } diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 036bec623b..f942070e0f 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -74,6 +74,7 @@ namespace OpenSim.Services.LLLoginService protected string m_GatekeeperURL; protected bool m_AllowRemoteSetLoginLevel; protected string m_MapTileURL; + protected string m_SearchURL; IConfig m_LoginServerConfig; @@ -102,6 +103,7 @@ namespace OpenSim.Services.LLLoginService m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0); m_GatekeeperURL = m_LoginServerConfig.GetString("GatekeeperURI", string.Empty); m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty); + m_SearchURL = m_LoginServerConfig.GetString("SearchURL", string.Empty); // These are required; the others aren't if (accountService == string.Empty || authService == string.Empty) @@ -358,7 +360,7 @@ namespace OpenSim.Services.LLLoginService // Finally, fill out the response and return it // LLLoginResponse response = new LLLoginResponse(account, aCircuit, guinfo, destination, inventorySkel, friendsList, m_LibraryService, - where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL); + where, startLocation, position, lookAt, gestures, m_WelcomeMessage, home, clientIP, m_MapTileURL, m_SearchURL); m_log.DebugFormat("[LLOGIN SERVICE]: All clear. Sending login response to client."); return response; From cd2c7b9ac983aea6674cd6f89797c5e76287b74e Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 8 Aug 2010 01:57:02 +0100 Subject: [PATCH 3/7] In my crusade against facelights, I am striking the killing blow. Add a DisableFacelights option to OpenSim.ini to finally kill those immersion- breaking, silly vanity lights that destroy nighttime RP. Girls, you look just fine without them. Guys, you too. Thank you. Melanie has left the building. --- .../ClientStack/LindenUDP/LLClientView.cs | 21 +++++++++++++++++++ .../ClientStack/LindenUDP/LLUDPServer.cs | 5 +++++ bin/OpenSim.ini.example | 7 +++++++ 3 files changed, 33 insertions(+) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 7bf7511da6..df2690ee2b 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -314,6 +314,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP private int m_cachedTextureSerial; private PriorityQueue m_entityUpdates; private Prioritizer m_prioritizer; + private bool m_disableFacelights = false; /// /// List used in construction of data blocks for an object update packet. This is to stop us having to @@ -407,6 +408,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP set { m_IsLoggingOut = value; } } + public bool DisableFacelights + { + get { return m_disableFacelights; } + set { m_disableFacelights = value; } + } + public bool SendLogoutPacketWhenClosing { set { m_SendLogoutPacketWhenClosing = value; } } #endregion Properties @@ -3487,6 +3494,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP EntityUpdate update; while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update)) { + if (update.Entity is SceneObjectPart) + { + SceneObjectPart part = (SceneObjectPart)update.Entity; + + if (part.ParentGroup.IsAttachment && m_disableFacelights) + { + if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand && + part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.RightHand) + { + part.Shape.LightEntry = false; + } + } + } + ++updatesThisCall; #region UpdateFlags to packet type conversion diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 1b81105248..ca5a297f19 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -153,6 +153,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP private int m_defaultRTO = 0; private int m_maxRTO = 0; + private bool m_disableFacelights = false; + public Socket Server { get { return null; } } public LLUDPServer(IPAddress listenIP, ref uint port, int proxyPortOffsetParm, bool allow_alternate_port, IConfigSource configSource, AgentCircuitManager circuitManager) @@ -190,6 +192,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_defaultRTO = config.GetInt("DefaultRTO", 0); m_maxRTO = config.GetInt("MaxRTO", 0); + m_disableFacelights = config.GetBoolean("DisableFacelights", false); } else { @@ -898,6 +901,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP LLClientView client = new LLClientView(remoteEndPoint, m_scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode); client.OnLogout += LogoutHandler; + client.DisableFacelights = m_disableFacelights; + // Start the IClientAPI client.Start(); } diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 54c013a769..3dc8f23a5e 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -387,6 +387,13 @@ ; ;TextureSendLimit = 20 + ; Quash and remove any light properties from attachments not on the + ; hands. This allows flashlights and lanterns to function, but kills + ; silly vanity "Facelights" dead. Sorry, head mounted miner's lamps + ; will also be affected. + ; + ;DisableFacelights = "false" + [Chat] ; Controls whether the chat module is enabled. Default is true. enabled = true; From 1f25b9e8dbf500d22df55fa2a8f7f9b7bf873aa3 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 8 Aug 2010 17:51:43 +0200 Subject: [PATCH 4/7] Thank you, Marck00, for a patch that implemented region distance sorting for fallback regions. Applied with changes. --- OpenSim/Data/IRegionData.cs | 22 ++++++++++++++++++++++ OpenSim/Data/MSSQL/MSSQLRegionData.cs | 7 +++++-- OpenSim/Data/MySQL/MySQLRegionData.cs | 6 ++++-- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs index 42533c6668..46dc4fbe8a 100644 --- a/OpenSim/Data/IRegionData.cs +++ b/OpenSim/Data/IRegionData.cs @@ -79,4 +79,26 @@ namespace OpenSim.Data Authenticate = 256, // Require authentication Hyperlink = 512 // Record represents a HG link } + + public class RegionDataDistanceCompare : IComparer + { + private Vector2 m_origin; + + public RegionDataDistanceCompare(int x, int y) + { + m_origin = new Vector2(x, y); + } + + public int Compare(RegionData regionA, RegionData regionB) + { + Vector2 vectorA = new Vector2(regionA.posX, regionA.posY); + Vector2 vectorB = new Vector2(regionB.posX, regionB.posY); + return Math.Sign(VectorDistance(m_origin, vectorA) - VectorDistance(m_origin, vectorB)); + } + + private float VectorDistance(Vector2 x, Vector2 y) + { + return (x - y).Length(); + } + } } diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs index 9656be14a9..cdf8ec09fb 100644 --- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs @@ -315,8 +315,11 @@ namespace OpenSim.Data.MSSQL public List GetFallbackRegions(UUID scopeID, int x, int y) { - // TODO: distance-sort results - return Get((int)RegionFlags.FallbackRegion, scopeID); + List regions = Get((int)RegionFlags.FallbackRegion, scopeID); + RegionDataDistanceCompare distanceComparer = new RegionDataDistanceCompare(x, y); + regions.Sort(distanceComparer); + + return regions; } public List GetHyperlinks(UUID scopeID) diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index aec37e2bbd..878b8e8056 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs @@ -289,8 +289,10 @@ namespace OpenSim.Data.MySQL public List GetFallbackRegions(UUID scopeID, int x, int y) { - // TODO: distance-sort results - return Get((int)RegionFlags.FallbackRegion, scopeID); + List regions = Get((int)RegionFlags.FallbackRegion, scopeID); + RegionDataDistanceCompare distanceComparer = new RegionDataDistanceCompare(x, y); + regions.Sort(distanceComparer); + return regions; } public List GetHyperlinks(UUID scopeID) From 1314c87f36edd78f5070cc50f5b705b721c9196d Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 8 Aug 2010 09:50:03 -0700 Subject: [PATCH 5/7] Enabled GridInfoServiceInConnector for standalones. --- bin/config-include/Standalone.ini | 1 + .../StandaloneCommon.ini.example | 44 +++++++++++++++++++ bin/config-include/StandaloneHypergrid.ini | 1 + 3 files changed, 46 insertions(+) diff --git a/bin/config-include/Standalone.ini b/bin/config-include/Standalone.ini index 6b7dc50b7f..eae98016d3 100644 --- a/bin/config-include/Standalone.ini +++ b/bin/config-include/Standalone.ini @@ -20,6 +20,7 @@ LibraryModule = true LLLoginServiceInConnector = true + GridInfoServiceInConnector = true [AssetService] LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService" diff --git a/bin/config-include/StandaloneCommon.ini.example b/bin/config-include/StandaloneCommon.ini.example index 9d1c884dfa..f86296087b 100644 --- a/bin/config-include/StandaloneCommon.ini.example +++ b/bin/config-include/StandaloneCommon.ini.example @@ -76,3 +76,47 @@ ; If false, HG TPs happen only to the Default regions specified in [GridService] section AllowTeleportsToAnyRegion = true +[GridInfoService] + ; These settings are used to return information on a get_grid_info call. + ; Client launcher scripts and third-party clients make use of this to + ; autoconfigure the client and to provide a nice user experience. If you + ; want to facilitate that, you should configure the settings here according + ; to your grid or standalone setup. + ; + ; See http://opensimulator.org/wiki/GridInfo + + ; login uri: for grid this is the login server URI + login = http://127.0.0.1:9000/ + + ; long grid name: the long name of your grid + gridname = "the lost continent of hippo" + + ; short grid name: the short name of your grid + gridnick = "hippogrid" + + ; login page: optional: if it exists it will be used to tell the client to use + ; this as splash page + ; currently unused + ;welcome = http://127.0.0.1/welcome + + ; helper uri: optional: if it exists if will be used to tell the client to use + ; this for all economy related things + ; currently unused + ;economy = http://127.0.0.1:9000/ + + ; web page of grid: optional: page providing further information about your grid + ; currently unused + ;about = http://127.0.0.1/about/ + + ; account creation: optional: page providing further information about obtaining + ; a user account on your grid + ; currently unused + ;register = http://127.0.0.1/register + + ; help: optional: page providing further assistance for users of your grid + ; currently unused + ;help = http://127.0.0.1/help + + ; password help: optional: page providing password assistance for users of your grid + ; currently unused + ;password = http://127.0.0.1/password diff --git a/bin/config-include/StandaloneHypergrid.ini b/bin/config-include/StandaloneHypergrid.ini index 35e7da26ed..317af4ba1d 100644 --- a/bin/config-include/StandaloneHypergrid.ini +++ b/bin/config-include/StandaloneHypergrid.ini @@ -27,6 +27,7 @@ NeighbourServiceInConnector = true LibraryModule = true LLLoginServiceInConnector = true + GridInfoServiceInConnector = true AuthenticationServiceInConnector = true SimulationServiceInConnector = true From f216fd8136c1db278bb29f78af4b103ab114f0d4 Mon Sep 17 00:00:00 2001 From: Marck Date: Sun, 8 Aug 2010 12:37:21 +0200 Subject: [PATCH 6/7] Tests for distance-sorted fallback regions. With some extensions to existing grid service tests. --- .../Grid/Tests/GridConnectorsTests.cs | 64 +++++++++++++++++-- 1 file changed, 57 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs index 2726ae8997..ebfba2b83a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs @@ -57,6 +57,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests config.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector"); config.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService"); config.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); + config.Configs["GridService"].Set("Region_Test_Region_1", "DefaultRegion"); + config.Configs["GridService"].Set("Region_Test_Region_2", "FallbackRegion"); + config.Configs["GridService"].Set("Region_Test_Region_3", "FallbackRegion"); + config.Configs["GridService"].Set("Region_Other_Region_4", "FallbackRegion"); m_LocalConnector = new LocalGridServicesConnector(config); } @@ -69,7 +73,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests { SetUp(); - // Create 3 regions + // Create 4 regions GridRegion r1 = new GridRegion(); r1.RegionName = "Test Region 1"; r1.RegionID = new UUID(1); @@ -82,7 +86,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests s.RegionInfo.RegionID = r1.RegionID; m_LocalConnector.AddRegion(s); - GridRegion r2 = new GridRegion(); r2.RegionName = "Test Region 2"; r2.RegionID = new UUID(2); @@ -107,11 +110,28 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests s.RegionInfo.RegionID = r3.RegionID; m_LocalConnector.AddRegion(s); + GridRegion r4 = new GridRegion(); + r4.RegionName = "Other Region 4"; + r4.RegionID = new UUID(4); + r4.RegionLocX = 1004 * (int)Constants.RegionSize; + r4.RegionLocY = 1002 * (int)Constants.RegionSize; + r4.ExternalHostName = "127.0.0.1"; + r4.HttpPort = 9004; + r4.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); + s = new Scene(new RegionInfo()); + s.RegionInfo.RegionID = r4.RegionID; + m_LocalConnector.AddRegion(s); + m_LocalConnector.RegisterRegion(UUID.Zero, r1); + GridRegion result = m_LocalConnector.GetRegionByName(UUID.Zero, "Test"); Assert.IsNotNull(result, "Retrieved GetRegionByName is null"); Assert.That(result.RegionName, Is.EqualTo("Test Region 1"), "Retrieved region's name does not match"); + m_LocalConnector.RegisterRegion(UUID.Zero, r2); + m_LocalConnector.RegisterRegion(UUID.Zero, r3); + m_LocalConnector.RegisterRegion(UUID.Zero, r4); + result = m_LocalConnector.GetRegionByUUID(UUID.Zero, new UUID(1)); Assert.IsNotNull(result, "Retrieved GetRegionByUUID is null"); Assert.That(result.RegionID, Is.EqualTo(new UUID(1)), "Retrieved region's UUID does not match"); @@ -120,23 +140,53 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests Assert.IsNotNull(result, "Retrieved GetRegionByPosition is null"); Assert.That(result.RegionLocX, Is.EqualTo(1000 * (int)Constants.RegionSize), "Retrieved region's position does not match"); - m_LocalConnector.RegisterRegion(UUID.Zero, r2); - m_LocalConnector.RegisterRegion(UUID.Zero, r3); - List results = m_LocalConnector.GetNeighbours(UUID.Zero, new UUID(1)); Assert.IsNotNull(results, "Retrieved neighbours list is null"); Assert.That(results.Count, Is.EqualTo(1), "Retrieved neighbour collection is greater than expected"); Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved region's UUID does not match"); results = m_LocalConnector.GetRegionsByName(UUID.Zero, "Test", 10); - Assert.IsNotNull(results, "Retrieved GetRegionsByName list is null"); + Assert.IsNotNull(results, "Retrieved GetRegionsByName collection is null"); Assert.That(results.Count, Is.EqualTo(3), "Retrieved neighbour collection is less than expected"); results = m_LocalConnector.GetRegionRange(UUID.Zero, 900 * (int)Constants.RegionSize, 1002 * (int)Constants.RegionSize, 900 * (int)Constants.RegionSize, 1100 * (int)Constants.RegionSize); - Assert.IsNotNull(results, "Retrieved GetRegionRange list is null"); + Assert.IsNotNull(results, "Retrieved GetRegionRange collection is null"); Assert.That(results.Count, Is.EqualTo(2), "Retrieved neighbour collection is not the number expected"); + results = m_LocalConnector.GetDefaultRegions(UUID.Zero); + Assert.IsNotNull(results, "Retrieved GetDefaultRegions collection is null"); + Assert.That(results.Count, Is.EqualTo(1), "Retrieved default regions collection has not the expected size"); + Assert.That(results[0].RegionID, Is.EqualTo(new UUID(1)), "Retrieved default region's UUID does not match"); + + results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r1.RegionLocX, r1.RegionLocY); + Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 1 is null"); + Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 1 has not the expected size"); + Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions for default region are not in the expected order 2-4-3"); + Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions for default region are not in the expected order 2-4-3"); + Assert.That(results[2].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions for default region are not in the expected order 2-4-3"); + + results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r2.RegionLocX, r2.RegionLocY); + Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 2 is null"); + Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 2 has not the expected size"); + Assert.That(results[0].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 2-4-3"); + Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 2-4-3"); + Assert.That(results[2].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 2-4-3"); + + results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r3.RegionLocX, r3.RegionLocY); + Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 3 is null"); + Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 3 has not the expected size"); + Assert.That(results[0].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 3-4-2"); + Assert.That(results[1].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 3-4-2"); + Assert.That(results[2].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 3-4-2"); + + results = m_LocalConnector.GetFallbackRegions(UUID.Zero, r4.RegionLocX, r4.RegionLocY); + Assert.IsNotNull(results, "Retrieved GetFallbackRegions collection for region 4 is null"); + Assert.That(results.Count, Is.EqualTo(3), "Retrieved fallback regions collection for region 4 has not the expected size"); + Assert.That(results[0].RegionID, Is.EqualTo(new UUID(4)), "Retrieved fallback regions are not in the expected order 4-3-2"); + Assert.That(results[1].RegionID, Is.EqualTo(new UUID(3)), "Retrieved fallback regions are not in the expected order 4-3-2"); + Assert.That(results[2].RegionID, Is.EqualTo(new UUID(2)), "Retrieved fallback regions are not in the expected order 4-3-2"); + results = m_LocalConnector.GetHyperlinks(UUID.Zero); Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null"); Assert.That(results.Count, Is.EqualTo(0), "Retrieved linked regions collection is not the number expected"); From a5e4a2bb3ba72470c774871f9ca739434c10c64a Mon Sep 17 00:00:00 2001 From: Melanie Date: Sun, 8 Aug 2010 18:18:42 +0100 Subject: [PATCH 7/7] Add distance sort for null, too --- OpenSim/Data/Null/NullRegionData.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenSim/Data/Null/NullRegionData.cs b/OpenSim/Data/Null/NullRegionData.cs index f276d10657..2065355890 100644 --- a/OpenSim/Data/Null/NullRegionData.cs +++ b/OpenSim/Data/Null/NullRegionData.cs @@ -169,7 +169,10 @@ namespace OpenSim.Data.Null public List GetFallbackRegions(UUID scopeID, int x, int y) { - return Get((int)RegionFlags.FallbackRegion, scopeID); + List regions = Get((int)RegionFlags.FallbackRegion, scopeID); + RegionDataDistanceCompare distanceComparer = new RegionDataDistanceCompare(x, y); + regions.Sort(distanceComparer); + return regions; } public List GetHyperlinks(UUID scopeID) @@ -193,4 +196,4 @@ namespace OpenSim.Data.Null return ret; } } -} \ No newline at end of file +}