From 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 19 May 2019 21:24:15 +1000 Subject: Dump OpenSim 0.9.0.1 into it's own branch. --- OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 74 +++++++++++++++------------- 1 file changed, 39 insertions(+), 35 deletions(-) (limited to 'OpenSim/Tests/Common/Helpers/SceneHelpers.cs') diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs index df8b14c..7902fb1 100644 --- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs +++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs @@ -102,7 +102,7 @@ namespace OpenSim.Tests.Common m_physicsScene = StartPhysicsScene(); - SimDataService + SimDataService = OpenSim.Server.Base.ServerUtils.LoadPlugin("OpenSim.Tests.Common.dll", null); } @@ -146,7 +146,7 @@ namespace OpenSim.Tests.Common // We must set up a console otherwise setup of some modules may fail MainConsole.Instance = new MockConsole(); - + RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1"); regInfo.RegionName = name; regInfo.RegionID = id; @@ -156,6 +156,9 @@ namespace OpenSim.Tests.Common TestScene testScene = new TestScene( regInfo, m_acm, SimDataService, m_estateDataService, configSource, null); + testScene.RegionInfo.EstateSettings = new EstateSettings(); + testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random(); + INonSharedRegionModule godsModule = new GodsModule(); godsModule.Initialise(new IniConfigSource()); godsModule.AddRegion(testScene); @@ -196,14 +199,13 @@ namespace OpenSim.Tests.Common m_presenceService.AddRegion(testScene); m_presenceService.RegionLoaded(testScene); testScene.AddRegionModule(m_presenceService.Name, m_presenceService); - - testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random(); + + testScene.SetModuleInterfaces(); testScene.LandChannel = new TestLandChannel(testScene); - testScene.LoadWorldMap(); + testScene.LoadWorldMap(); - testScene.RegionInfo.EstateSettings = new EstateSettings(); testScene.LoginsEnabled = true; testScene.RegisterRegionWithGrid(); @@ -215,10 +217,10 @@ namespace OpenSim.Tests.Common private static LocalAssetServicesConnector StartAssetService(CoreAssetCache cache) { IConfigSource config = new IniConfigSource(); - config.AddConfig("Modules"); - config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); + config.AddConfig("Modules"); + config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); config.AddConfig("AssetService"); - config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); + config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); LocalAssetServicesConnector assetService = new LocalAssetServicesConnector(); @@ -233,7 +235,7 @@ namespace OpenSim.Tests.Common cache.Initialise(cacheConfig); } - + return assetService; } @@ -255,7 +257,7 @@ namespace OpenSim.Tests.Common private static LocalInventoryServicesConnector StartInventoryService() { - IConfigSource config = new IniConfigSource(); + IConfigSource config = new IniConfigSource(); config.AddConfig("Modules"); config.AddConfig("InventoryService"); config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector"); @@ -264,8 +266,8 @@ namespace OpenSim.Tests.Common LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector(); inventoryService.Initialise(config); - - return inventoryService; + + return inventoryService; } private static LocalGridServicesConnector StartGridService() @@ -280,7 +282,7 @@ namespace OpenSim.Tests.Common LocalGridServicesConnector gridService = new LocalGridServicesConnector(); gridService.Initialise(config); - + return gridService; } @@ -301,7 +303,7 @@ namespace OpenSim.Tests.Common LocalUserAccountServicesConnector userAccountService = new LocalUserAccountServicesConnector(); userAccountService.Initialise(config); - + return userAccountService; } @@ -326,7 +328,7 @@ namespace OpenSim.Tests.Common LocalPresenceServicesConnector presenceService = new LocalPresenceServicesConnector(); presenceService.Initialise(config); - + return presenceService; } @@ -382,8 +384,8 @@ namespace OpenSim.Tests.Common /// /// /// If called directly, then all the modules must be shared modules. - /// - /// We are emulating here the normal calls made to setup region modules + /// + /// We are emulating here the normal calls made to setup region modules /// (Initialise(), PostInitialise(), AddRegion, RegionLoaded()). /// TODO: Need to reuse normal runtime module code. /// @@ -606,7 +608,7 @@ namespace OpenSim.Tests.Common /// public static SceneObjectGroup AddSceneObject(Scene scene) { - return AddSceneObject(scene, "Test Object", UUID.Zero); + return AddSceneObject(scene, "Test Object", UUID.Random()); } /// @@ -624,6 +626,7 @@ namespace OpenSim.Tests.Common //part.ObjectFlags |= (uint)PrimFlags.Phantom; scene.AddNewSceneObject(so, true); + so.InvalidateDeepEffectivePerms(); return so; } @@ -650,10 +653,11 @@ namespace OpenSim.Tests.Common SceneObjectGroup so = CreateSceneObject(parts, ownerId, partNamePrefix, uuidTail); scene.AddNewSceneObject(so, false); + so.InvalidateDeepEffectivePerms(); return so; } - + /// /// Create a scene object part. /// @@ -662,10 +666,10 @@ namespace OpenSim.Tests.Common /// /// public static SceneObjectPart CreateSceneObjectPart(string name, UUID id, UUID ownerId) - { + { return new SceneObjectPart( - ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) - { Name = name, UUID = id, Scale = new Vector3(1, 1, 1) }; + ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + { Name = name, UUID = id, Scale = new Vector3(1, 1, 1) }; } /// @@ -680,10 +684,10 @@ namespace OpenSim.Tests.Common /// /// public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId) - { + { return CreateSceneObject(parts, ownerId, 0x1); } - + /// /// Create a scene object but do not add it to the scene. /// @@ -695,10 +699,10 @@ namespace OpenSim.Tests.Common /// /// public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId, int uuidTail) - { + { return CreateSceneObject(parts, ownerId, "", uuidTail); - } - + } + /// /// Create a scene object but do not add it to the scene. /// @@ -716,22 +720,22 @@ namespace OpenSim.Tests.Common /// /// public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId, string partNamePrefix, int uuidTail) - { + { string rawSogId = string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail); - - SceneObjectGroup sog + + SceneObjectGroup sog = new SceneObjectGroup( CreateSceneObjectPart(string.Format("{0}Part1", partNamePrefix), new UUID(rawSogId), ownerId)); - + if (parts > 1) for (int i = 2; i <= parts; i++) sog.AddPart( CreateSceneObjectPart( - string.Format("{0}Part{1}", partNamePrefix, i), + string.Format("{0}Part{1}", partNamePrefix, i), new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail + i - 1)), ownerId)); - + return sog; - } + } } } -- cgit v1.1