diff options
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | 70 |
2 files changed, 74 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 52add23..8ed1913 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -423,9 +423,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
423 | currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4; | 423 | currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4; |
424 | currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun; | 424 | currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun; |
425 | currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight; | 425 | currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight; |
426 | 426 | ||
427 | IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>(); | 427 | IEstateModule estateModule = m_scene.RequestModuleInterface<IEstateModule>(); |
428 | estateModule.sendRegionHandshakeToAll(); | 428 | |
429 | if (estateModule != null) | ||
430 | estateModule.sendRegionHandshakeToAll(); | ||
429 | 431 | ||
430 | return true; | 432 | return true; |
431 | } | 433 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index edac4a4..4f7a137 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs | |||
@@ -36,6 +36,7 @@ using OpenMetaverse; | |||
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Framework.Communications.Cache; | 37 | using OpenSim.Framework.Communications.Cache; |
38 | using OpenSim.Framework.Serialization; | 38 | using OpenSim.Framework.Serialization; |
39 | using OpenSim.Framework.Serialization.External; | ||
39 | using OpenSim.Region.CoreModules.World.Serialiser; | 40 | using OpenSim.Region.CoreModules.World.Serialiser; |
40 | using OpenSim.Region.CoreModules.World.Terrain; | 41 | using OpenSim.Region.CoreModules.World.Terrain; |
41 | using OpenSim.Region.Framework.Scenes; | 42 | using OpenSim.Region.Framework.Scenes; |
@@ -270,6 +271,75 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests | |||
270 | } | 271 | } |
271 | 272 | ||
272 | /// <summary> | 273 | /// <summary> |
274 | /// Test loading the region settings of a V0.2 OpenSim Region Archive. | ||
275 | /// </summary> | ||
276 | [Test] | ||
277 | public void TestLoadOarV0_2RegionSettings() | ||
278 | { | ||
279 | TestHelper.InMethod(); | ||
280 | //log4net.Config.XmlConfigurator.Configure(); | ||
281 | |||
282 | SerialiserModule serialiserModule = new SerialiserModule(); | ||
283 | ArchiverModule archiverModule = new ArchiverModule(); | ||
284 | Scene scene = SceneSetupHelpers.SetupScene(); | ||
285 | SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); | ||
286 | |||
287 | MemoryStream archiveWriteStream = new MemoryStream(); | ||
288 | TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); | ||
289 | |||
290 | tar.WriteDir(ArchiveConstants.TERRAINS_PATH); | ||
291 | tar.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, ArchiveWriteRequestExecution.Create0p2ControlFile()); | ||
292 | |||
293 | RegionSettings rs = new RegionSettings(); | ||
294 | rs.AgentLimit = 17; | ||
295 | rs.AllowDamage = true; | ||
296 | rs.AllowLandJoinDivide = true; | ||
297 | rs.AllowLandResell = true; | ||
298 | rs.BlockFly = true; | ||
299 | rs.BlockShowInSearch = true; | ||
300 | rs.BlockTerraform = true; | ||
301 | rs.DisableCollisions = true; | ||
302 | rs.DisablePhysics = true; | ||
303 | rs.DisableScripts = true; | ||
304 | rs.Elevation1NW = 15.9; | ||
305 | rs.Elevation1NE = 45.3; | ||
306 | rs.Elevation1SE = 49; | ||
307 | rs.Elevation1SW = 1.9; | ||
308 | rs.Elevation2NW = 4.5; | ||
309 | rs.Elevation2NE = 19.2; | ||
310 | rs.Elevation2SE = 9.2; | ||
311 | rs.Elevation2SW = 2.1; | ||
312 | rs.FixedSun = true; | ||
313 | rs.ObjectBonus = 1.4; | ||
314 | rs.RestrictPushing = true; | ||
315 | rs.TerrainLowerLimit = 0.4; | ||
316 | rs.TerrainRaiseLimit = 17.9; | ||
317 | rs.TerrainTexture1 = UUID.Parse("00000000-0000-0000-0000-000000000020"); | ||
318 | rs.TerrainTexture2 = UUID.Parse("00000000-0000-0000-0000-000000000040"); | ||
319 | rs.TerrainTexture3 = UUID.Parse("00000000-0000-0000-0000-000000000060"); | ||
320 | rs.TerrainTexture4 = UUID.Parse("00000000-0000-0000-0000-000000000080"); | ||
321 | rs.UseEstateSun = true; | ||
322 | rs.WaterHeight = 23; | ||
323 | |||
324 | tar.WriteFile(ArchiveConstants.SETTINGS_PATH + "region1.xml", RegionSettingsSerializer.Serialize(rs)); | ||
325 | |||
326 | tar.Close(); | ||
327 | |||
328 | MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); | ||
329 | |||
330 | lock (this) | ||
331 | { | ||
332 | scene.EventManager.OnOarFileLoaded += LoadCompleted; | ||
333 | archiverModule.DearchiveRegion(archiveReadStream); | ||
334 | } | ||
335 | |||
336 | Assert.That(m_lastErrorMessage, Is.Null); | ||
337 | RegionSettings loadedRs = scene.RegionInfo.RegionSettings; | ||
338 | |||
339 | Assert.That(loadedRs.AgentLimit, Is.EqualTo(17)); | ||
340 | } | ||
341 | |||
342 | /// <summary> | ||
273 | /// Test merging a V0.2 OpenSim Region Archive into an existing scene | 343 | /// Test merging a V0.2 OpenSim Region Archive into an existing scene |
274 | /// </summary> | 344 | /// </summary> |
275 | //[Test] | 345 | //[Test] |