diff options
author | onefang | 2019-05-19 21:24:15 +1000 |
---|---|---|
committer | onefang | 2019-05-19 21:24:15 +1000 |
commit | 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch) | |
tree | a9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Tests/Common/Helpers/SceneHelpers.cs | |
parent | Add a build script. (diff) | |
download | opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2 opensim-SC-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz |
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to 'OpenSim/Tests/Common/Helpers/SceneHelpers.cs')
-rw-r--r-- | OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 74 |
1 files changed, 39 insertions, 35 deletions
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 | |||
102 | 102 | ||
103 | m_physicsScene = StartPhysicsScene(); | 103 | m_physicsScene = StartPhysicsScene(); |
104 | 104 | ||
105 | SimDataService | 105 | SimDataService |
106 | = OpenSim.Server.Base.ServerUtils.LoadPlugin<ISimulationDataService>("OpenSim.Tests.Common.dll", null); | 106 | = OpenSim.Server.Base.ServerUtils.LoadPlugin<ISimulationDataService>("OpenSim.Tests.Common.dll", null); |
107 | } | 107 | } |
108 | 108 | ||
@@ -146,7 +146,7 @@ namespace OpenSim.Tests.Common | |||
146 | 146 | ||
147 | // We must set up a console otherwise setup of some modules may fail | 147 | // We must set up a console otherwise setup of some modules may fail |
148 | MainConsole.Instance = new MockConsole(); | 148 | MainConsole.Instance = new MockConsole(); |
149 | 149 | ||
150 | RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1"); | 150 | RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1"); |
151 | regInfo.RegionName = name; | 151 | regInfo.RegionName = name; |
152 | regInfo.RegionID = id; | 152 | regInfo.RegionID = id; |
@@ -156,6 +156,9 @@ namespace OpenSim.Tests.Common | |||
156 | TestScene testScene = new TestScene( | 156 | TestScene testScene = new TestScene( |
157 | regInfo, m_acm, SimDataService, m_estateDataService, configSource, null); | 157 | regInfo, m_acm, SimDataService, m_estateDataService, configSource, null); |
158 | 158 | ||
159 | testScene.RegionInfo.EstateSettings = new EstateSettings(); | ||
160 | testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random(); | ||
161 | |||
159 | INonSharedRegionModule godsModule = new GodsModule(); | 162 | INonSharedRegionModule godsModule = new GodsModule(); |
160 | godsModule.Initialise(new IniConfigSource()); | 163 | godsModule.Initialise(new IniConfigSource()); |
161 | godsModule.AddRegion(testScene); | 164 | godsModule.AddRegion(testScene); |
@@ -196,14 +199,13 @@ namespace OpenSim.Tests.Common | |||
196 | m_presenceService.AddRegion(testScene); | 199 | m_presenceService.AddRegion(testScene); |
197 | m_presenceService.RegionLoaded(testScene); | 200 | m_presenceService.RegionLoaded(testScene); |
198 | testScene.AddRegionModule(m_presenceService.Name, m_presenceService); | 201 | testScene.AddRegionModule(m_presenceService.Name, m_presenceService); |
199 | 202 | ||
200 | testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random(); | 203 | |
201 | testScene.SetModuleInterfaces(); | 204 | testScene.SetModuleInterfaces(); |
202 | 205 | ||
203 | testScene.LandChannel = new TestLandChannel(testScene); | 206 | testScene.LandChannel = new TestLandChannel(testScene); |
204 | testScene.LoadWorldMap(); | 207 | testScene.LoadWorldMap(); |
205 | 208 | ||
206 | testScene.RegionInfo.EstateSettings = new EstateSettings(); | ||
207 | testScene.LoginsEnabled = true; | 209 | testScene.LoginsEnabled = true; |
208 | testScene.RegisterRegionWithGrid(); | 210 | testScene.RegisterRegionWithGrid(); |
209 | 211 | ||
@@ -215,10 +217,10 @@ namespace OpenSim.Tests.Common | |||
215 | private static LocalAssetServicesConnector StartAssetService(CoreAssetCache cache) | 217 | private static LocalAssetServicesConnector StartAssetService(CoreAssetCache cache) |
216 | { | 218 | { |
217 | IConfigSource config = new IniConfigSource(); | 219 | IConfigSource config = new IniConfigSource(); |
218 | config.AddConfig("Modules"); | 220 | config.AddConfig("Modules"); |
219 | config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); | 221 | config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); |
220 | config.AddConfig("AssetService"); | 222 | config.AddConfig("AssetService"); |
221 | config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); | 223 | config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); |
222 | config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); | 224 | config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); |
223 | 225 | ||
224 | LocalAssetServicesConnector assetService = new LocalAssetServicesConnector(); | 226 | LocalAssetServicesConnector assetService = new LocalAssetServicesConnector(); |
@@ -233,7 +235,7 @@ namespace OpenSim.Tests.Common | |||
233 | 235 | ||
234 | cache.Initialise(cacheConfig); | 236 | cache.Initialise(cacheConfig); |
235 | } | 237 | } |
236 | 238 | ||
237 | return assetService; | 239 | return assetService; |
238 | } | 240 | } |
239 | 241 | ||
@@ -255,7 +257,7 @@ namespace OpenSim.Tests.Common | |||
255 | 257 | ||
256 | private static LocalInventoryServicesConnector StartInventoryService() | 258 | private static LocalInventoryServicesConnector StartInventoryService() |
257 | { | 259 | { |
258 | IConfigSource config = new IniConfigSource(); | 260 | IConfigSource config = new IniConfigSource(); |
259 | config.AddConfig("Modules"); | 261 | config.AddConfig("Modules"); |
260 | config.AddConfig("InventoryService"); | 262 | config.AddConfig("InventoryService"); |
261 | config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector"); | 263 | config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector"); |
@@ -264,8 +266,8 @@ namespace OpenSim.Tests.Common | |||
264 | 266 | ||
265 | LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector(); | 267 | LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector(); |
266 | inventoryService.Initialise(config); | 268 | inventoryService.Initialise(config); |
267 | 269 | ||
268 | return inventoryService; | 270 | return inventoryService; |
269 | } | 271 | } |
270 | 272 | ||
271 | private static LocalGridServicesConnector StartGridService() | 273 | private static LocalGridServicesConnector StartGridService() |
@@ -280,7 +282,7 @@ namespace OpenSim.Tests.Common | |||
280 | 282 | ||
281 | LocalGridServicesConnector gridService = new LocalGridServicesConnector(); | 283 | LocalGridServicesConnector gridService = new LocalGridServicesConnector(); |
282 | gridService.Initialise(config); | 284 | gridService.Initialise(config); |
283 | 285 | ||
284 | return gridService; | 286 | return gridService; |
285 | } | 287 | } |
286 | 288 | ||
@@ -301,7 +303,7 @@ namespace OpenSim.Tests.Common | |||
301 | 303 | ||
302 | LocalUserAccountServicesConnector userAccountService = new LocalUserAccountServicesConnector(); | 304 | LocalUserAccountServicesConnector userAccountService = new LocalUserAccountServicesConnector(); |
303 | userAccountService.Initialise(config); | 305 | userAccountService.Initialise(config); |
304 | 306 | ||
305 | return userAccountService; | 307 | return userAccountService; |
306 | } | 308 | } |
307 | 309 | ||
@@ -326,7 +328,7 @@ namespace OpenSim.Tests.Common | |||
326 | 328 | ||
327 | LocalPresenceServicesConnector presenceService = new LocalPresenceServicesConnector(); | 329 | LocalPresenceServicesConnector presenceService = new LocalPresenceServicesConnector(); |
328 | presenceService.Initialise(config); | 330 | presenceService.Initialise(config); |
329 | 331 | ||
330 | return presenceService; | 332 | return presenceService; |
331 | } | 333 | } |
332 | 334 | ||
@@ -382,8 +384,8 @@ namespace OpenSim.Tests.Common | |||
382 | /// </summary> | 384 | /// </summary> |
383 | /// <remarks> | 385 | /// <remarks> |
384 | /// If called directly, then all the modules must be shared modules. | 386 | /// If called directly, then all the modules must be shared modules. |
385 | /// | 387 | /// |
386 | /// We are emulating here the normal calls made to setup region modules | 388 | /// We are emulating here the normal calls made to setup region modules |
387 | /// (Initialise(), PostInitialise(), AddRegion, RegionLoaded()). | 389 | /// (Initialise(), PostInitialise(), AddRegion, RegionLoaded()). |
388 | /// TODO: Need to reuse normal runtime module code. | 390 | /// TODO: Need to reuse normal runtime module code. |
389 | /// </remarks> | 391 | /// </remarks> |
@@ -606,7 +608,7 @@ namespace OpenSim.Tests.Common | |||
606 | /// <returns></returns> | 608 | /// <returns></returns> |
607 | public static SceneObjectGroup AddSceneObject(Scene scene) | 609 | public static SceneObjectGroup AddSceneObject(Scene scene) |
608 | { | 610 | { |
609 | return AddSceneObject(scene, "Test Object", UUID.Zero); | 611 | return AddSceneObject(scene, "Test Object", UUID.Random()); |
610 | } | 612 | } |
611 | 613 | ||
612 | /// <summary> | 614 | /// <summary> |
@@ -624,6 +626,7 @@ namespace OpenSim.Tests.Common | |||
624 | //part.ObjectFlags |= (uint)PrimFlags.Phantom; | 626 | //part.ObjectFlags |= (uint)PrimFlags.Phantom; |
625 | 627 | ||
626 | scene.AddNewSceneObject(so, true); | 628 | scene.AddNewSceneObject(so, true); |
629 | so.InvalidateDeepEffectivePerms(); | ||
627 | 630 | ||
628 | return so; | 631 | return so; |
629 | } | 632 | } |
@@ -650,10 +653,11 @@ namespace OpenSim.Tests.Common | |||
650 | SceneObjectGroup so = CreateSceneObject(parts, ownerId, partNamePrefix, uuidTail); | 653 | SceneObjectGroup so = CreateSceneObject(parts, ownerId, partNamePrefix, uuidTail); |
651 | 654 | ||
652 | scene.AddNewSceneObject(so, false); | 655 | scene.AddNewSceneObject(so, false); |
656 | so.InvalidateDeepEffectivePerms(); | ||
653 | 657 | ||
654 | return so; | 658 | return so; |
655 | } | 659 | } |
656 | 660 | ||
657 | /// <summary> | 661 | /// <summary> |
658 | /// Create a scene object part. | 662 | /// Create a scene object part. |
659 | /// </summary> | 663 | /// </summary> |
@@ -662,10 +666,10 @@ namespace OpenSim.Tests.Common | |||
662 | /// <param name="ownerId"></param> | 666 | /// <param name="ownerId"></param> |
663 | /// <returns></returns> | 667 | /// <returns></returns> |
664 | public static SceneObjectPart CreateSceneObjectPart(string name, UUID id, UUID ownerId) | 668 | public static SceneObjectPart CreateSceneObjectPart(string name, UUID id, UUID ownerId) |
665 | { | 669 | { |
666 | return new SceneObjectPart( | 670 | return new SceneObjectPart( |
667 | ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | 671 | ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) |
668 | { Name = name, UUID = id, Scale = new Vector3(1, 1, 1) }; | 672 | { Name = name, UUID = id, Scale = new Vector3(1, 1, 1) }; |
669 | } | 673 | } |
670 | 674 | ||
671 | /// <summary> | 675 | /// <summary> |
@@ -680,10 +684,10 @@ namespace OpenSim.Tests.Common | |||
680 | /// <param name="ownerId"></param> | 684 | /// <param name="ownerId"></param> |
681 | /// <returns></returns> | 685 | /// <returns></returns> |
682 | public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId) | 686 | public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId) |
683 | { | 687 | { |
684 | return CreateSceneObject(parts, ownerId, 0x1); | 688 | return CreateSceneObject(parts, ownerId, 0x1); |
685 | } | 689 | } |
686 | 690 | ||
687 | /// <summary> | 691 | /// <summary> |
688 | /// Create a scene object but do not add it to the scene. | 692 | /// Create a scene object but do not add it to the scene. |
689 | /// </summary> | 693 | /// </summary> |
@@ -695,10 +699,10 @@ namespace OpenSim.Tests.Common | |||
695 | /// </param> | 699 | /// </param> |
696 | /// <returns></returns> | 700 | /// <returns></returns> |
697 | public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId, int uuidTail) | 701 | public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId, int uuidTail) |
698 | { | 702 | { |
699 | return CreateSceneObject(parts, ownerId, "", uuidTail); | 703 | return CreateSceneObject(parts, ownerId, "", uuidTail); |
700 | } | 704 | } |
701 | 705 | ||
702 | /// <summary> | 706 | /// <summary> |
703 | /// Create a scene object but do not add it to the scene. | 707 | /// Create a scene object but do not add it to the scene. |
704 | /// </summary> | 708 | /// </summary> |
@@ -716,22 +720,22 @@ namespace OpenSim.Tests.Common | |||
716 | /// </param> | 720 | /// </param> |
717 | /// <returns></returns> | 721 | /// <returns></returns> |
718 | public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId, string partNamePrefix, int uuidTail) | 722 | public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId, string partNamePrefix, int uuidTail) |
719 | { | 723 | { |
720 | string rawSogId = string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail); | 724 | string rawSogId = string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail); |
721 | 725 | ||
722 | SceneObjectGroup sog | 726 | SceneObjectGroup sog |
723 | = new SceneObjectGroup( | 727 | = new SceneObjectGroup( |
724 | CreateSceneObjectPart(string.Format("{0}Part1", partNamePrefix), new UUID(rawSogId), ownerId)); | 728 | CreateSceneObjectPart(string.Format("{0}Part1", partNamePrefix), new UUID(rawSogId), ownerId)); |
725 | 729 | ||
726 | if (parts > 1) | 730 | if (parts > 1) |
727 | for (int i = 2; i <= parts; i++) | 731 | for (int i = 2; i <= parts; i++) |
728 | sog.AddPart( | 732 | sog.AddPart( |
729 | CreateSceneObjectPart( | 733 | CreateSceneObjectPart( |
730 | string.Format("{0}Part{1}", partNamePrefix, i), | 734 | string.Format("{0}Part{1}", partNamePrefix, i), |
731 | new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail + i - 1)), | 735 | new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail + i - 1)), |
732 | ownerId)); | 736 | ownerId)); |
733 | 737 | ||
734 | return sog; | 738 | return sog; |
735 | } | 739 | } |
736 | } | 740 | } |
737 | } | 741 | } |