From 3323413f53fd39cdbba4e247c6a8a63278150b10 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey Date: Wed, 5 Aug 2009 17:17:20 +0100 Subject: reinstate TestReplicateArchivePathToUserInventory() --- .../Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index dd524f5..780327f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -353,7 +353,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests /// /// Test replication of an archive path to the user's inventory. /// - //[Test] + [Test] public void TestReplicateArchivePathToUserInventory() { TestHelper.InMethod(); -- cgit v1.1 From 190bdc8a2e8fa842759087749592769f951834ab Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey Date: Wed, 5 Aug 2009 17:33:23 +0100 Subject: * Remove some mono compiler warnings --- OpenSim/Framework/AvatarAppearance.cs | 3 +-- .../Communications/Tests/LoginServiceTests.cs | 4 +-- .../ClientStack/LindenUDP/LLPacketHandler.cs | 4 +-- .../TextureDownload/UserTextureDownloadService.cs | 29 +++++++++++----------- .../CoreModules/Scripting/LSLHttp/UrlModule.cs | 6 ++--- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 3 ++- .../Shared/Api/Implementation/LSL_Api.cs | 2 +- .../Freeswitch/FreeswitchServerGetHandler.cs | 4 +-- .../FreeswitchService/FreeswitchService.cs | 4 +-- 9 files changed, 28 insertions(+), 31 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 0b9ea42..6a07bc9 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -38,8 +38,7 @@ namespace OpenSim.Framework { public class AvatarAppearance { - private static readonly ILog m_log - = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // these are guessed at by the list here - // http://wiki.secondlife.com/wiki/Avatar_Appearance. We'll diff --git a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs index 4070b49..47e0293 100644 --- a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs +++ b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs @@ -90,8 +90,8 @@ namespace OpenSim.Framework.Communications.Tests TestHelper.InMethod(); // We want to use our own LoginService for this test, one that // doesn't require authentication. - LoginService loginService = new LLStandaloneLoginService((UserManagerBase)m_commsManager.UserService, "Hello folks", new TestInventoryService(), - m_commsManager.NetworkServersInfo, false, new LibraryRootFolder(String.Empty), m_regionConnector); + new LLStandaloneLoginService((UserManagerBase)m_commsManager.UserService, "Hello folks", new TestInventoryService(), + m_commsManager.NetworkServersInfo, false, new LibraryRootFolder(String.Empty), m_regionConnector); Hashtable loginParams = new Hashtable(); loginParams["first"] = m_firstName; diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs index fad9218..eaf8f60 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketHandler.cs @@ -827,9 +827,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP sendbuffer.Length, SocketFlags.None, m_Client.CircuitCode); } } - catch (NullReferenceException n) + catch (NullReferenceException) { - m_log.Debug("[PACKET] Detected reuse of a returned packet"); + m_log.Error("[PACKET]: Detected reuse of a returned packet"); m_PacketQueue.Cancel(item.Sequence); return; } diff --git a/OpenSim/Region/CoreModules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/CoreModules/Agent/TextureDownload/UserTextureDownloadService.cs index 5be2a65..65138e2 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureDownload/UserTextureDownloadService.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureDownload/UserTextureDownloadService.cs @@ -45,8 +45,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload /// public class UserTextureDownloadService { - private static readonly ILog m_log - = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// /// True if the service has been closed, probably because a user with texture requests still queued @@ -88,13 +87,13 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload /// XXX This is really a temporary solution to deal with the situation where a client continually requests /// the same missing textures /// - private readonly IRequestLimitStrategy missingTextureLimitStrategy - = new RepeatLimitStrategy(MAX_ALLOWED_TEXTURE_REQUESTS); +// private readonly IRequestLimitStrategy missingTextureLimitStrategy +// = new RepeatLimitStrategy(MAX_ALLOWED_TEXTURE_REQUESTS); public UserTextureDownloadService( IClientAPI client, Scene scene, OpenSim.Framework.BlockingQueue sharedQueue) { - m_client = client; +// m_client = client; m_scene = scene; m_sharedSendersQueue = sharedQueue; } @@ -231,16 +230,16 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload /// Place a ready texture sender on the processing queue. /// /// - private void EnqueueTextureSender(ITextureSender textureSender) - { - textureSender.Cancel = false; - textureSender.Sending = true; - - if (!m_sharedSendersQueue.Contains(textureSender)) - { - m_sharedSendersQueue.Enqueue(textureSender); - } - } +// private void EnqueueTextureSender(ITextureSender textureSender) +// { +// textureSender.Cancel = false; +// textureSender.Sending = true; +// +// if (!m_sharedSendersQueue.Contains(textureSender)) +// { +// m_sharedSendersQueue.Enqueue(textureSender); +// } +// } /// /// Close this module. diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 7082e85..ad42523 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs @@ -60,9 +60,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp public class UrlModule : ISharedRegionModule, IUrlModule { - private static readonly ILog m_log = - LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = +// LogManager.GetLogger( +// MethodBase.GetCurrentMethod().DeclaringType); private Dictionary m_RequestMap = new Dictionary(); diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 83db396..9805ff5 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -2863,7 +2863,8 @@ namespace OpenSim.Region.Physics.OdePlugin //if ((framecount % m_randomizeWater) == 0) // randomizeWater(waterlevel); - int RayCastTimeMS = m_rayCastManager.ProcessQueuedRequests(); + //int RayCastTimeMS = m_rayCastManager.ProcessQueuedRequests(); + m_rayCastManager.ProcessQueuedRequests(); collision_optimized(timeStep); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index acab734..7f691ba 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -9033,7 +9033,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (m.Success) { for (int i = 1; i < gnums.Length; i++) { System.Text.RegularExpressions.Group g = m.Groups[gnums[i]]; - CaptureCollection cc = g.Captures; + //CaptureCollection cc = g.Captures; } if (m.Groups.Count == 5) { httpHeaders["Authorization"] = String.Format("Basic {0}", Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(m.Groups[2].ToString() + ":" + m.Groups[3].ToString()))); diff --git a/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerGetHandler.cs b/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerGetHandler.cs index c2a64b8..8b41742 100644 --- a/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerGetHandler.cs +++ b/OpenSim/Server/Handlers/Freeswitch/FreeswitchServerGetHandler.cs @@ -46,12 +46,12 @@ namespace OpenSim.Server.Handlers.Freeswitch { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private IFreeswitchService m_FreeswitchService; + //private IFreeswitchService m_FreeswitchService; public FreeswitchServerGetHandler(IFreeswitchService service) : base("GET", "/api") { - m_FreeswitchService = service; + //m_FreeswitchService = service; } public override byte[] Handle(string path, Stream request, diff --git a/OpenSim/Services/FreeswitchService/FreeswitchService.cs b/OpenSim/Services/FreeswitchService/FreeswitchService.cs index 84674ec..0a38300 100644 --- a/OpenSim/Services/FreeswitchService/FreeswitchService.cs +++ b/OpenSim/Services/FreeswitchService/FreeswitchService.cs @@ -38,9 +38,7 @@ namespace OpenSim.Services.FreeswitchService { public class FreeswitchService : FreeswitchServiceBase, IFreeswitchService { - private static readonly ILog m_log = - LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); + //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public FreeswitchService(IConfigSource config) : base(config) { -- cgit v1.1 From e5904c388388ae5be4eb466c0c70f0ef4c628446 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey Date: Wed, 5 Aug 2009 17:39:32 +0100 Subject: remove some more mono compiler warnings --- .../Agent/TextureDownload/UserTextureDownloadService.cs | 12 ++++++------ .../Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/CoreModules/Agent/TextureDownload/UserTextureDownloadService.cs index 65138e2..19f0f90 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureDownload/UserTextureDownloadService.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureDownload/UserTextureDownloadService.cs @@ -60,22 +60,22 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload /// currently handle properly as far as I know). However, this situation should be handled in a more /// sophisticated way. /// - private static readonly int MAX_ALLOWED_TEXTURE_REQUESTS = 5; +// private static readonly int MAX_ALLOWED_TEXTURE_REQUESTS = 5; /// /// XXX Also going to limit requests for found textures. /// - private readonly IRequestLimitStrategy foundTextureLimitStrategy - = new RepeatLimitStrategy(MAX_ALLOWED_TEXTURE_REQUESTS); +// private readonly IRequestLimitStrategy foundTextureLimitStrategy +// = new RepeatLimitStrategy(MAX_ALLOWED_TEXTURE_REQUESTS); - private readonly IClientAPI m_client; +// private readonly IClientAPI m_client; private readonly Scene m_scene; /// /// Texture Senders are placed in this queue once they have received their texture from the asset /// cache. Another module actually invokes the send. /// - private readonly OpenSim.Framework.BlockingQueue m_sharedSendersQueue; +// private readonly OpenSim.Framework.BlockingQueue m_sharedSendersQueue; /// /// Holds texture senders before they have received the appropriate texture from the asset cache. @@ -95,7 +95,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload { // m_client = client; m_scene = scene; - m_sharedSendersQueue = sharedQueue; +// m_sharedSendersQueue = sharedQueue; } /// diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 7f691ba..bc36fda 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -9032,7 +9032,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Match m = r.Match(url); if (m.Success) { for (int i = 1; i < gnums.Length; i++) { - System.Text.RegularExpressions.Group g = m.Groups[gnums[i]]; + //System.Text.RegularExpressions.Group g = m.Groups[gnums[i]]; //CaptureCollection cc = g.Captures; } if (m.Groups.Count == 5) { -- cgit v1.1 From 9e0f1b7fef658d7873b5cce994b7beb1bbc4ca30 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 5 Aug 2009 18:01:18 +0100 Subject: reinstate TestSaveIarV0_1() --- .../Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 780327f..cf3b29f 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -66,7 +66,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests /// /// Test saving a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet). /// - //[Test] + [Test] public void TestSaveIarV0_1() { TestHelper.InMethod(); -- cgit v1.1 From 1b65bd5861dd8e36e05c1f9c69040270b0855b5c Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 5 Aug 2009 18:21:22 +0100 Subject: Recomment TestReplicateArchivePathToUserInventory() for now due to occasional test fail --- .../Inventory/Archiver/Tests/InventoryArchiverTests.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index cf3b29f..4928ede 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -264,17 +264,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests } Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); - Assert.That(foundItem, Is.Not.Null); - Assert.That(foundItem.CreatorId, Is.EqualTo(item1.CreatorId)); - Assert.That(foundItem.CreatorIdAsUuid, Is.EqualTo(user2Uuid)); - Assert.That(foundItem.Owner, Is.EqualTo(userUuid)); + Assert.That(foundItem, Is.Not.Null, "Didn't find loaded item"); + Assert.That( + foundItem.CreatorId, Is.EqualTo(item1.CreatorId), + "Loaded item non-uuid creator doesn't match original"); + Assert.That( + foundItem.CreatorIdAsUuid, Is.EqualTo(user2Uuid), + "Loaded item uuid creator doesn't match original"); + Assert.That(foundItem.Owner, Is.EqualTo(userUuid), + "Loaded item owner doesn't match inventory reciever"); Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); } /// /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where - /// no account exists with the creator name + /// no account exists with the creator name /// //[Test] public void TestLoadIarV0_1TempProfiles() @@ -353,7 +358,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests /// /// Test replication of an archive path to the user's inventory. /// - [Test] + //[Test] public void TestReplicateArchivePathToUserInventory() { TestHelper.InMethod(); -- cgit v1.1 From f8d8f07cb44853710706559632e709af5fc8971b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 5 Aug 2009 18:59:44 +0100 Subject: Remove waiting in TestReplicateArchivePathToUserInventory() since local inventory loading is synchronous Insert a little more debugging info in case the occasional failure reoccurs --- .../Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 7 +++++-- .../Inventory/LocalInventoryServiceConnector.cs | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 4928ede..95308ea 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -358,7 +358,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests /// /// Test replication of an archive path to the user's inventory. /// - //[Test] + [Test] public void TestReplicateArchivePathToUserInventory() { TestHelper.InMethod(); @@ -367,6 +367,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests CachedUserInfo userInfo = UserProfileTestUtils.CreateUserWithInventory(commsManager); userInfo.FetchInventory(); + /* for (int i = 0 ; i < 50 ; i++) { if (userInfo.HasReceivedInventory == true) @@ -374,6 +375,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests Thread.Sleep(200); } Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); + */ Dictionary foldersCreated = new Dictionary(); List nodesLoaded = new List(); @@ -394,7 +396,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests new InventoryArchiveReadRequest(userInfo, null, (Stream)null, null, null) .ReplicateArchivePathToUserInventory(itemArchivePath, false, userInfo.RootFolder, foldersCreated, nodesLoaded); - + + Console.WriteLine("userInfo.RootFolder: {0}", userInfo.RootFolder); InventoryFolderImpl folder1 = userInfo.RootFolder.FindFolderByPath("a"); Assert.That(folder1, Is.Not.Null, "Could not find folder a"); InventoryFolderImpl folder2 = folder1.FindFolderByPath("b"); diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index a304357..e70d985 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs @@ -39,7 +39,6 @@ using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; using OpenMetaverse; - namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory { public class LocalInventoryServicesConnector : ISharedRegionModule, IInventoryService -- cgit v1.1 From 9e5736eeeccee4c96a0a7b80a099f6705ceb09e3 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 5 Aug 2009 19:06:07 +0100 Subject: insert a little more debug info for TestReplicateArchivePathToUserInventory() --- .../Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 95308ea..cd14340 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -376,6 +376,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests } Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); */ + + Console.WriteLine("userInfo.RootFolder 1: {0}", userInfo.RootFolder); + Dictionary foldersCreated = new Dictionary(); List nodesLoaded = new List(); @@ -393,11 +396,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests = string.Format( "{0}{1}/{2}/{3}", ArchiveConstants.INVENTORY_PATH, folder1ArchiveName, folder2ArchiveName, itemName); + + Console.WriteLine("userInfo.RootFolder 2: {0}", userInfo.RootFolder); new InventoryArchiveReadRequest(userInfo, null, (Stream)null, null, null) .ReplicateArchivePathToUserInventory(itemArchivePath, false, userInfo.RootFolder, foldersCreated, nodesLoaded); - Console.WriteLine("userInfo.RootFolder: {0}", userInfo.RootFolder); + Console.WriteLine("userInfo.RootFolder 3: {0}", userInfo.RootFolder); InventoryFolderImpl folder1 = userInfo.RootFolder.FindFolderByPath("a"); Assert.That(folder1, Is.Not.Null, "Could not find folder a"); InventoryFolderImpl folder2 = folder1.FindFolderByPath("b"); -- cgit v1.1 From 07e00e110d6954eb995382fc0e03af19a46811ab Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 5 Aug 2009 19:38:45 +0100 Subject: Reinstate TestLoadIarV0_1ExistingUsers(), removing unnecessary wait --- .../Archiver/Tests/InventoryArchiverTests.cs | 23 +++++++++++----------- OpenSim/Tests/Common/TestHelper.cs | 2 +- 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index cd14340..877a2ac 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -202,19 +202,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests /// Test loading a V0.1 OpenSim Inventory Archive (subject to change since there is no fixed format yet) where /// an account exists with the creator name. /// - //[Test] + [Test] public void TestLoadIarV0_1ExistingUsers() { TestHelper.InMethod(); - //log4net.Config.XmlConfigurator.Configure(); + log4net.Config.XmlConfigurator.Configure(); string userFirstName = "Mr"; string userLastName = "Tiddles"; UUID userUuid = UUID.Parse("00000000-0000-0000-0000-000000000555"); - string user2FirstName = "Lord"; - string user2LastName = "Lucan"; - UUID user2Uuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); + string userItemCreatorFirstName = "Lord"; + string userItemCreatorLastName = "Lucan"; + UUID userItemCreatorUuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); string itemName = "b.lsl"; string archiveItemName @@ -227,7 +227,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests item1.Name = itemName; item1.AssetID = UUID.Random(); item1.GroupID = UUID.Random(); - item1.CreatorId = OspResolver.MakeOspa(user2FirstName, user2LastName); + item1.CreatorId = OspResolver.MakeOspa(userItemCreatorFirstName, userItemCreatorLastName); //item1.CreatorId = userUuid.ToString(); //item1.CreatorId = "00000000-0000-0000-0000-000000000444"; item1.Owner = UUID.Zero; @@ -249,13 +249,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests userAdminService.AddUser( userFirstName, userLastName, "meowfood", String.Empty, 1000, 1000, userUuid); userAdminService.AddUser( - user2FirstName, user2LastName, "hampshire", String.Empty, 1000, 1000, user2Uuid); + userItemCreatorFirstName, userItemCreatorLastName, "hampshire", + String.Empty, 1000, 1000, userItemCreatorUuid); archiverModule.DearchiveInventory(userFirstName, userLastName, "/", archiveReadStream); CachedUserInfo userInfo = scene.CommsManager.UserProfileCacheService.GetUserDetails(userFirstName, userLastName); - userInfo.FetchInventory(); + //userInfo.FetchInventory(); + /* for (int i = 0 ; i < 50 ; i++) { if (userInfo.HasReceivedInventory == true) @@ -263,18 +265,17 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests Thread.Sleep(200); } Assert.That(userInfo.HasReceivedInventory, Is.True, "FetchInventory timed out (10 seconds)"); + */ InventoryItemBase foundItem = userInfo.RootFolder.FindItemByPath(itemName); Assert.That(foundItem, Is.Not.Null, "Didn't find loaded item"); Assert.That( foundItem.CreatorId, Is.EqualTo(item1.CreatorId), "Loaded item non-uuid creator doesn't match original"); Assert.That( - foundItem.CreatorIdAsUuid, Is.EqualTo(user2Uuid), + foundItem.CreatorIdAsUuid, Is.EqualTo(userItemCreatorUuid), "Loaded item uuid creator doesn't match original"); Assert.That(foundItem.Owner, Is.EqualTo(userUuid), "Loaded item owner doesn't match inventory reciever"); - - Console.WriteLine("Successfully completed {0}", MethodBase.GetCurrentMethod()); } /// diff --git a/OpenSim/Tests/Common/TestHelper.cs b/OpenSim/Tests/Common/TestHelper.cs index f0b3376..4abf2e3 100644 --- a/OpenSim/Tests/Common/TestHelper.cs +++ b/OpenSim/Tests/Common/TestHelper.cs @@ -54,7 +54,7 @@ namespace OpenSim.Tests.Common public static void InMethod() { StackTrace stackTrace = new StackTrace(); - Console.WriteLine("==> In Test Method : {0}", stackTrace.GetFrame(1).GetMethod().Name); + Console.WriteLine("===> In Test Method : {0} <===", stackTrace.GetFrame(1).GetMethod().Name); } } } -- cgit v1.1 From 1f7466e5c3136d0580a21b5f2f4d8f18fa9fc72f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 5 Aug 2009 20:04:27 +0100 Subject: test item data storage impementation (unused as of yet) --- .../Tests/Common/Mock/TestInventoryDataPlugin.cs | 45 +++++++++++++++------- 1 file changed, 31 insertions(+), 14 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs index 442ff06..1b14abb 100644 --- a/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/TestInventoryDataPlugin.cs @@ -39,12 +39,17 @@ namespace OpenSim.Tests.Common.Mock /// tests are single threaded. /// public class TestInventoryDataPlugin : IInventoryDataPlugin - { + { /// - /// Known inventory folders + /// Inventory folders /// private Dictionary m_folders = new Dictionary(); + //// + /// Inventory items + /// + private Dictionary m_items = new Dictionary(); + /// /// User root folders /// @@ -99,9 +104,7 @@ namespace OpenSim.Tests.Common.Mock } return folders; - } - - public InventoryItemBase getInventoryItem(UUID item) { return null; } + } public InventoryFolderBase getInventoryFolder(UUID folderId) { @@ -111,15 +114,6 @@ namespace OpenSim.Tests.Common.Mock return folder; } - public void addInventoryItem(InventoryItemBase item) {} - public void updateInventoryItem(InventoryItemBase item) {} - public void deleteInventoryItem(UUID item) {} - - public InventoryItemBase queryInventoryItem(UUID item) - { - return null; - } - public InventoryFolderBase queryInventoryFolder(UUID folderID) { return getInventoryFolder(folderID); @@ -150,6 +144,29 @@ namespace OpenSim.Tests.Common.Mock m_folders.Remove(folderId); } + public void addInventoryItem(InventoryItemBase item) { m_items[item.ID] = item; } + + public void updateInventoryItem(InventoryItemBase item) { addInventoryItem(item); } + + public void deleteInventoryItem(UUID itemId) + { + if (m_items.ContainsKey(itemId)) + m_items.Remove(itemId); + } + + public InventoryItemBase getInventoryItem(UUID itemId) + { + if (m_items.ContainsKey(itemId)) + return m_items[itemId]; + else + return null; + } + + public InventoryItemBase queryInventoryItem(UUID item) + { + return null; + } + public List fetchActiveGestures(UUID avatarID) { return null; } } } -- cgit v1.1 From bc6de6f5f0c40db9b9f5073089f75a99f518b219 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 5 Aug 2009 20:05:22 +0100 Subject: Disable TestReplicateArchivePathToUserInventory() pending more investigation --- .../Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 877a2ac..14cee36 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs @@ -359,7 +359,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests /// /// Test replication of an archive path to the user's inventory. /// - [Test] + //[Test] public void TestReplicateArchivePathToUserInventory() { TestHelper.InMethod(); -- cgit v1.1 From e8b0f7cf5d1595b19d884d7f865929ad7e228227 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 5 Aug 2009 20:37:10 +0100 Subject: Remove bad assembly identification tag --- OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs | 3 --- 1 file changed, 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index 5471f9e..696f915 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs @@ -41,9 +41,6 @@ using OpenSim.Framework.Servers.HttpServer; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; -[assembly: Addin("SampleMoneyModule", "0.1")] -[assembly: AddinDependency("OpenSim", "0.5")] - namespace OpenSim.Region.OptionalModules.World.MoneyModule { /// -- cgit v1.1 From 535cb0efc194cd444f315cc99fe7771cf4293f2c Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Wed, 5 Aug 2009 16:47:48 -0400 Subject: * Patch from jhurliman to add accept type recognition to determine the llsd content format. *should allow both json and xml serializations of llsd to work properly. Signed-off-by: Teravus Ovares (Dan Olivares) --- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 74 ++++++++++++++++++++-- 1 file changed, 67 insertions(+), 7 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 98e7f0e..878e2fd 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -457,6 +457,10 @@ namespace OpenSim.Framework.Servers.HttpServer // This has to be here to prevent a Linux/Mono crash m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); } + catch (IOException e) + { + m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message); + } return; } @@ -464,7 +468,8 @@ namespace OpenSim.Framework.Servers.HttpServer { foreach (string strAccept in request.AcceptTypes) { - if (strAccept.Contains("application/llsd+xml")) + if (strAccept.Contains("application/llsd+xml") || + strAccept.Contains("application/llsd+json")) { //m_log.Info("[Debug BASE HTTP SERVER]: Found an application/llsd+xml accept header"); HandleLLSDRequests(request, response); @@ -483,12 +488,14 @@ namespace OpenSim.Framework.Servers.HttpServer case "application/llsd+xml": case "application/xml+llsd": + case "application/llsd+json": //m_log.Info("[Debug BASE HTTP SERVER]: found a application/llsd+xml content type"); HandleLLSDRequests(request, response); return; case "text/xml": case "application/xml": + case "application/json": default: //m_log.Info("[Debug BASE HTTP SERVER]: in default handler"); // Point of note.. the DoWeHaveA methods check for an EXACT path @@ -529,9 +536,9 @@ namespace OpenSim.Framework.Servers.HttpServer // with the minimum first m_log.WarnFormat("[BASE HTTP SERVER]: HandleRequest threw {0}.\nNOTE: this may be spurious on Linux", e); } - catch (EndOfStreamException e) + catch (IOException e) { - m_log.ErrorFormat("[BASE HTTP SERVER]: HandleRequest() threw {0}", e); + m_log.ErrorFormat("[BASE HTTP SERVER] HandleRequest() threw ", e); } catch (InvalidOperationException e) { @@ -760,6 +767,10 @@ namespace OpenSim.Framework.Servers.HttpServer // This has to be here to prevent a Linux/Mono crash m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); } + catch (IOException e) + { + m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message); + } } return; //responseString = "Error"; @@ -793,6 +804,10 @@ namespace OpenSim.Framework.Servers.HttpServer // This has to be here to prevent a Linux/Mono crash m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); } + catch (IOException e) + { + m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message); + } } } @@ -823,7 +838,7 @@ namespace OpenSim.Framework.Servers.HttpServer } try { - llsdRequest = OSDParser.DeserializeLLSDXml(requestBody); + llsdRequest = OSDParser.Deserialize(requestBody); } catch (Exception ex) { @@ -873,10 +888,10 @@ namespace OpenSim.Framework.Servers.HttpServer } else { - response.ContentType = "application/llsd+xml"; - //m_log.Info("[Debug BASE HTTP SERVER]: Response: " + llsdResponse.ToString()); - buffer = OSDParser.SerializeLLSDXmlBytes(llsdResponse); + // Select an appropriate response format + buffer = BuildLLSDResponse(request, response, llsdResponse); } + response.SendChunked = false; response.ContentLength64 = buffer.Length; response.ContentEncoding = Encoding.UTF8; @@ -912,6 +927,47 @@ namespace OpenSim.Framework.Servers.HttpServer } } + private byte[] BuildLLSDResponse(OSHttpRequest request, OSHttpResponse response, OSD llsdResponse) + { + if (request.AcceptTypes != null && request.AcceptTypes.Length > 0) + { + foreach (string strAccept in request.AcceptTypes) + { + switch (strAccept) + { + case "application/llsd+xml": + case "application/xml": + case "text/xml": + response.ContentType = strAccept; + return OSDParser.SerializeLLSDXmlBytes(llsdResponse); + case "application/llsd+json": + case "application/json": + response.ContentType = strAccept; + return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(llsdResponse)); + } + } + } + + if (!String.IsNullOrEmpty(request.ContentType)) + { + switch (request.ContentType) + { + case "application/llsd+xml": + case "application/xml": + case "text/xml": + response.ContentType = request.ContentType; + return OSDParser.SerializeLLSDXmlBytes(llsdResponse); + case "application/llsd+json": + case "application/json": + response.ContentType = request.ContentType; + return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(llsdResponse)); + } + } + + response.ContentType = "application/llsd+json"; + return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(llsdResponse)); + } + /// /// Checks if we have an Exact path in the LLSD handlers for the path provided /// @@ -1404,6 +1460,10 @@ namespace OpenSim.Framework.Servers.HttpServer // This has to be here to prevent a Linux/Mono crash m_log.WarnFormat("[BASE HTTP SERVER] XmlRpcRequest issue {0}.\nNOTE: this may be spurious on Linux.", e); } + catch (IOException e) + { + m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message); + } } } -- cgit v1.1 From c73ee1d06eb94c5c08691de2f353f7ef2964a67c Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 6 Aug 2009 01:10:45 +0100 Subject: Complete the work on the Replaceable interface logic. From this commit onwards the mere presence of a full version of a replaceable module will cause the replaceable module in core to be deactivated. --- .../RegionModulesControllerPlugin.cs | 103 ++++++++++++++++++++- 1 file changed, 102 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs b/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs index 9f7abd0..6331519 100644 --- a/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs +++ b/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs @@ -149,21 +149,68 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController public void AddRegionToModules (Scene scene) { + Dictionary deferredSharedModules = + new Dictionary(); + Dictionary deferredNonSharedModules = + new Dictionary(); + + Type s = scene.GetType(); + MethodInfo mi = s.GetMethod("RequestModuleInterface"); + + List sharedlist = new List(); foreach (ISharedRegionModule module in m_sharedInstances) { + Type replaceableInterface = module.ReplacableInterface; + if (replaceableInterface != null) + { + MethodInfo mii = mi.MakeGenericMethod(replaceableInterface); + + if (mii.Invoke(scene, new object[0]) != null) + { + m_log.DebugFormat("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString()); + continue; + } + + deferredSharedModules[replaceableInterface] = module; + m_log.DebugFormat("[REGIONMODULE]: Deferred load of {0}", module.Name); + continue; + } + m_log.DebugFormat("[REGIONMODULE]: Adding scene {0} to shared module {1}", scene.RegionInfo.RegionName, module.Name); + module.AddRegion(scene); scene.AddRegionModule(module.Name, module); + + sharedlist.Add(module); } List list = new List(); foreach (Type type in m_nonSharedModules) { INonSharedRegionModule module = (INonSharedRegionModule)Activator.CreateInstance(type); + + Type replaceableInterface = module.ReplacableInterface; + if (replaceableInterface != null) + { + MethodInfo mii = mi.MakeGenericMethod(replaceableInterface); + + if (mii.Invoke(scene, new object[0]) != null) + { + m_log.DebugFormat("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString()); + continue; + } + + deferredNonSharedModules[replaceableInterface] = module; + m_log.DebugFormat("[REGIONMODULE]: Deferred load of {0}", module.Name); + continue; + } + m_log.DebugFormat("[REGIONMODULE]: Adding scene {0} to non-shared module {1}", scene.RegionInfo.RegionName, module.Name); + module.Initialise(m_openSim.ConfigSource.Source); + list.Add(module); } @@ -173,6 +220,60 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController scene.AddRegionModule(module.Name, module); } + // Now all modules without a replaceable base interface are loaded + // Replaceable modules have either been skipped, or omitted. + // Now scan the deferred modules here + + foreach (ISharedRegionModule module in deferredSharedModules.Values) + { + Type replaceableInterface = module.ReplacableInterface; + MethodInfo mii = mi.MakeGenericMethod(replaceableInterface); + + if (mii.Invoke(scene, new object[0]) != null) + { + m_log.DebugFormat("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString()); + continue; + } + + m_log.DebugFormat("[REGIONMODULE]: Adding scene {0} to shared module {1} (deferred)", + scene.RegionInfo.RegionName, module.Name); + + module.AddRegion(scene); + scene.AddRegionModule(module.Name, module); + + sharedlist.Add(module); + } + + List deferredlist = new List(); + foreach (INonSharedRegionModule module in deferredNonSharedModules.Values) + { + Type replaceableInterface = module.ReplacableInterface; + if (replaceableInterface != null) + { + MethodInfo mii = mi.MakeGenericMethod(replaceableInterface); + + if (mii.Invoke(scene, new object[0]) != null) + { + m_log.DebugFormat("[REGIONMODULE]: Not loading {0} because another module has registered {1}", module.Name, replaceableInterface.ToString()); + continue; + } + } + + m_log.DebugFormat("[REGIONMODULE]: Adding scene {0} to non-shared module {1} (deferred)", + scene.RegionInfo.RegionName, module.Name); + + module.Initialise(m_openSim.ConfigSource.Source); + + list.Add(module); + deferredlist.Add(module); + } + + foreach (INonSharedRegionModule module in deferredlist) + { + module.AddRegion(scene); + scene.AddRegionModule(module.Name, module); + } + // This is needed for all module types. Modules will register // Interfaces with scene in AddScene, and will also need a means // to access interfaces registered by other modules. Without @@ -183,7 +284,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController // and unneccessary caching logic repeated in all modules. // The extra function stub is just that much cleaner // - foreach (ISharedRegionModule module in m_sharedInstances) + foreach (ISharedRegionModule module in sharedlist) { module.RegionLoaded(scene); } -- cgit v1.1 From efc57bc3d79e9c3c0971a2715a407ad08e030f02 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 6 Aug 2009 02:29:12 +0100 Subject: Allow arbitrary wildcards in config includes. Things like Include-Modules = "addin-modules/*/config/*.ini" will now work. Adds Util.Glob, which will resolve a globbed path into a string list. --- OpenSim/Framework/Util.cs | 51 +++++++++++++++++++++++ OpenSim/Region/Application/ConfigurationLoader.cs | 7 ++-- 2 files changed, 55 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 0a9b67d..65d4f4d 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -1111,5 +1111,56 @@ namespace OpenSim.Framework return null; } + public static string[] Glob(string path) + { + string vol=String.Empty; + + if (Path.VolumeSeparatorChar != Path.DirectorySeparatorChar) + { + string[] vcomps = path.Split(new char[] {Path.VolumeSeparatorChar}, 2, StringSplitOptions.RemoveEmptyEntries); + + if (vcomps.Length > 1) + { + path = vcomps[1]; + vol = vcomps[0]; + } + } + + string[] comps = path.Split(new char[] {Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar}, StringSplitOptions.RemoveEmptyEntries); + + // Glob + + path = vol; + if (vol != String.Empty) + path += new String(new char[] {Path.VolumeSeparatorChar, Path.DirectorySeparatorChar}); + else + path = new String(new char[] {Path.DirectorySeparatorChar}); + + List paths = new List(); + List found = new List(); + paths.Add(path); + + foreach (string c in comps) + { + List addpaths = new List(); + foreach (string p in paths) + { + string[] dirs = Directory.GetDirectories(p, c); + + if (dirs.Length != 0) + { + foreach (string dir in dirs) + addpaths.Add(Path.Combine(path, dir)); + } + + string[] files = Directory.GetFiles(p, c); + foreach (string f in files) + found.Add(f); + } + paths = addpaths; + } + + return found.ToArray(); + } } } diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index 1be36ca..7bb8864 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs @@ -188,10 +188,11 @@ namespace OpenSim { string path = Path.GetFullPath( Path.Combine(Util.configDir(), file)); - if (File.Exists(path)) + string[] paths = Util.Glob(path); + foreach (string p in paths) { - if (!sources.Contains(path)) - sources.Add(path); + if (!sources.Contains(p)) + sources.Add(p); } } } -- cgit v1.1